Break a monolith to microservices - best practices and design principles
- Figure out how to segregate the data storage according to the constituent microservices, using a CQRS (command and query responsibility segregation) architecture so that data is not shared between microservices and is accessed only via APIs.
- Break down the migration into steps, applying domain-driven design, rather than overhauling all repositories, deployment, monitoring, and other complex tasks at once. First, build new capabilities as microservices, then break down the monolith, starting with transforming any known pain points and troublesome gaps.
- Allocate dedicated teams to every microservice to scale linearly and efficiently, as each team will be familiar with the nuances of its own service. Recognize this is as much a cultural shift as an operational one.
- Pair the right technology with the right microservice for maintainability, fault tolerance, scalability, economy, and ease of deployment, and choose languages based on the team’s existing skillset.
- Use ‘build and release’ automation to independently deploy each microservice.
- Use a REST API so you need not install additional software or libraries and can handle multiple types of calls and data formats.
- Isolate runtime processes with distributed computing - containerization, event architectures, HTTP management approaches, service meshes, circuit breakers, etc.
- Distinguish between dedicated and on-demand resources, moving between them to reduce response time and deliver a superior customer experience; also reduce dependency on open-source tools.
Full post here, 8 mins read