Events with Kafka

In this lesson, we'll discuss events with Kafka.

Introduction #

Systems that communicate via Kafka can easily exchange events (see also Events).

  • Records can be saved permanently, and a consumer can read out the history and rebuild its state. The consumer does not have to store the data locally but can rely on Kafka.
  • However, this means that all relevant information must be stored in the record. Events discussed the benefits and disadvantages of this approach.
  • If an event becomes irrelevant due to a new event, the data can be deleted by Kafka’s log compaction.

  • Via consumer groups, Kafka can ensure that a single consumer handles each record. This simplifies matters, for example, when an invoice is to be written. In this case, only one consumer should write an invoice. It would be an error if several consumers were to create several invoices at the same time.

Get hands-on with 1200+ tech skills courses.