微服务如何启用 CI/CD

How do Microservices enable CI/CD

我已经阅读了很多文章,这些文章说明微服务支持 CI/CD。但是,这些文章没有解释如何或为什么会出现这种情况。一旦所有自动化测试都通过,您似乎也可以持续部署单体。

谢谢!

这有很多方面。

It seems that you could continuously deploy a monolith as well once all of its automated tests pass.

单体通常是 有状态的,例如会话用于短暂的用户状态。现代微服务架构通常遵循 The Twelve Factor App principles and are typically deployed on e.g. Kubernetes or other cloud environment. Apps following the Twelve Factor App principles and apps on Kubernetes are stateless, e.g. all user state most be handled outside the app. See https://12factor.net/processes

使用无状态应用程序,可以更轻松地扩展到更多实例,例如一个应用程序有 5 个实例,也很容易缩小到更少的实例,例如2 个实例。

当应用程序 无状态 并在多个实例中运行时 - 进行“滚动部署”,例如一次更新一个实例,从版本 1 到版本 2 是一个简单的过程和 Kubernetes 中的内置功能。

有了上述所有功能,与大型有状态单体应用程序相比,现在实施持续部署要容易得多。