So You Want to Build An Event Driven System? - James Eastham - CPH DevFest 2024

Learn essential patterns and best practices for building event-driven systems including architecture choices, governance, consistency models, and avoiding common pitfalls.

Key takeaways
  • Event-driven architecture fundamentally reverses lines of integration and dependency between services, enabling more loosely coupled systems

  • Start small when adopting event-driven patterns - pick non-critical functionality first and gradually expand rather than trying to make the entire system event-driven overnight

  • Use thin events (containing minimal data like IDs) for public interfaces and thick events (containing full data) for private communications between services you control

  • Implement good governance practices including:

    • Schema management
    • Version control of events
    • Deprecation policies
    • Clean up mechanisms for old events
    • Change management processes
  • Consider using patterns like:

    • Outbox pattern for reliable event publishing
    • Claim check pattern for handling large payloads
    • Event-carried state transfer
    • Asynchronous commands when needed
  • Plan for eventual consistency rather than strong consistency in most cases - embrace asynchronous patterns where possible

  • Control ingestion rates and protect systems with queues between event publishers and subscribers

  • Use event storming workshops to identify business events and establish shared language between technical and business teams

  • Keep events immutable - they represent facts that have happened in the past

  • Include proper observability, tracing and monitoring capabilities from the start as debugging event-driven systems can be complex