Grokking Microservices Design Patterns

Master microservices design patterns for designing scalable, resilient, and more manageable systems.

Level:
Intermediate
Study Time:
13h
Lessons:
158
Playgrounds:
32
Assessments:
249
Updated
Last month
4.1
(4,640 ratings)
13,921 learners
Arslan Ahmad
Created byArslan Ahmad
Ex FAANG Manager, Expert Behind Grokking Microservices Design Patterns

Course Overview

Delve into the world of microservices with this comprehensive online course, designed to equip software professionals with the tools they need to tackle modern software architecture. Through this course, learners will gain a deep understanding of the principles, patterns, and best practices that underpin microservice architectures. This course sheds light on why microservices have become the go-to architecture for scalable and resilient applications, from startups to tech giants. It navigates through the essential design patterns like Sidecar, API Gateway, Circuit Breaker, and more, providing real-world examples and code snippets. Whether you're a seasoned developer, a budding software architect, or an IT professional looking to stay ahead of the curve, this course offers valuable insights into how to design and manage complex systems with microservices. Immerse yourself in this fascinating journey and embrace the future of software architecture. Join us in this course and gain the skills and knowledge you need to thrive in the ever-evolving world of technology. Your journey towards mastering microservice design patterns starts here.

Grokking Microservices Design Patterns Image
Best value
Lifetime access to this course
One-time payment. Yours forever.
Discussions
Certificate
Free updates
Want all 42+ courses?
Grokking Microservices Design Patterns Image
Best value
Lifetime access to this course
One-time payment. Yours forever.
Discussions
Certificate
Free updates
Want all 42+ courses?

What you'll learn in Grokking Microservices Design Patterns

  • Every major microservices pattern, each with the problem it solves and the cost it adds.
  • How to break up a monolith gradually with the strangler fig pattern, instead of a risky rewrite.
  • How a service mesh moves retries, timeouts and encryption out of your code into a proxy.
  • How to give every service its own database, and how to replace the joins and transactions you lose.
  • How to change data and publish its event together, so a database and a broker can never disagree.
  • How to split reads from writes with CQRS, and how to price the consistency lag it introduces.
  • Service discovery, and why hardcoded addresses stop working the moment the fleet changes shape.
  • Flashcards and an adaptive assessment per pattern chapter, so you can find the gaps yourself.
  • The problem each pattern was invented to solve, established before any talk of implementing it.
  • The resilience patterns that stop one slow dependency taking down everything around it.
  • The failure modes each resilience pattern adds, because a naive retry turns a small outage into a large one.
  • Distributed transactions without two-phase commit, using sagas and compensating actions.
  • How to store history instead of state with event sourcing, and rebuild any view by replaying it.
  • Event-driven architecture: what it gives you, and the debugging problem it hands back.
  • Short Java examples in every pattern chapter, so each mechanism is concrete not abstract.
  • System design examples from real companies, including Netflix, so no pattern stays a toy.

Course Content

• 19 Chapters • 158 Lessons
1.

Introduction

2 lessons

Who Should Take This Course?

Understand who this course is for, why these microservice patterns matter, and what naming a pattern actually gives you as an engineer.

The Course at a Glance

See how the pattern chapters are built, so you know what each one will cover before you open the first chapter of the course.

Introduction

Understand why a legacy system is replaced piece by piece rather than all at once, how the approach works, and why teams choose it.

The Problem: Legacy Systems

Understand what makes a legacy system hard to work on, why replacing it outright so often fails, and how this pattern helps instead.

The Strangler Pattern: A Solution

Understand how the strangler fig pattern replaces a legacy system gradually, while the old and the new system keep running together.

The Architecture of the Strangler Pattern

Understand the architecture of the strangler fig pattern: replacing one area at a time, the facade in front, and migrating in phases.

Strangler Pattern: A Detailed Example

Work through a migration in detail: the four operations, the routing table, choosing which customers move, and reading the trace.

Key Insights and Implications

Understand what the strangler fig pattern asks of a team, including the organizational side that decides whether it really succeeds.

Flashcards Review

Review the strangler fig pattern with flashcards on the facade, incremental routing, phased migration, and the big-bang rewrite.

Chapter Assessment

Test your understanding of the strangler fig pattern: the facade, the routing table, phased migration, and when to reach for it.

What is Service Discovery Pattern?

