Here are some popular Microservice design patterns that a programmer should know:
- Service Registry pattern provides a central location for services to register themselves.
- Circuit Breaker allows your services to fail fast and prevent cascading failures, the circuit breaker pattern is used to isolate a failing service.
- API Gateway provides a common entry point for all the requests and responses from the system. So, client only remember one host/port address rather than multiple IPs for each Microservice.
- Event-Driven Architecture allows services to communicate with each other by emitting events.
- In Database per Service each service has its own database, which allows services to operate independently.
- Command Query Responsibility Segregation (CQRS) separates read and write requests for an application, allowing better scaling and performance.
- Externalized Configuration allows storing configuration data outside of the application code, making it easier to manage configuration changes.
- Saga Pattern manages the transaction forlong-running transactions that span multiple services.
- Bulkhead Pattern isolates failures within a microservice, so a single failure does not bring down the entire system.
- Backends for Frontends (BFF) design pattern provides a specific backend for each client. It allows the front-end team to develop features and add new client-specific functionality quickly.