liveBook · Manning

What you will learn in Kafka for Architects

Event-driven architecture, logs, microservices, real-time event processing

by Katya Gorshkova
Foreword by Viktor Gamov

Chapter by chapter

Chapter 1: Getting to know Kafka as an architect

1.1 How an architect sees Kafka · 1.1.1 Event-driven architecture · 1.1.2 Handling myriads of data · 1.2 Field notes: Journey of an event-driven project · 1.3 Key players in the Kafka ecosystem · 1.3.1 Brokers and clients · 1.3.2 Controllers: Managing cluster metadata · 1.4 Applying Kafka’s architectural principles · 1.4.1 The publish-subscribe pattern · 1.4.2 Reliable delivery · 1.4.3 The commit log · 1.5 Designing and managing data flows · 1.5.1 Schema Registry: Handling data contracts · 1.5.2 Kafka Connect: Data replication without code · 1.5.3 Streaming frameworks: Processing data in real time · 1.6 Addressing operations and infrastructure · 1.6.1 Kafka tuning and maintenance · 1.6.2 On-premises and cloud options · 1.6.3 Solutions from other cloud providers · 1.7 Applying Kafka in enterprise · 1.7.1 Using Kafka for sending messages · 1.7.2 Using Kafka for storing data · 1.7.3 How Kafka is different · 1.8 Online resources · 1.9 Summary

What you learn in chapter 1 →

Chapter 2: Kafka cluster data architecture

2.1 Inside the Kafka cluster · 2.2 Core concepts of data processing · 2.2.1 Partitioning the topic · 2.2.2 Processing data concurrently · 2.2.3 Ordering within a topic · 2.2.4 AsyncAPI: Capturing the architecture of topics, partitions, and more · 2.3 Replicating partitions · 2.3.1 Replica leaders and followers · 2.3.2 Choosing replication factor and minimal number of in-sync replicas · 2.3.3 Extending topic configuration with replication information · 2.4 Inside the topic · 2.4.1 Messages: Keys, values and headers · 2.4.2 First draft for documenting messages in AsyncAPI · 2.4.3 Message batches and offsets · 2.4.4 Physical representation of a topic · 2.4.5 Data retention · 2.4.6 Selecting the number of partitions · 2.4.7 Configuring topic metadata · 2.5 Compacted topics · 2.5.1 The idea of compaction · 2.5.2 How compaction works · 2.5.3 When compaction happens · 2.5.4 Making decisions about the compaction policy · 2.6 Online resources · 2.7 Summary

What you learn in chapter 2 →

Chapter 3: Kafka clients and message production

3.1 Communicating with Kafka · 3.1.1 How producers send messages to brokers · 3.1.2 Configuring clients · 3.1.3 Connecting to Kafka · 3.1.4 Serializing and deserializing data · 3.1.5 Setting quotas · 3.1.6 Field notes: Setting up the Customer 360 operational data store · 3.2 Sending a message · 3.2.1 Partitioning strategy · 3.2.2 Field notes: Partitioning strategy for the Customer 360 ODS · 3.2.3 Acknowledgment strategies · 3.2.4 Field notes: Implementing an acknowledgment strategy · 3.2.5 Batches and timeouts · 3.2.6 Common producer challenges · 3.3 Online resources · 3.4 Summary

What you learn in chapter 3 →

Chapter 4: Creating consumer applications

4.1 Organizing consumer applications · 4.2 Receiving a message · 4.2.1 Reading data in parallel · 4.2.2 Setting initial consumer configuration for the Customer 360 project · 4.2.3 Group leader and group coordinator · 4.2.4 Committing the offsets · 4.2.5 Specifying the strategy for committing offsets for an ODS · 4.2.6 Creating batches · 4.2.7 Timeouts and partition rebalance · 4.2.8 Static group membership · 4.2.9 Partition assignment strategies · 4.2.10 The next-gen consumer rebalance protocol · 4.2.11 Subscriptions and assignment · 4.2.12 Reading data from compacted topics · 4.2.13 Consumer considerations for the ODS project · 4.3 Common consumer problems · 4.3.1 Consumer scalability challenges · 4.3.2 Optimizing batch size configuration · 4.3.3 Timeout management strategies · 4.3.4 Error-proof deserialization processes · 4.3.5 Offset initialization strategies for new consumers · 4.3.6 Accurate offset commitment practices · 4.3.7 Coordinating transactions across external systems · 4.4 Data compression · 4.5 Accessing Kafka through the Confluent REST Proxy · 4.6 Online resources · 4.7 Summary