Understand why service discovery matters in a system where instances come and go, and exactly which problem the pattern solves.

The Problem: Service Coordination in Distributed Systems

Understand how services coordinate in a distributed system, and why hard-coded addresses stop working once instances move around.

Service Discovery Pattern: A Solution

Understand how service discovery solves that problem, so a caller can find a healthy instance without knowing its address first.

The Architecture of the Service Discovery Pattern

Understand the service discovery architecture, the role of the service registry, and how client-side and server-side discovery differ.

The Inner Workings of the Service Discovery Pattern

Understand self-registration against third-party registration, and the role health checks play in keeping a registry honest.

Service Discovery Pattern: An Example

Work through an example: the registry's three jobs, heartbeats and the time to live, and choosing between healthy instances.

Performance Implications and Special Considerations

Understand the latency a registry adds, how it scales, its fault tolerance, and the load balancing and failover strategies around it.

System Design Examples

See service discovery in use in microservice and cloud systems, through an e-commerce example and a streaming platform example.

Security Considerations

Understand the security side of service discovery, and what a registry must protect as services register and look each other up.

Flashcards Review

Review service discovery with flashcards on the registry, client-side and server-side discovery, registration, and health checks.

Chapter Assessment

Test your understanding of service discovery: the registry, client-side and server-side discovery, registration, and health checks.

Introduction

Understand the challenge of cascading failures, and why isolating parts of a system stops one failure from taking the rest down.

The Problem: Failure Propagation in Distributed Systems

Understand how failure propagates through a distributed system when every request shares the same single pool of resources.

The Bulkhead Pattern: A Solution

Understand how the bulkhead pattern isolates failures, and where its name comes from in the sealed compartments of a ship.

The Architecture

Understand the building blocks of the bulkhead pattern: isolating components, allocating resources, and handling the interactions.

The Inner Workings

Understand isolation and resource allocation in practice, failure detection and recovery, and what bulkheads do not solve for you.

Bulkhead Pattern: An Example

Work through a bulkhead example: the resource being divided, the two arrangements compared, and both halves of the trade involved.

Performance Implications and Special Considerations

Understand what bulkheads buy in useful work and predictable capacity, what they cost in response time, and how to size them.

System Design Examples

See bulkheads in use across e-commerce, online gaming, financial systems, and platforms serving many customers at once.

Conclusion

Review the value of the bulkhead pattern in a distributed system, and when the isolation it brings is worth what it costs you.

Flashcards Review

Review the bulkhead pattern with flashcards on isolation, resource pools, failure propagation, and sizing each compartment.

Chapter Assessment

Test your understanding of the bulkhead pattern: isolation, resource allocation, failure propagation, and sizing compartments.

Introduction to the Service Mesh

Understand what the service mesh pattern says, why it matters once every service repeats the same network logic, and what follows.

The Problem: Network Logic in Every Service

Understand why the same network code ends up inside every service, what goes wrong because of it, and why a library is not enough.

The Service Mesh: A Solution

Understand how moving network logic into a proxy meets the requirement, what the application is left doing, and what remains unsolved.

The Architecture of a Service Mesh

Understand the data plane and the control plane, mutual TLS between services, shifting traffic without a deploy, and what a mesh sees.

Service Mesh: An Example

Work through a mesh example: a retry and timeout rule, shifting ten percent of traffic, and the path one request actually takes.

Performance Implications and Special Considerations

Understand the two extra hops a mesh adds to every call, the resource cost per pod, the control plane dependency, and debugging.

Use Cases and System Design Examples

See when a service mesh pays for itself, when it is simply too much machinery, and the system designs where it does belong.

Conclusion

Review what a service mesh gives you, what it asks in return, and where it sits among the other patterns in this course.

Flashcards Review

Review the service mesh with flashcards on the data and control planes, sidecar proxies, mutual TLS, and shifting traffic safely.

Chapter Assessment

Test your understanding of the service mesh: the data and control planes, proxies, mutual TLS, traffic shifting, and its costs.

Introduction to Database per Service

Understand what the database per service pattern says, why it matters for the independence of a service, and what this chapter covers.

The Problem: One Shared Database

Understand the costs of one shared database: schema coupling, performance interference, a single failure domain, and coordination.

Database per Service: A Solution

Understand the rule behind database per service, what changes immediately once you follow it, and what you give up in exchange.

