Event Stream for dummies
Another sharing today but really cool topic for backend guys out there 😉
I'll share with you the Event Stream and what are the benefits of it. And it could be your next awesome tool besides the normal Queue.
What is an Event Stream?
An event stream is like a river of information that flows continuously and captures all the things that happen over time.
It's like a never-ending sequence of messages that describe different events, such as user actions or changes to data.
An event stream is often used in software systems to help them react and respond to these events in real-time.
Think of an event stream as a way for software systems to keep a constant eye on what's happening and respond accordingly.
A sample diagram here - how services would pub/sub to the Event Stream:
The same processing as normal queues or pub/sub. Your service will need to subscribe to the stream and then process the incoming events (latest ones) 😉
The message availability
Events won't be deleted from Event Stream, your Events are still there for days (based on your need - set the configuration 🏃♂️).
An event stream is designed to maintain a record of all events that occur over time. Each event is added to the stream as it occurs and is not removed from the stream unless explicitly deleted. This allows the event stream to maintain a historical record of all events that have occurred, which can be useful for auditing, debugging, or other purposes.
- Unlike normal Queues, msgs will be deleted after the processing.
Services can retain the old events (if needed) 🔋.
- Unlike normal Pub/Sub, if your service wasn't able to receive the msg, the msg won't be delivered and result in data loss.
You are actually can search and see the msgs and their payload.
- I think this is quite normal, but hell-nah for SQS
The coding approach
Event Stream can be used as a middleman for communication between services.
- Good ol' Publisher/Producer - Subscriber 😘
(Optional) Fully Event-driven Architecture for your applications - your microservices ♻️
What platform can I use?
Kafka (most popular)
The event stream is really awesome, isn't it? Especially for those applications that use a fully Event-driven Architecture approach.
The benefits are great, aren't they? It is a great addition to mission-critical applications.
And indeed, I'm using the Event Stream at the moment and totally love it.