Skip to content
Kafka Is FunProgress

AdvancedArchitecture

What is CQRS with Kafka and how is it different from event sourcing?

Reference answer

CQRS (Command Query Responsibility Segregation) separates write operations (commands) from read operations (queries) using different models. With Kafka: commands produce events to Kafka, Kafka Streams or consumers materialize the events into read-optimized stores (Elasticsearch, Redis, JDBC). Event sourcing is about the storage model (events as source of truth). CQRS is about the architectural pattern (separate read/write paths). They are complementary but independent: you can have CQRS without event sourcing (commands → DB → Kafka sync → read store), or event sourcing without CQRS.

Expected key concepts: CQRS, commands, queries, separate models, materialize, Elasticsearch, Redis, read-optimized, event sourcing, complementary, independent