The Architecture of Database per Service

Understand the three levels of isolation, polyglot persistence, and how to handle the shared reference data every service wants.

Database per Service: An Example

Work through an example: the join that has to go, API composition in code, both costs counted, and where it stops being small.

Performance Implications and Special Considerations

Understand that queries now cross the network, that data gets duplicated, that there are more databases to run, and how to limit it.

Use Cases and System Design Examples

See when the database per service pattern fits, when it does not, and the system designs where each of those answers applies.

Conclusion

Review what database per service gives you, what it asks in return, and which patterns are worth reading next alongside it.

Flashcards Review

Review database per service with flashcards on schema coupling, the isolation levels, polyglot persistence, and API composition.

Chapter Assessment

Test your understanding of database per service: schema coupling, isolation, polyglot persistence, and composing data across services.

Introduction to Saga Pattern

Understand why a transaction is hard to run across services, the problem that creates, and how the saga pattern answers it.

The Problem: Traditional Transaction Models

Understand the traditional transaction models, where they break down across services, and why distributed work needs another way.

The Saga Pattern: A Solution

Understand what a saga is, how the pattern works, and the difference between the choreography and orchestration styles of running one.

The Architecture of the Saga Pattern

Understand the architecture of a saga: local transactions, choreography and orchestration, eventual consistency, and compensations.

The Inner Workings of the Saga Pattern

Understand how a saga undoes work in reverse order, what the saga log is for, and what to do when a compensation is not enough.

Saga Pattern: An Example

Work through a saga example: three rules the code shows, why compensations cannot give up, and what a saga does not give you.

Performance Implications

Understand the complexity and the extra latency a saga brings, and the consistency, idempotency, and ordering it demands of you.

System Design Examples

See sagas in use across e-commerce and travel booking, with worked system design examples including an online food delivery service.

Conclusion

Review the saga pattern and the architecture under it, how the theory turns into practice, real applications, and what to read next.

Flashcards Review

Review the saga pattern with flashcards on local transactions, compensations, the saga log, choreography, and orchestration.

Chapter Assessment

Test your understanding of the saga pattern: local transactions, compensations, the saga log, choreography, and orchestration.

Introduction to the Transactional Outbox Pattern

Understand what the transactional outbox pattern says, why it matters whenever a service writes data and publishes an event, and more.

The Problem: Dual Writes

Understand what a dual write is, the two orders in which it can fail, why the obvious fixes do not work, and what a real fix must do.

The Transactional Outbox: A Solution

Understand how one transaction plus a relay replaces two writes, why that meets the requirement, and the at-least-once price you pay.

The Architecture of the Outbox Pattern

Understand the outbox table and its two relay styles, a polling publisher and transaction log tailing, and how to choose between them.

Transactional Outbox: An Example

Work through an outbox example: the write path, the relay, an idempotent consumer, and the trace of one order through all of them.

Performance Implications and Special Considerations

Understand the publish delay, the write amplification, the growth of the outbox table, and duplicates and ordering under heavy load.

Use Cases and System Design Examples

See when the transactional outbox fits, when it is more machinery than you need, and the system designs where it earns its place.

Conclusion

Review what the transactional outbox gives you, what it asks in return, and which patterns are worth reading next alongside it.

Flashcards Review

Review the transactional outbox with flashcards on dual writes, the outbox table, relay styles, and idempotent consumers.

Chapter Assessment

Test your understanding of the transactional outbox: dual writes, the outbox table, the relay styles, and idempotent consumers.

Introduction

Understand how architecture patterns led here, and what the event-driven architecture pattern is in its own terms before the detail.

The Problem: Managing Complex Interactions in Distributed Systems

Understand why complex interactions break simple designs, the call for asynchronous messaging, and the data consistency this raises.

Event-Driven Architecture: A Promising Solution

Understand the benefits of event-driven architecture, and the components that an event-driven system is actually assembled from.

The Architecture of the Event-Driven Architecture Pattern

Understand the architecture of an event-driven system: its components, how they are structured, and how the whole thing operates.

The Inner Workings of the Event-Driven Architecture Pattern

Understand event generation and propagation, routing through event channels, event processing and state change, and real-time use.

Event-Driven Architecture Pattern: An Example

Work through an example: what changes between the two versions, the failure worth watching, and why ordering is the hard part.

