Design more decoupled services with one weird trick - Udi Dahan - NDC Oslo 2024

Learn how upfront ID generation enables truly decoupled microservices by eliminating data dependencies. Discover patterns for independent workflows and proper event usage with Udi Dahan.

Key takeaways
  • Coupling is one of the biggest and oldest problems in software development - moving it around with different architectural patterns doesn’t solve the fundamental issue

  • Event-driven architecture alone doesn’t reduce coupling - it often just moves the coupling into events with large payloads of shared data

  • Vertical slice architecture helps by splitting functionality into independent vertical slices instead of horizontal layers, but data coupling often remains at the database level

  • Generating IDs upfront (the “weird trick”) allows services to collect and store their own data independently, indexed by that ID, rather than passing large data payloads between services

  • Past tense events (things that already happened) work better than using events for commands/requests - this maintains proper event-driven patterns

  • Complex workflows can be broken down into independent sub-workflows where each piece can succeed or fail independently

  • Business requirements often determine technical architecture decisions - like legal requirements around pricing and advertising affecting how data must be handled

  • Microservices don’t automatically solve coupling issues - sharing databases or passing large amounts of data between services maintains tight coupling

  • Data snapshots (like pricing) should be taken early in workflows to maintain consistency through the process

  • Front-end and back-end architectures need to align - micro-frontends can help maintain proper service boundaries and data ownership