官术网_书友最值得收藏!

Illogical splitting

The first issue of a microservice architecture is how it gets designed. There's no way a team can come up with the perfect microservice architecture in the first shot. Some microservices like the PDF generator are an obvious use case. But as soon as you deal with the business logic, there are good chances that your code will move around before you get a good grasp of how to split things into the right set of microservices.

The design needs to mature with some try-and-fail cycles. And adding and removing microservices can be more painful than refactoring a monolithic application.

You can mitigate this problem by avoiding splitting your app in microservices if the split is not evident.

Premature splitting is the root of all evil.

If there's any doubt that the split makes sense, keeping the code in the same app is the safe bet. It's always easier to split apart some of the code into a new microservice later than to merge back to two microservices in the same code base because the decision turned out to be wrong.

For instance, if you always have to deploy two microservices together, or if one change in a microservice impacts the data model of another one, the odds are that you did not split the application correctly, and that those two services should be reunited.

主站蜘蛛池模板: 丹棱县| 凉城县| 板桥市| 宁明县| 贺州市| 成安县| 漯河市| 铜川市| 兴义市| 勃利县| 虹口区| 临猗县| 石楼县| 随州市| 丁青县| 叶城县| 襄樊市| 日照市| 南陵县| 夏邑县| 聂拉木县| 玉门市| 武义县| 武隆县| 邹平县| 玉树县| 梨树县| 错那县| 黄梅县| 云和县| 台州市| 石家庄市| 常州市| 安平县| 城固县| 漯河市| 霍城县| 红安县| 马公市| 葫芦岛市| 迁安市|