Top 6 Microservices Patterns

  1. Database Per Service Pattern – as its name implies, each microservice has its own dedicated database. Not an easy pattern to implement as there’s lots of potential drawbacks and overhead in architecture development. Loose coupling and scaling are pluses.
  2. Single Database Pattern – microservices share one DB – a bit more forgiving approach than 1. The downside is coordination of efforts and cross-dependencies, which goes against the very philosophy of microservices.
  3. Saga Pipeline Pattern – a sequential pipeline of transactions that takes place with microservice “commit” events.
  4. API Composition Pattern – used for implementing complex queries in a microservices architecture.
  5. Command Query Responsibility Segregation Pattern – addresses the challenge of querying multiple microservices by defining a special database view designed to support such query.
  6. Event sourcing Pattern addresses the problem of maintaining data consistency across microservices (an alternative to this would be another pattern called “Transaction Log Trail”)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: