Skip to content

Software Architecture Concepts

References

Event-Driven Architecture

EntityDescription
EventsNotification of an action
ProducersComponents/Services that generate or publish messages
ConsumersComponents/Services that subscribe or consume messages
Event BusCentral hub that facilitates communication
PROSCONS
Loose CouplingHigher Complexity
Easier ScalabilityHarder Testing and Debugging
Service ResiliencePossible eventual Inconsistency
Retriable ProcessChallenging Obersavability
Real-time data flowNeed mindset shift

Use Cases

  • e-commerce : order place, inventory update, trigger shipping, log analytics
  • social media :

Best Practices

  • Define clear event schemas
  • Make consumer idempotent - receive same event more than once, In distributed systems - duplicate can and will happen
    • if consumer processes order event twice and ships 2 packages then its a costly bug
  • Implement Robust Error Handling - use retries, dead-letter queue or fallback logic to prevent cascading failures
  • Monitor and log your events - track flow of events, how long things take and capture failures
    • helps indebugging, performance tuning and even security monitoring