What you learn in chapter 4 →

Chapter 5: Kafka in real-world use cases

5.1 Navigating real-world implementation · 5.1.1 Event-driven microservices · 5.1.2 Data integration · 5.1.3 Collecting logs · 5.1.4 Real-time data processing · 5.2 Differences from other messaging platforms · 5.2.1 Publish-subscribe model · 5.2.2 Partitioned data · 5.2.3 Lack of broker-side logic · 5.2.4 Sequential data access · 5.2.5 Message persistence · 5.2.6 Limitations in handling large messages · 5.2.7 Scalability and high throughput · 5.2.8 Fault tolerance · 5.2.9 Batch processing · 5.2.10 Lack of global ordering · 5.3 Kafka alternatives · 5.3.1 RabbitMQ · 5.3.2 Apache Pulsar · 5.3.3 Solutions from cloud providers · 5.4 Online resources · 5.5 Summary

What you learn in chapter 5 →

Chapter 6: Defining data contracts

6.1 How Kafka handles event structure · 6.2 Designing events · 6.2.1 Challenges in event design · 6.2.2 Fact and delta events: Representing state changes · 6.2.3 Composite, atomic, and aggregate events: Representing event structure · 6.2.4 Pulling state on notification · 6.2.5 Evolution of types · 6.2.6 Mapping events to Kafka messages · 6.2.7 Data strategies for the Customer 360 ODS · 6.3 Event governance · 6.3.1 Data formats · 6.3.2 Selecting a data format for the Customer 360 ODS · 6.3.3 Data ownership · 6.3.4 Organizing data and communicating changes · 6.3.5 Designing events for the Customer 360 ODS · 6.4 Schema Registry · 6.4.1 Schema Registry in Kafka ecosystem · 6.4.2 Registering schemas · 6.4.3 A concept of subject · 6.4.4 Compatibility rules · 6.4.5 Alternatives to Schema Registry · 6.4.6 Handling data contracts without the centralized server · 6.4.7 Commercial extensions for data contracts · 6.5 Common problems in handling data contracts · 6.5.1 Absence of server-side validation · 6.5.2 Handling incompatible changes for non-compacted topics · 6.5.3 Migrating state · 6.5.4 Automatic registration of schemas · 6.6 Online resources · 6.7 Summary

What you learn in chapter 6 →

Chapter 7: Kafka interaction patterns

7.1 Using Kafka in microservices · 7.1.1 Smart endpoints and dumb pipes · 7.1.2 Request-response pattern · 7.1.3 CQRS pattern · 7.1.4 Event sourcing with snapshotting · 7.1.5 Having “hot” and “cold” data · 7.2 Decentralizing analytical data with a data mesh · 7.2.1 Domain ownership · 7.2.2 Data as a product · 7.2.3 Federated governance · 7.2.4 Self-serve platform · 7.3 Using Kafka Connect · 7.3.1 Kafka Connect at a glance · 7.3.2 Internal Kafka Connect architecture · 7.3.3 Converters · 7.3.4 Single message transformations · 7.3.5 Source connectors · 7.3.6 Sink connectors · 7.3.7 Changes in the incoming data structure · 7.3.8 Integrating Kafka and databases · 7.3.9 Creating a connector for the Customer 360 ODS · 7.3.10 Common Kafka Connect problems · 7.4 Ensuring delivery guarantees · 7.4.1 Producer idempotence · 7.4.2 Understanding Kafka transactions · 7.4.3 Transactional outbox pattern · 7.5 Online resources · 7.6 Summary

What you learn in chapter 7 →

Chapter 8: Designing streaming applications

