← All concepts
Messaging & flow
Event-driven architecture
Services publish events about what happened; others react asynchronously.
Instead of the order service calling shipping, email and analytics directly, it publishes 'order placed' to a durable log. Each consumer reads at its own pace, so the producer stays fast and new consumers can be added without changing it.
See it in action
Step through the scenarios on the diagram.
Laying out diagram…
1/4The order service appends OrderPlaced to the log and moves on — it doesn't wait for anyone.
- Order service
- — Producer
- Event log
- — Durable, ordered, replayable
- Email service
- — Consumer group 1
- Search indexer
- — Consumer group 2
- Analytics
- — Consumer group 3
How it works
- A partitioned, replayable log (Kafka-style) keeps events in order per key.
- Consumers track their own offsets and can replay history to rebuild state.
- Use an outbox table so a DB write and its event are published together.
Trade-offs
- Eventual consistency: consumers lag behind the producer.
- Debugging spans many services; needs good tracing.
- Consumers must be idempotent because events can be delivered more than once.
Seen in
- NetflixGlobal video streaming with microservices
- InstagramPhoto/video sharing with social graph feeds
- Twitter / XShort posts, follow graph and real-time home timelines
- UberReal-time ride matching at global scale
- Payment gatewayStripe-style card payments with an exactly-once ledger
- Search autocompleteSuggestions on every keystroke in under 100 ms
- DropboxFile sync across every device
- Google MapsMap tiles, place search, routing and live traffic
- WebSockets at scaleMillions of live connections with Go on Kubernetes
- Airline reservationsFlights, seats, bookings and check-in for one airline
- NoBrokerBroker-free property rentals and sales
- Meeting schedulerFind a time, book a room, invite everyone
- Car rentalReserve a car by class, pick up, drive, return
- Zomato / food deliveryRestaurant discovery, ordering and live delivery tracking
- Urban CompanyBook vetted professionals for home services
- Porter / goods deliveryBook a truck or bike to move goods across the city
- Driver booking & fleet managementHire a driver for your car, and run fleets of drivers and vehicles
- AstroTalkPay-per-minute chat and calls with astrologers
- QuoraQuestions, answers, votes and a personalised feed
- LinkedInProfiles, connections, feed, messaging and jobs
- Buy now, pay laterInstant credit at checkout, repaid later
- Stock brokerageLive quotes, order placement and portfolios
- Live sports scoresReal-time scores, commentary and alerts for millions