The idea is to take a complex problem and try to break it into smaller pieces. As mentioned in one of the advantages of microservices—Small business capability focused services are easier to maintain and refactor, we should build our microservice as a fine-grained service. This even allows for replacing the service without having to spend weeks or months attempting to do so. Each of these small units (microservices) should be capable enough to:
- Provide for its own private datastore
- Be independently deployable with its own runtime process
- Publish the public interface for others to use in the form of a API contract
- Be fault tolerant, so failure in one should not affect other services
- Be confined to a bounded context (from Domain driven design (DDD))