- Microservices with Clojure
- Anuj Kumar
- 416字
- 2021-06-30 19:24:29
Identifying candidates for microservices
The top-most challenge in migrating from a monolithic application to microservices is to identify the right candidates for microservices. A well structured and modularized monolithic application already has well-defined boundaries (bounded contexts) that can help disintegrate the application into microservices. For example, the User, Orders, and Interest modules already have well-defined boundaries and are good candidates to create microservices for. If the application does not have well-defined boundaries, the first step is to refactor the existing application to create such bounded contexts for microservices. Each bounded context must be tied to a business capability for which a service can be created.
Another approach in identifying the right candidates for microservices is to look at the data access patterns and associated business logic. If the same database is being updated by multiple components of a monolithic application, then it makes sense to create a service for the primary component with associated business logic that manages the database and makes it accessible to other services via APIs. This process can be repeated until databases and the associated business logic are managed by one and only one service that has a small set of responsibilities, modeled around a business capability.

For example, a monolithic application consisting of User, Interest, and Orders components can be migrated into microservices by picking one component at a time and creating a microservice with an isolated database, as shown in the preceding diagram. To start with, first pick the one with the least dependency, the User module, and create the User Service service around it. All other components can now talk to this new User Service for User Management, including authentication, authorization, and getting user profiles. Next, pick the Orders module based on the least dependency logic, and create a service around it. Finally, pick the Interest module as it is dependent on both the User and Orders modules. Since we have the databases isolated, we can also swap out the database for Interest with maybe a graph database that is efficient to store and retrieve user interests due to its inherent capability of storing relationships as a graph.
- 物聯(lián)網(wǎng)安全:理論、實踐與創(chuàng)新
- 物聯(lián)網(wǎng)網(wǎng)絡(luò)安全及應(yīng)用
- 智能網(wǎng)聯(lián)汽車V2X與智能網(wǎng)聯(lián)設(shè)施I2X
- Spring Boot 2.0 Projects
- 網(wǎng)絡(luò)故障現(xiàn)場處理實踐(第4版)
- 互聯(lián)網(wǎng)基礎(chǔ)資源技術(shù)與應(yīng)用發(fā)展態(tài)勢(2021—2023)
- PLC、現(xiàn)場總線及工業(yè)網(wǎng)絡(luò)實用技術(shù)速成
- Yii Application Development Cookbook(Second Edition)
- 物聯(lián)網(wǎng)通信技術(shù)
- 物聯(lián)網(wǎng)長距離無線通信技術(shù)應(yīng)用與開發(fā)
- CCNP TSHOOT(642-832)認(rèn)證考試指南
- 通信原理及MATLAB/Simulink仿真
- OMNeT++與網(wǎng)絡(luò)仿真
- 網(wǎng)絡(luò)安全應(yīng)急響應(yīng)技術(shù)實戰(zhàn)指南
- INSTANT LinkedIn Customization How-to