Back to Blog
Engineering18 Dec 2025

From Monolith to Microservices

AM
Arjun Mehta

The monolith in question was a 10-year-old e-commerce platform written in Java. It handled everything — product catalog, order management, payments, inventory, shipping, and customer accounts — in a single deployable artifact. Deployments took four hours and required a maintenance window.

The Strangler Fig Pattern

We did not attempt a big-bang rewrite. Instead, we used the strangler fig pattern: new features were built as independent services, and existing functionality was gradually extracted from the monolith. An API gateway routed traffic to either the monolith or the new services based on the endpoint.

Event-Driven Communication

The biggest architectural decision was moving from synchronous REST calls between services to an event-driven architecture using Apache Kafka. This decoupled services, improved resilience, and enabled us to build features that would have been impossibly complex in the monolith.

  • Order placement publishes an event consumed by inventory, payments, and shipping services independently
  • Failed payments trigger compensating transactions automatically
  • Real-time analytics built on the same event stream with zero additional load on services
  • Event replay capability for debugging and disaster recovery

Outcome

After 14 months, the monolith was fully decomposed into 18 services. Deployment frequency went from once a week to multiple times a day. Mean time to recovery dropped from hours to minutes. And the team could finally ship features independently without coordinating across the entire engineering organization.