Skip to content

3x orders

BYJU'S, monolith to events

Order and student domains on Kafka, plus $110K a month cut from AWS.

Organisation
BYJU'S
When
2020 - 2023
Areas
Event-driven architecture, Kafka, AWS ECS

Problem

The order and student domains lived in one monolith.

Every change touched the same codebase, and a slow path in one domain could hold up the others. As orders and students grew, that showed up as production incidents and slow order processing.

Constraints

  • The student service had to be low-latency and highly available for 2M+ active users.
  • A team of 4 engineers, which I led and mentored.
  • No downtime during the move. Students and sales teams used the system every day.

What I built

I split the monolith into order and student microservices that talk through Kafka, running on AWS ECS.

From monolith to event-driven services
  1. Monolith
  2. Kafka events
  3. Order service
  4. Student service

The order and student domains moved out one at a time. Each new service publishes its changes as Kafka events, so the rest of the system reacts to them instead of calling the service directly.

Outcome

  • 3x concurrent orders.
  • 40% better performance and 60% less processing time.
  • $110K+ a month saved on AWS.
  • 70% fewer production incidents, with APM monitoring and alerting on Datadog, Prometheus and Kibana.
  • 50% fewer production errors through TDD.

What I'd do differently

I'd agree on event schema contracts and versioning early, before the number of consumers grew. Changing an event's shape is easy with one consumer and expensive with many.