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

Evolving your monolith into services

One of the most complicated aspects of transitioning from a monolith to services can be request routing. In later recipes and chapters, we'll explore the topic of exposing your services to the internet so that the mobile and web client applications can communicate directly with them. For now, however, having your monolith act as a router can serve as a useful intermediary step. 

As you break your monolith into small, maintainable microservices, you can replace code paths in your monolith with calls to your services. Depending on the programming language or framework you used to build your monolith, these sections of code can be called controller actions, views, or something else. We'll continue to assume that your monolith was built in the popular Ruby on Rails framework; in which case, we'll be looking at controller actions. We'll also assume that you've begun refactoring your monolith and have created one or more service objects as described in the previous recipe.

It's important when doing this to follow best practices. In later chapters, we'll introduce concepts, such as circuit breakers, that become important when doing service-to-service communication. For now, be mindful that HTTP calls from your monolith to a service could fail, and you should consider how best to handle that kind of situation. 

主站蜘蛛池模板: 贵州省| 商丘市| 灌阳县| 抚远县| 化德县| 黑水县| 丹阳市| 金川县| 枣强县| 江安县| 隆尧县| 洪雅县| 开原市| 周口市| 山阳县| 湖州市| 宁河县| 湖口县| 那曲县| 育儿| 汤原县| 沽源县| 安图县| 鹰潭市| 长兴县| 怀宁县| 屏山县| 新乡县| 新密市| 昌吉市| 井陉县| 泸定县| 井研县| 扶沟县| 宝应县| 孝义市| 容城县| 临潭县| 黄平县| 辽阳市| 那曲县|