Performance Implications and Special Considerations

Understand the scalability, latency, error handling and durability, complexity, and schema compatibility that events bring with them.

Use Cases and System Design Examples

See event-driven designs in real-time analytics, IoT, e-commerce, and microservices, with a ride-sharing example and when to avoid it.

Conclusion

Review the event-driven architecture pattern: what it gives you, what it asks in return, and where it belongs among the others.

Flashcards Review

Review event-driven architecture with flashcards on events and channels, producers and consumers, ordering, and schema changes.

Chapter Assessment

Test your understanding of event-driven architecture: events and channels, producers and consumers, ordering, and schema changes.

Introduction

Understand what CQRS is and why it is used in microservices, before going into how commands and queries are actually separated.

The Problem: Traditional CRUD Operations

Understand the limitations of traditional CRUD operations, and the problems of scale and performance that push teams towards CQRS.

CQRS Pattern: A Solution

Understand how CQRS answers those limits by splitting the write side of a system from the read side, and what that split buys you.

The Architecture of the CQRS Pattern

Understand the CQRS architecture: separate command and query models, separate read and write databases, and the role of events.

The Inner Workings of the CQRS Pattern

Understand the path of a command through validation, handling, and events, the path of a query, and how the two sides are synchronized.

CQRS Pattern: An Example

Work through a CQRS example: the command model, the query model, and the infrastructure that keeps the two of them in step.

Issues, Special Considerations, and Performance Implications

Understand the complexity of CQRS, how to manage data consistency, its performance implications, and how to handle transactions.

System Design Examples

See CQRS in high-performance applications, complex business logic, and collaborative domains, with event-driven design examples.

Flashcards Review

Review CQRS with flashcards on command and query models, separate read and write stores, synchronization, and eventual consistency.

Chapter Assessment

Test your understanding of CQRS: the command and query models, separate read and write stores, synchronization, and consistency.

Introduction to Event Sourcing

Understand what event sourcing says, why storing what happened matters more than storing the result, and what this chapter covers.

The Problem: Storing Only the Current State

Understand how an update destroys information, the questions you can no longer answer, and the limits of the usual workarounds.

Event Sourcing: A Solution

Understand how appending instead of updating lets a replay rebuild state, and why each event is recorded as a business fact.

The Architecture of Event Sourcing

Understand the event store, concurrency control, snapshots, projections and read models, and how to evolve an event schema safely.

Event Sourcing: An Example

Work through an example: the events, the aggregate, command handling and replay, and why the store has no balance column at all.

Performance Implications and Special Considerations

Understand the cost of a replay, the growth of storage, eventually consistent reads, the difficulty of deleting, and the team cost.

Use Cases and System Design Examples

See when event sourcing fits and when it does not, with worked examples of a payments ledger and a shopping cart and order system.

Conclusion

Review what event sourcing gives you, what it asks in return, and which patterns are worth reading next alongside it.

Flashcards Review

Review event sourcing with flashcards on the event store, replay, snapshots, projections, and the evolution of event schemas.

Chapter Assessment

Test your understanding of event sourcing: the event store, replay and snapshots, projections, and evolving an event schema.

What people say about our courses

MO JAFRI avatar
MO JAFRI
Software Engineer
The courses which have "grokking" before them, are exceptionally well put together! These courses magically condense 3 years of CS in short bite-size courses and lectures (I have tried Grokking System Design Interview, OODI, and Coding patterns). The Grokking courses are godsent, to be honest.
ABHISHEK GUPTA avatar
ABHISHEK GUPTA
Software Engineer
My offer from the top tech company would not have been possible without Grokking System Design. Many thanks!!
KAUSHIK JONNADULA avatar
KAUSHIK JONNADULA
Software Engineer
Thanks for a great resource! You guys are a lifesaver. I struggled a lot in design interviews, and Grokking System Design gave me an organized process to handle a design problem. Please keep adding more questions.
AHMET HANIF avatar
AHMET HANIF
Software Engineer
Whoever put this together, you folks are life savers. Thank you :)

About the Author

Arslan Ahmad

Arslan Ahmad

Design Gurus Founder
Ex-FAANG Manager
Meta
Microsoft
Google
Amazon
Uber

Industry Expertise & Leadership

