Why to learn and use Kafka?
The Story
Suppose Raman wants to build an app named Movile which mainly focuses on streaming movie and series with server in Bangalore.
Initial architecture is straight forward, consisting of one type of target (website) and getting data from one source (server). Deployment was also smooth.
Now Raman wants to deploy mobile app as a new target and not to forget Smart TV. He also wants to get input from user activity about movies to implement recommendation system and multiple other features.
The Problem
As we all know, integrating these features comes with multiple issues and difficulty like different types of data transfer protocols and multiple variety of structured and unstructured data like JSON, CSV, JPEG, MP4, MKV etc.
Not to forget that data source or target structure can also change, which will require changeover of complete architecture.
With all this in mind, Raman approached his friend Aman, Aman introduced him to Kafka
Why Kafka
Kafka allows to decouple data streams and systems, so now source systems will have their data end up in Kafka
These are the list of some of the Kafka features:
- Scalability: Kafka scales easily without downtime.
- Volume: Kafka work easily with the huge volume of data streams.
- Transformations: Kafka offers option to derive new data streams using the data streams from producers.
- Reliability: Kafka is distributed, partitioned, replicated and fault tolerant.
- Durability: Kafka uses Distributed commit log, that means messages persists on disk as fast as possible.
- Performance: Kafka has high throughput. Even if many TB of messages is stored, it maintains stable performance.
- Extensibility: There are as many ways by which applications can plug in.
- Replication: By using ingest pipelines, it can replicate the events.
After implementing Kafka, Raman does not have to worry about multiple integration issues while successfully scaling his App up.
Conclusion
While designing a microservices based architecture, any system designer or architect requires to add or integrate multiple different feature and scale them separately.
For this use case, Kafka have solved integration while keeping performance of the system intact like adding a new entry in the pre existing freeway.
Therefore, Kafka is worth giving a shot if you want to scale up and out your system.