从单体迁移到微服务的7个重要原则

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"本文要点"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"即使到了2020年,你仍然很有可能在使用遗留系统。如果真的是这样,你可能会考虑是否要将其迁移到微服务架构。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在某些情况下,最好不要进行迁移——例如,如果你的大部分开发都是在新系统中进行的,而且很少有开发人员需要与遗留代码打交道。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"由于评估方面存在复杂性和难度,通常不适合进行正式的带有开始和结束日期限定的“项目”重构。但仍然需要得到自上而下的认可,需要安排好工作,这样才能取得持续的进展。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在重构之前先编写自动化测试用例,这是简化重构过程并确保新系统按照预期方式运行的最佳方法之一。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在构建已知的系统时,坚持使用已知的模式,并抑制直接走向危险边缘的冲动。开创一种全新的微服务方法成本很高,重构会让你忙得不可开交。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"多年来,我多次参与并密切观察了将单体遗留系统迁移到微服务架构的工作。通过这些痛苦的经历,我学到了很多,掉进过很多陷阱,也遇到过很多挑战。其中的一次尝试让我个人损失了一大笔钱,同时也是毁掉一家相关公司的一个关键因素。在这里我不详述细节,但我肯定不想让别人也经历这样的痛苦。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我试着总结出我所学到的一些经验教训,希望你在重构这片艰难的土地上能够顺利地进行迁移。对于这个话题,人们已经说了很多,但还是有一些建议(我多么希望之前就有人能给我这些建议),其中有一些是我以前从未听说过的。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我是"},{"type":"link","attrs":{"href":"https:\/\/garden.io\/","title":"","type":null},"content":[{"type":"text","text":"Garden"}]},{"type":"text","text":"公司的联合创始人。我们的目标是让开发人员能够更容易地测试、审查和诊断云原生微服务应用程序(我们的核心产品是开源的——如果感兴趣,可以"},{"type":"link","attrs":{"href":"https:\/\/github.com\/garden-io\/garden\/","title":"","type":null},"content":[{"type":"text","text":"看看"}]},{"type":"text","text":"),所以我花了很多时间与正在经历迁移的用户一起工作。通过这些互动,我总结了一些重要的并且值得分享的经验教训。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章