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

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. 

主站蜘蛛池模板: 红原县| 喀喇沁旗| 阜新市| 平南县| 新竹市| 武邑县| 齐齐哈尔市| 通山县| 永泰县| 乾安县| 商都县| 华坪县| 武胜县| 常山县| 南投县| 包头市| 鹤庆县| 广宗县| 桂平市| 大同市| 鹤山市| 呼和浩特市| 天等县| 五台县| 乐亭县| 石门县| 峨山| 延寿县| 巫溪县| 平罗县| 四平市| 博爱县| 盐城市| 始兴县| 武功县| 清水县| 建昌县| 上杭县| 来凤县| 泸定县| 石阡县|