Arslan Ahmad is the lead author of Grokking Microservices Design Patterns. As the founder of Design Gurus and a former FAANG hiring manager, he has worked at industry giants like Facebook (now Meta) and Microsoft.

He has conducted hundreds of system design interviews, giving him unique insight into what top tech companies look for in candidates.

The course also incorporates expertise from senior engineers at Google, Meta, Amazon, Microsoft, and Uber, ensuring you learn system design best practices from professionals who have built and scaled real-world systems.

500+

Interviews Conducted

10k+

Students Taught

Related Courses

Grokking Microservices Design Patterns
Master microservices design patterns for designing scalable, resilient, and more manageable systems.
4.1
14K learners
Discounted price for Your Region

$110

Grokking Design Patterns for Engineers and Managers
Unlock the power of design patterns: Elevate your coding skills with timeless solutions for top-notch software design.
4.2
5.7K learners
Discounted price for Your Region

$78

FAQs

It is a pattern by pattern guide to building microservices. Each pattern gets its own chapter that sets out the problem first, then the pattern, then its architecture, its trade-offs, and worked system design examples from real companies.

Backend and platform engineers working on or moving toward a microservices architecture, engineers preparing for system design interviews where microservices come up, and tech leads who have to justify a decomposition to other people. It suits anyone who has heard these pattern names in design reviews and wants to stop nodding along.

This course is the pattern catalogue: every pattern explained in depth on its own terms. The other course is decision-led and interview-shaped, built around whether to use microservices at all, where the boundaries go, how services communicate, and how to defend those calls out loud under questioning. If you want to know what the saga pattern is and when it applies, this is the one. If you want to be argued with about service boundaries in a mock interview, that is the other one. They complement each other rather than overlap.

Sixteen: strangler fig, API gateway, backends for frontends, service discovery, circuit breaker, bulkhead, retry, sidecar, service mesh, database per service, saga, transactional outbox, event-driven architecture, CQRS, event sourcing, and configuration externalization. Each gets a full chapter rather than a paragraph, which is what allows the trade-offs and failure modes to be covered rather than just the definition.

That is the part most courses skip, so five chapters build on each other here. Database per service gives each service its own store and takes away cross-service joins and transactions. Sagas put a multi-service change back together with compensating actions. The transactional outbox makes sure an event is really published when the data changes. CQRS separates the read model from the write model, and event sourcing stores the history rather than the current state.

No, but you should understand how a web service talks to another one and roughly what a queue and a load balancer do. The course starts each pattern from the problem it solves, so you do not need to have hit that problem in production to follow the reasoning, though it lands harder if you have.

Yes. Every pattern chapter carries short Java examples, and the CQRS chapter ends in a runnable exercise you can edit and run in the browser. The code is there to make the mechanism concrete rather than to teach a framework, so the weight of each chapter still sits on the architecture and the trade-offs, not on a Spring or Go walkthrough.

Every pattern chapter ends with a flashcards deck and an adaptive chapter assessment, and the course closes with a final exam that draws on all of them. Each assessment picks what to ask based on how you are doing, so retaking it gives you a different set. The questions test judgment, such as what a pattern costs or how it behaves in a crash, rather than definitions you can memorize. The final exam goes further and asks you to choose between patterns that look similar, and to work out what breaks when several of them meet in one system.

Yes. Naming the right pattern is one thing, but the part that scores is explaining what it costs, and the trade-off and failure-mode material here is aimed at exactly that. Being able to say why you would use a bulkhead rather than only a circuit breaker, or what a saga gives up in exchange for avoiding two-phase commit, is the level these interviews probe at.

Each pattern chapter opens with the problem, introduces the pattern, walks through its architecture, then covers a worked example, its performance implications, and how it behaves when things go wrong. Most chapters then give system design examples from real company architectures, and every pattern chapter ends with a flashcards deck and a chapter assessment.

Text-based, with architecture diagrams throughout. Since the material is comparative, weighing one pattern against another, having the diagrams and the trade-off lists side by side on a page is more useful than a linear video.

Yes. Design Gurus issues a certificate once you have completed the course, and you can share the link directly or add it to your LinkedIn profile.

Design Gurus logo
One-Stop Portal For Tech Interviews.
About Us
Our Team
Careers
Partners
Contact Us
Become Affiliate
Copyright © 2026 Design Gurus, LLC. All rights reserved.