Wiki: Lessons learned from working with 2000 event-driven microservices

For agents: Markdown version · Wiki index · Explore

Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

Summary

The speaker shares lessons learned from adopting an event-driven architecture across thousands of microservices at a large web development platform. The presentation details common failure modes such as message publishing errors, out-of-order execution, non-idempotent consumers, and oversized payloads. The audience learns how infrastructural patterns, wrapper libraries, and self-service debugging tools can solve these challenges and ensure data consistency. Ultimately, developers gain actionable strategies for scaling reliable event-driven systems.

Key points

  • 2:23 Scaling to thousands of microservices introduced major challenges including message loss, out-of-order processing, and payload size limitations.
  • 6:59 Moving from synchronous REST calls to an event-driven architecture decoupled services and localized failures, improving overall system resilience.
  • 10:09 To fix message publishing failures caused by a lack of atomicity, the team wrapped message producers to fallback to object storage and a healer service.
  • 13:14 Out-of-order message delivery was addressed at the application level by attaching sequential version IDs to entities and schemas.
  • 16:33 Non-idempotent consumer issues were solved by storing event IDs in database schemas to safely ignore duplicate messages.
  • 17:43 Oversized payloads that exceeded message broker limits were handled via compression and offloading large data payloads to object storage.
  • 21:25 Providing self-service control planes and monitoring dashboards empowered developers to debug production traffic and consumer lags independently.

Takeaways

  • Wrap message producers with fallback mechanisms like object storage to ensure reliable publishing when the message broker is temporarily unavailable.
  • Enforce idempotency and ordering in consumers by embedding sequence numbers or unique event IDs directly into database schemas.
  • Build self-service monitoring and debugging tools early to help developers trace distributed event flows and investigate consumer lags.

Questions this talk answers

  • How can you guarantee data consistency and handle message publishing failures in an event-driven microservices architecture?
  • What strategies prevent out-of-order execution and non-idempotent message processing in event consumers?
  • How do you deal with oversized payloads and monitor consumer lag at a massive scale?

Technologies

Kafka, S3

Tags

data consistency, distributed systems, error handling, event-driven architecture, message queues, microservices, scalability