Catalog My learning Blog
System Design Roadmap: 100-Day Course for Engineers · Phase 6 · Lesson 60 · 4 min read

System Design: Microservices E-Commerce Platform

On this page
  1. The problem: design a microservices e-commerce platform
  2. Services from bounded contexts
  3. Communication: synchronous where needed, events elsewhere
  4. Deployment and service discovery
  5. API and event versioning
  6. Resilience: timeouts, circuit breakers and fallbacks
  7. Data ownership and the checkout saga
  8. Getting there: platform first, then the strangler fig
  9. What a strong microservices platform design includes
  10. Check yourself

The problem: design a microservices e-commerce platform

A retailer's monolith serves 2 million customers and six product teams. Releases are slow and outages spread. Design the target microservices platform and how to get there. Cover service boundaries, communication, discovery, versioning, resilience and data ownership, and say what each choice costs.

Services from bounded contexts

ServiceOwnsTeam
CatalogProducts, descriptions, imagesMerchandising
PricingPrices, promotionsMerchandising
InventoryStock, reservationsSupply chain
CartActive cartsShopping
OrderingOrders, order linesShopping
PaymentsCharges, refundsPayments
ShippingShipments, trackingFulfillment
CustomerAccounts, addresses, loyaltyIdentity

Boundaries follow business capabilities and team ownership, not tables or layers.

Communication: synchronous where needed, events elsewhere

  • Clients → API gateway → BFFs for web and mobile, REST/JSON at the edge (Day 18).
  • Synchronous only where the caller needs the answer: cart asks pricing for prices, ordering asks inventory to reserve stock and payments to authorize. gRPC internally.
  • Events for everything else: OrderPlaced, PaymentCaptured, ShipmentDispatched, PriceChanged. Search indexing, emails, analytics and loyalty subscribe.

Deployment and service discovery

Services run on Kubernetes with autoscaling. They find each other by service name through cluster DNS, with readiness probes keeping unhealthy pods out of rotation.

API and event versioning

Public APIs are versioned in the path (/api/v1/). Internally, changes are additive with expand-and-contract, and consumer-driven contract tests catch breaking changes before deploy. Event schemas live in a registry.

Resilience: timeouts, circuit breakers and fallbacks

Every synchronous call has a timeout, limited retries with backoff, a circuit breaker and a bulkhead. Fallbacks are defined per call: if recommendations are down, show bestsellers; if the loyalty service is down, apply no discount and adjust later. With eight services and several languages, a service mesh is optional at first; adopt it when mutual TLS and traffic splitting across many services justify the operational cost.

Data ownership and the checkout saga

Each service owns its database: PostgreSQL for ordering, payments and customer; a document store for catalog; Redis for carts; OpenSearch for search, fed by catalog events. Order lines snapshot product name and price. Checkout is a saga across inventory, payments and shipping, with an outbox for reliable events (Days 49 and 50).

The platform: API gateway and BFFs, services each owning their database, synchronous calls where needed and events for everything else.
The platform: API gateway and BFFs, services each owning their database, synchronous calls where needed and events for everything else.

Getting there: platform first, then the strangler fig

Don't build all of this at once. First build the platform every service will need (Day 51): an automated pipeline that can create and deploy a new service in a day, centralized logs, metrics and tracing (Days 86 to 88), and shared defaults for resilience and authentication. Then put a gateway in front of the monolith, with shared login across old and new, and strangle it:

  1. Catalog first: changes often, read-heavy, low risk.
  2. Search next, fed by catalog events.
  3. Inventory, the current source of outages.
  4. Ordering, payments and shipping last, once the team has practice and the saga is proven.

Each step ships independently and can be rolled back. Each extraction moves the service's data too, with a clear owner at every stage, not just its code.

Name the organizational cost as well. Eight services means eight on-call rotations or a shared one that covers code nobody on shift wrote, eight pipelines, and eight sets of dashboards. With six teams that's manageable; with two, it isn't.

What a strong microservices platform design includes

  • Services tied to business capabilities and teams.
  • A stated rule for sync versus async, applied per interaction.
  • Resilience patterns on every synchronous call, with fallbacks.
  • Data ownership without shared tables, and how cross-service reads work.
  • An incremental migration plan, not a rewrite.
  • Honest costs: more infrastructure, tracing and on-call per service.
  • The platform built before the first extraction, not after the third.

Check yourself

Catalog changes often, is read-heavy and carries little risk if something goes wrong, so it's a safe place for the team to learn extraction, deployment and data migration. Payments is critical and tightly regulated, so it's better moved once the process is proven.

The platform work that should come before extraction: centralized structured logging, correlation ids passed through every call, and distributed tracing. Without them, a request that crosses three services leaves disconnected clues in three places, and diagnosing incidents takes hours.

The circuit breaker fails fast and a fallback applies, such as using the price stored in the cart within a validity window, or showing a clear "try again shortly" message, rather than hanging.

It subscribes to the catalog service's events, such as ProductCreated and ProductUpdated, and maintains its own search index from them. That keeps search fast and independent: it never queries catalog's database, and a catalog outage doesn't break search, though results may briefly lag behind changes.