Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Gwen Shapira

Rating 3.5 AI initial rating

Every enterprise application creates data, whether it consists of log messages, metrics, user activity, or outgoing messages. Moving all this data is just as important as the data itself. With this updated edition, application architects, developers, and production engineers new to the Kafka streaming platform will learn how to handle data in motion. Additional chapters cover Kafka's AdminClient API, transactions, new security features, and tooling changes. Engineers from Confluent and LinkedIn responsible for developing Kafka explain how to deploy production Kafka clusters, write reliable event-driven microservices, and build scalable stream processing applications with this platform. Through detailed examples, you'll learn Kafka's design principles, reliability guarantees, key APIs, and architecture details, including the replication protocol, the controller, and the storage layer. You'll examine: Best practices for deploying and configuring...

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practitioner's field guide to running Apache Kafka in production, taking you from first topic creation through producer/consumer APIs, cluster internals, and reliability tuning. Best for application architects, developers, and production engineers who need to operate Kafka, not just read about it. 【Book Arc】 - **Opening (~0%–10%)**: Frames Kafka as a platform for "data in motion" and sets up the three dominant use cases—message buses for event-driven microservices, stream processing, and large-scale data pipelines—then gets hands-on with installing Kafka and creating/describing/producing/consuming a first test topic via CLI. - **Early (~10%–32%)**: Moves into broker configuration and durability fundamentals (replication, `min.insync.replicas`, message size limits, disk/filesystem choices), then walks through the producer API (batching, serializers, retries, timeouts) and the consumer API (consumer groups, subscription, offset commits, rebalance handling). - **Middle (~32%–48%)**: Shifts to programmatic administration with the AdminClient API—creating topics on demand, configuration management, partition reassignment, and testing with MockAdminClient—before turning to internals: leader/follower replicas, the replication protocol, and log storage including compaction and retention policies. - **Late (beyond ~48%)**: The excerpts do not cover this range in detail; the blurb indicates later material on transactions, security features, and tooling changes, but the sampled text stops before these chapters. 【Key Takeaways】 - **Durability is a deliberate trade-off, not a default** (Early): Pairing `min.insync.replicas=2` with producer `acks=all` prevents silent message loss when a leader fails after acknowledging a write—but costs throughput, so high-volume, loss-tolerant clusters may keep the default of 1. - **Batching buys throughput at the cost of latency** (Opening): Grouping messages into batches (typically compressed) raises messages-per-second but delays individual message propagation; this latency/throughput tension recurs throughout tuning decisions. - **Schemas make messages understandable** (Opening): Kafka treats messages as opaque bytes, so imposing structure (JSON/XML for simplicity, Avro for compact serialization and version compatibility via Schema Registry) is a recommended practice rather than a platform requirement. - **Producer reliability lives in timeout and retry configuration** (Early): Rather than tuning `retries` directly, the authors advise measuring broker crash-recovery time and setting `delivery.timeout.ms` to exceed it—and letting the producer handle retries instead of duplicating logic in application code. - **Consumer groups and offset commits define correctness** (Early): `group.id` drives group membership; committing offsets (sync/async) and committing during rebalances via `ConsumerRebalanceListener` are what prevent reprocessing or data loss. - **AdminClient brings cluster operations into your application** (Middle): On-demand topic creation (common in IoT), config management via `ConfigResource`, and partition reassignment are all programmable, with `MockAdminClient` enabling tests without a live cluster. - **Replication factor trades availability for hardware** (Middle): A factor of N tolerates N−1 broker losses but requires N brokers and N copies of data; leader replicas serve all produce requests while followers replicate and stand ready for promotion. - **Compaction and retention shape long-term storage** (Middle): Logs split into clean (compacted) and dirty (newly written) portions; combining compaction with a retention period caps topic growth while still honoring time-based deletion requirements. 【Reading Tips】 - Deep-read the producer and consumer chapters if you write applications; skim the broker/disk configuration chapter unless you own cluster operations. - Treat the durability settings (`min.insync.replicas`, `acks`, replication factor) as the book's core decision framework—take notes on the trade-offs, since they reappear across chapters. - The internals chapters (replication, controller, storage) reward careful reading even for application developers; they explain why the API-level knobs behave as they do. - Watch for version-sensitive guidance (e.g., the deprecation of `--zookeeper` in favor of `--bootstrap-server`); verify against your Kafka version before applying. - Skim code listings for structure and intent rather than typing them verbatim; the surrounding prose carries the transferable lessons. 【Coverage Limits】 This guide is based on stratified excerpts covering roughly the first half of the book (through storage/compaction); later chapters on transactions, security, and tooling are referenced only via the blurb and are not summarized here.
Page 14
eam-processing applications, and large-scale data pipelines. We also focused on making the book general and comprehensive enough so it will be useful to anyo...
View in text
Excerpt 2
m) or Extents File System (XFS). XFS has become the default filesystem for many Linux distributions, and this is for good reason: it outperforms Ext4 for mos...
View in text
Excerpt 3
ting current offsets:" + currentOffsets); consumer.commitSync(currentOffsets); } } try { consumer.subscribe(topics, new HandleRebalance()); while (true) { Co...
View in text
Excerpt 4
et clients know who the current controller is by adding the information to the Metadata response. As a result, a new version was added to the Metadata reques...
View in text
Excerpt 5
saction coordinator shuts down or crashes after logging the intention to commit and before completing the process, a new transaction coordinator will be elec...
View in text
Excerpt 6
rack definitions. Brokers match their rack with that of the consumer to find the local replica that is most up-to-date, falling back to the leader if a suita...
View in text
Excerpt 7
ry attempted operation for which access was denied, and log entries at the DEBUG level for every operation for which access was granted. For example: DEBUG P...
View in text
Excerpt 8
hey should be very specific. It’s OK to have a large number of metrics, each describing small details, because this is why computers exist: to process a lot...
View in text
Tags
AI categories
DataBackendSoftware
Publisher: O'Reilly Media
Publish Year: 2021
Language: English
File Format: PDF
File Size: 6.9 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…