10个让你的微服务失败的小妙招
视频来源:https://www.youtube.com/watch?v=X0tjziAQfNQ
你的老板想现代化,但你不想。破坏你的项目的事情。惨痛的教训。为了保护罪犯,事情被匿名化了。

- Tooling - Prefer one well-established tech stack. Too many tools often result in unintended complexity across the board.
- Data Ownership - Prefer separate databases or schemas for each micro-service to keep clear table ownership.
- Event Sourcing - Research whether you actually need it and design carefully.
- Coupling - Beware dependency versions and shared libraries (especially in-house ones). Microservices are often more coupled than we realize.
- Automation - Use CI/CD and automate your processes. Keep in mind that everything “hand-crafted” complicates your infrastructure.
- Failure - Design for failure. It’s a distributed, networked environment. And, again, avoid making a highly coupled microservice monolith monstrosity that fails simultaneously.
- FE Responsibilities - Have clear responsibilities. Associate certain frontend pages with certain APIs so that you know what microservice is responsible when something fails.
- Tooling - Having a few well-defined tools is a virtue; but, remain open to clearly better tools. Let teams use what works best on their project.
- Design - Model your services around the company’s domain and make sure management is aware of the high-level architecture.
- Communication - Communication between teams is a must. Have someone that understands how everything works together and what different teams are responsible for.
10)工具-优先使用一种成熟的技术堆栈。太多的工具通常会导致意想不到的复杂性。 9)数据所有权-为每个微服务优先使用单独的数据库或架构,以保持明确的表所有权。 8)事件搜寻-研究您是否真正需要它并仔细设计。 7) 耦合 - 当心依赖版本和共享库(尤其是内部库)。微服务往往比我们意识到的更耦合。 6) 自动化 - 使用 CI/CD 并自动化您的流程。请记住,所有”手工制作”的一切都使基础架构变得复杂。 5) 故障 - 故障设计。这是一个分布式的网络环境。同样,避免使高度耦合的微服务单体怪物同时失败。 4)有限责任责任-有明确的责任。将某些前端页面与某些API关联,以便您知道发生故障时微服务负责。 3)工具-拥有一些定义明确的工具是一种优点;但是,仍然可以使用明显更好的工具。让团队使用最适合自己项目的方法。 2) 设计 - 围绕公司领域建模您的服务,并确保管理层了解高级体系结构。 1)沟通-团队之间的沟通是必须的。让某人了解一切如何协同工作以及不同团队负责什么。