Kafka as an eventstore
Although we have already seen the CQRS implementation, I still feel that you may have a few queries related to eventstore
, and how it works. That's why I'll take the use case of Kafka, which can be used as an eventstore
for your application.
Kafka is, typically, a message broker or message queue (similar to RabbitMQ, JMS, and others).
As per the Kafka documentation, Event Sourcing is a style of application design where the state changes are logged as a time-ordered sequence of records. Kafka's support for very large stored log data makes it an excellent backend for an application built in this style.
Note
For more information related to implementing Kafka, read its documentation at this link: https://kafka.apache.org/documentation/.
Kafka has the following basic components:
- Producers: This sends messages to Kafka
- Consumers: These subscribe to streams of messages in Kafka
Kafka works in the following manner:
- Producers write messages in Kafka topics, which could be users
- Every...