8.1 Introducing Kafka Streams · 8.1.1 ETL, ELT, and stream processing · 8.1.2 The Kafka Streams framework · 8.1.3 Benefits of using Kafka Streams · 8.2 Sketching out the ODS with Kafka Streams · 8.3 Processing data · 8.3.1 Stateless operations · 8.3.2 Stateful operations · 8.3.3 The Processor API · 8.3.4 Kafka Streams internal architecture · 8.3.5 Windowing operations · 8.3.6 Joining streams · 8.3.7 Implementing CustomerJoinService in the example ODS · 8.3.8 Interactive queries · 8.4 Alternative solutions · 8.4.1 Confluent ksqlDB · 8.4.2 Apache Flink · 8.4.3 Solutions from cloud providers · 8.5 Common streaming application challenges · 8.5.1 Memory and disk capacity planning · 8.5.2 Incorrect topic partitioning · 8.5.3 Out-of-order data · 8.5.4 Late-arriving data · 8.5.5 State store initialization · 8.5.6 Monitoring and debugging challenges · 8.6 Online resources · 8.7 Summary

What you learn in chapter 8 →

Chapter 9: Managing Kafka within the enterprise

9.1 Managing metadata · 9.1.1 Introducing KRaft controllers · 9.1.2 Example of cluster configuration · 9.1.3 Failover scenarios · 9.1.4 Using ZooKeeper · 9.2 Choosing a deployment solution · 9.2.1 Choosing between on-premises and cloud Kafka deployment · 9.2.2 Hybrid approach · 9.2.3 Choosing the right deployment for the Customer 360 ODS · 9.3 Creating a security solution · 9.3.1 Kafka security overview · 9.3.2 Encrypting using TLS · 9.3.3 Authentication · 9.3.4 Authorization · 9.3.5 Protecting data at rest · 9.3.6 Enabling security in the Customer 360 ODS · 9.4 Online resources · 9.5 Summary

What you learn in chapter 9 →

Chapter 10: Organizing a Kafka project

10.1 Defining Kafka project requirements · 10.1.1 Identifying event-driven workflows · 10.1.2 Turning business workflows into events · 10.1.3 Gathering functional requirements for Kafka topics · 10.1.4 Identifying nonfunctional requirements · 10.2 Maintaining cluster structure · 10.2.1 Using CLI and UI tools · 10.2.2 Using GitOps for Kafka configurations · 10.2.3 Using the Kafka Admin API · 10.2.4 Setting up environments · 10.2.5 Choosing a solution for the Customer 360 ODS · 10.3 Testing Kafka applications · 10.3.1 Unit testing · 10.3.2 Integration testing · 10.3.3 Performance tests · 10.4 Online resources · 10.5 Summary

What you learn in chapter 10 →

Chapter 11: Operating Kafka

11.1 Cluster evolution and upgrades · 11.1.1 Adding brokers and distributing the load · 11.1.2 Removing a broker from the cluster · 11.1.3 Upgrading clients · 11.1.4 Data mobility · 11.2 Monitoring a Kafka cluster · 11.2.1 Types of metrics in monitoring · 11.2.2 Kafka monitoring objects · 11.2.3 Ownership of monitoring responsibilities · 11.2.4 Monitoring stacks and tools · 11.3 Performance tuning clinic · 11.3.1 Balancing throughput and latency · 11.3.2 Balancing data safety and uptime · 11.4 Disaster recovery and failover · 11.4.1 RTO/RPO engineering · 11.5 Online resources · 11.6 Summary

What you learn in chapter 11 →

Chapter 12: What’s next for Kafka

12.1 Kafka as an orchestration platform · 12.2 Integration with new runtimes · 12.2.1 Kafka with WebAssembly · 12.2.2 Serverless Kafka · 12.2.3 Kafka at the edge · 12.3 Diskless Kafka: Decoupling storage from brokers · 12.4 Kafka in AI/ML world · 12.4.1 Incremental learning · 12.4.2 Feature engineering in motion · 12.4.3 Kafka and AI agents · 12.5 Summary

What you learn in chapter 12 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.