Kafka vs RabbitMQ: What's the Difference?
Apache Kafka is an event streaming platform built for high-throughput data pipelines, whereas RabbitMQ is a traditional message broker optimized for complex routing.

ON THIS PAGE
0% read
- Executive Summary: Event Streaming vs. Message Brokering
- Core Architectural Paradigms
- Kafka vs. RabbitMQ: Head-to-Head Technical Comparison
- Operational Considerations and Enterprise Risks
- Decision Matrix: Selecting the Right Tool for Your Architecture
- Enterprise Architecture: Using Kafka and RabbitMQ Together
Apache Kafka is an event streaming platform built for high-throughput data pipelines, whereas RabbitMQ is a traditional message broker optimized for complex routing. Understanding Kafka vs RabbitMQ: What's the Difference? requires evaluating fundamental architectural paradigms, data flow models, message persistence mechanisms, and operational overhead to determine the ideal asynchronous communication backbone for your enterprise systems.
Executive Summary: Event Streaming vs. Message Brokering
Modern distributed software architectures rely heavily on asynchronous communication to decouple services, balance variable traffic spikes, and guarantee processing resilience. While engineering teams frequently evaluate Apache Kafka and RabbitMQ for the same microservice communication layer, these two technologies originate from entirely different design philosophies and solve distinct distributed computing challenges. RabbitMQ was designed from the ground up as a general-purpose message broker implementing standardized messaging protocols, whereas Apache Kafka was conceived as a distributed, partitioned, append-only commit log designed for high-volume stream ingestion and replayable data pipelines.
A traditional message broker like RabbitMQ treats messages as transient payloads. Producers publish messages to exchanges, which inspect metadata, headers, or routing keys to route the payload into one or more queues. Consumers connect to these queues, receive the messages, acknowledge successful processing, and the broker immediately deletes the data from storage. The broker's primary responsibility is ensuring reliable delivery, maintaining queue order, and dynamically adapting to complex routing topologies. RabbitMQ maintains strict state tracking for every individual message, actively monitoring whether it is unacknowledged, in flight, or ready for consumption.
In contrast, Apache Kafka is an event streaming platform where messages—referred to as events or records—are written to immutable, ordered, append-only disk logs divided into partitions across a distributed cluster. Kafka does not track message state per consumer, nor does it delete messages upon delivery. Instead, records are retained for a configurable time window or storage size limit, allowing multiple decoupled consumer groups to read from the log independently at their own pace by tracking their individual positional offsets. This fundamental distinction shifts state management from the central broker to the consumer client, enabling unprecedented horizontal scaling and multi-terabyte throughput.
Choosing between Kafka and RabbitMQ is therefore not a matter of identifying an absolute technological winner, but rather aligning system architecture with workload requirements. If an enterprise workload demands granular per-message acknowledgment, priority queuing, dead-letter routing, and complex request-reply patterns, RabbitMQ provides a mature, protocol-rich solution. Conversely, if the requirement centers on event sourcing, large-scale telemetry ingestion, real-time stream processing, or decoupling data consumers that require independent historical replays, Kafka provides the requisite durability and horizontal scaling capabilities.
Core Architectural Paradigms
To understand the operational trade-offs of both systems, software architects must examine their internal components, storage engines, and communication protocols. Both platforms handle asynchronous messages, but their underlying mechanisms dictate how they scale, fail, and maintain consistency across distributed nodes.
Apache Kafka: The Distributed Commit Log
Apache Kafka's architecture is modeled entirely around the concept of a distributed, partitioned commit log. A Kafka cluster consists of multiple broker nodes that manage topics. A topic represents a logical category or feed name to which records are published. To achieve horizontal scalability and fault tolerance, Kafka divides each topic into one or more physical partitions distributed across different brokers in the cluster.
Each partition is an ordered, immutable sequence of records continuously appended to an underlying segment file on disk. When a producer publishes a record, Kafka assigns it a sequential, monotonically increasing integer known as an offset. Offsets are immutable identifiers that pinpoint the exact location of a record within a specific partition. Kafka guarantees absolute record ordering only within a single partition, not across an entire multi-partition topic. Producers determine partition assignment using a hashing algorithm applied to the record's key (e.g., hash(record_key) % partition_count), ensuring that all records sharing the same key land on the exact same partition in strict chronological sequence.
Kafka Topic: "order-events" (3 Partitions)
┌────────────────────────────────────────────────────────┐
│ Partition 0: [Offset 0] -> [Offset 1] -> [Offset 2]... │ (Broker A)
├────────────────────────────────────────────────────────┤
│ Partition 1: [Offset 0] -> [Offset 1] -> [Offset 2]... │ (Broker B)
├────────────────────────────────────────────────────────┤
│ Partition 2: [Offset 0] -> [Offset 1] -> [Offset 2]... │ (Broker C)
└────────────────────────────────────────────────────────┘Kafka employs a "dumb broker, smart consumer" paradigm. The Kafka broker does not maintain individual delivery receipts or track which consumers have processed which records. Instead, consumer applications belong to consumer groups, and each consumer within a group is assigned a mutually exclusive subset of topic partitions. The consumer maintains its current read position by committing its processed offset back to an internal Kafka system topic named __consumer_offsets. This architecture allows consumers to read sequentially, pause, commit offsets asynchronously, or seek backward to replay historical data from arbitrary offsets without impacting broker performance or other consumer groups.
Modern Apache Kafka clusters manage cluster metadata, leader elections, and partition assignments using KRaft (Kafka Raft Metadata Mode), an internal event-driven consensus protocol based on the Raft algorithm. KRaft completely eliminates the legacy external dependency on Apache ZooKeeper, consolidating metadata management directly within Kafka controller nodes and dramatically improving partition scalability and cluster recovery times.
RabbitMQ: The Traditional Exchange-Queue Broker
RabbitMQ is built on the Erlang OTP (Open Telecom Platform) framework, designed specifically for high-concurrency, fault-tolerant telecommunication systems. At its architectural foundation, RabbitMQ implements the AMQP (Advanced Message Queuing Protocol) standard (primarily AMQP 0-9-1, with native support for AMQP 1.0, MQTT, and STOMP). Unlike Kafka's static log partitions, RabbitMQ decouples message production from storage using an internal routing pipeline composed of Exchanges, Bindings, and Queues.
In RabbitMQ, producers never publish directly into a queue. Instead, producers publish messages to an Exchange along with routing attributes (such as a routing key or header parameters). The Exchange evaluates these attributes against configured Bindings—rules that link exchanges to queues—and duplicates or routes the message into the appropriate destination queues. RabbitMQ provides four primary exchange types to support virtually any delivery topology:
Direct Exchange: Routes messages to queues based on an exact match between the message routing key and the queue binding key.
Fanout Exchange: Broadcasts every incoming message to all bound queues unconditionally, completely ignoring routing keys (classic publish-subscribe).
Topic Exchange: Performs wildcard matching between routing keys and binding patterns (e.g., matching @@CODE0@@ against @@CODE1@@ or
orders.eu.#).Headers Exchange: Uses message header key-value attributes instead of routing keys to evaluate complex routing criteria.
Producer ──> [ Topic Exchange ] ──( orders.eu.* )──> [ EU Orders Queue ] ──> Consumer A
│
└────────────( orders.# )─────> [ Audit Log Queue ] ──> Consumer BRabbitMQ operates on a "smart broker, dumb consumer" model. The broker actively manages queue states, enforces queue depth limits, monitors consumer capacity, distributes messages across active consumer channels, and tracks granular per-message acknowledgment receipts (@@CODE0@@, @@CODE1@@, and basic.reject). Once all subscribed consumers acknowledge receipt of a message, RabbitMQ's garbage collection mechanisms remove the message from memory and disk. For mission-critical workloads, modern RabbitMQ deployments utilize Quorum Queues—a distributed, replicated FIFO queue type based on the Raft consensus algorithm that replaces legacy mirrored queues to guarantee data safety against network partitions.
Kafka vs. RabbitMQ: Head-to-Head Technical Comparison
Comparing Kafka and RabbitMQ requires evaluating specific engineering dimensions: data flow mechanisms, routing flexibility, persistence policies, and raw throughput profiles.
Data Flow: Pull-Based (Kafka) vs. Push-Based (RabbitMQ)
The mechanism by which consumers receive data fundamentally dictates system behavior under high load and governs how backpressure is managed across distributed services.
Kafka employs a strictly pull-based data flow model. Consumer clients issue continuous long-polling fetch requests (poll()) to the broker partitions they own. In this model, consumers have complete control over the rate of data ingestion. If a downstream consumer experiences processing bottlenecks, database slowdowns, or garbage collection pauses, it simply slows down its polling cadence. The unread records remain safely buffered in the partition logs on the Kafka brokers without consuming consumer memory. Furthermore, Kafka consumers can batch records aggressively, requesting up to several megabytes of data in a single network round-trip, which maximizes network efficiency and CPU cache utilization.
RabbitMQ operates primarily on a push-based model. Once a consumer establishes a subscription channel to a queue, the RabbitMQ broker actively pushes messages to the consumer as soon as they become available. This push mechanism achieves ultra-low end-to-end latency because messages do not wait for consumer polling intervals. However, an unconstrained push model introduces severe risks: a sudden surge in upstream production can flood downstream consumers, overwhelming memory allocations and causing service crashes. To prevent this, RabbitMQ requires precise configuration of consumer prefetch limits (basic.qos). The prefetch value instructs the broker to stop pushing messages to a consumer channel once a specific number of unacknowledged messages are outstanding.
Routing Capabilities and Topology Flexibility
Routing complexity is the architectural domain where RabbitMQ demonstrates unmatched versatility. Because RabbitMQ separates exchanges from queues, developers can construct sophisticated routing graphs within broker configuration without modifying application code. Using topic exchanges with dot-separated keys and wildcard operators (@@CODE0@@ for exactly one word, @@CODE1@@ for zero or more words), RabbitMQ can route an incoming payload to specific regional microservices, audit queues, compliance collectors, and dead-letter analysis engines simultaneously. Additionally, RabbitMQ supports Dead Letter Exchanges (DLX), automatically redirecting rejected messages, expired payloads (via Time-To-Live / TTL parameters), or messages exceeding queue length limits to designated dead-letter queues for debugging and automated retry pipelines.
Kafka's native broker routing is intentionally primitive. Brokers perform zero payload inspection and support no dynamic message-header routing rules. When a producer sends a record to Kafka, it must specify the target topic directly. While producers can control which partition within a topic receives the message via custom partitioning logic, the broker cannot duplicate or conditionally route that message to other topics on the fly. To implement complex routing, content-based filtering, or dynamic data branching in Kafka, engineering teams must deploy dedicated stream processing layers such as Kafka Streams, Apache Flink, or Kafka Connect transformation pipelines that consume from an input topic, transform the records, and write to downstream topics.
Message Retention and Replayability
Message lifecycle management represents one of the most critical operational divides between the two platforms:
RabbitMQ Lifecycle:
[Produce] ──> [Exchange] ──> [Queue] ──> [Consumer Consumes & ACKs] ──> [Broker Deletes Message]
Kafka Lifecycle:
[Produce] ──> [Append to Log Partition] ──> [Consumer Reads Offset X] (Log retains data for 7+ days)
└──> [Consumer Replays Offset X-100]RabbitMQ is designed as an ephemeral message transit system. Once a consumer processes a message and sends a positive acknowledgment (ack), RabbitMQ removes the record from storage. RabbitMQ does offer persistent queues where messages are written to disk to survive broker restarts, but disk persistence in RabbitMQ is a safety mechanism for unconsumed messages, not a historical archive. Accumulating millions of unprocessed messages in traditional RabbitMQ queues degrades broker performance significantly because queue index management and memory paging consume substantial Erlang VM resources (although modern Quorum Queues and RabbitMQ Streams mitigate this limitation).
Kafka treats data durability as a first-class citizen. Records written to Kafka partitions are committed to an append-only sequential disk log and retained regardless of whether they have been consumed by zero, one, or fifty consumer groups. Retention policies are configured at the topic level based on time (e.g., retain for 7 days, 30 days, or indefinitely) or storage size (e.g., retain up to 500 GB per partition). Additionally, Kafka supports Topic Compaction, a policy where the broker retains only the latest record value for each distinct key, effectively turning a topic into a distributed key-value change-log. Because data persists independently of consumer state, Kafka enables historical message replay: if a downstream analytics microservice experiences a bug, developers can fix the code and reset the consumer group's offset back to zero, re-processing months of historical events seamlessly.
Performance, Throughput, and Latency
When evaluating performance, organizations must distinguish between throughput (messages processed per second) and latency (time elapsed between message production and delivery):
Kafka is engineered for extreme throughput. By leveraging sequential disk I/O, OS-level page cache, zero-copy data transfer (sendfile system calls that bypass user-space memory buffers), and aggressive batching across producers and consumers, a standard multi-node Kafka cluster can process millions of messages per second with sustained throughput exceeding hundreds of megabytes per second. Kafka achieves these metrics by trading away sub-millisecond latencies; end-to-end latency in standard Kafka configurations typically hovers between 2ms and 15ms.
RabbitMQ is optimized for real-time responsiveness and predictable low latency under moderate workloads. Because RabbitMQ pushes messages immediately to waiting consumers without waiting for batch accumulation, single-message delivery latency is consistently sub-millisecond (often 200–500 microseconds under optimal conditions). However, because the RabbitMQ broker manages intricate in-memory routing states, message acknowledgments, and complex queue indices, its maximum throughput ceiling is substantially lower than Kafka's—typically tens of thousands to low hundreds of thousands of messages per second per node.
Systematic evaluation of primary engineering criteria across both platforms. Avantaj Kafka writes to immutable append-only distributed disk partitions, enabling long-term retention. Dezavantaj RabbitMQ stores messages ephemerally in queues, deleting them immediately following successful client consumption. Avantaj RabbitMQ features versatile dynamic routing exchanges (Direct, Fanout, Topic, Headers) with DLX support. Dezavantaj Kafka relies on static topic partitions; advanced routing requires an external stream processor like Flink or Kafka Streams. Avantaj Kafka easily scales horizontally to millions of events per second via partition sharding and zero-copy I/O. Dezavantaj RabbitMQ vertical and horizontal scaling is constrained by broker-side state management overhead under massive loads.Kafka vs RabbitMQ Core Architecture Comparison
Data Storage Model
Routing Capabilities
Scalability and Throughput
Operational Considerations and Enterprise Risks
Deploying and operating distributed messaging infrastructure in mission-critical environments introduces distinct operational challenges. Infrastructure teams must evaluate cluster maintenance, failure modes, data consistency, and long-term total cost of ownership.
Infrastructure Complexity and Maintenance Overhead
Operating Apache Kafka at enterprise scale requires specialized infrastructure knowledge. Although the modern transition to KRaft has eliminated ZooKeeper administration, managing Kafka still entails fine-tuning disk I/O schedulers, OS-level page cache allocation, JVM garbage collection (G1GC or ZGC), and network buffer limits. Partition sizing is a critical capacity planning requirement: creating too few partitions bottlenecks producer parallelization and consumer group concurrency, while creating too many partitions increases controller memory overhead and lengthens leader failover times. Furthermore, rebalancing partitions across newly added brokers historically required complex tooling like Cruise Control to prevent uneven disk and network saturation.
RabbitMQ provides a remarkably straightforward initial setup experience. It ships with a built-in, highly intuitive Management Web UI that exposes real-time metrics on message rates, queue depths, consumer channel utilization, and connection churn. However, operating RabbitMQ at high scale introduces operational complexities unique to the Erlang runtime. Memory management is critical; if unconsumed messages accumulate and push broker RAM usage past the configured high watermark (vm_memory_high_watermark), RabbitMQ pauses all incoming publisher connections to protect the node from out-of-memory (OOM) crashes. Troubleshooting Erlang crash dumps, managing Erlang cookie distribution across clustered nodes, and handling cluster network netsplits require specialized domain familiarity.
Fault Tolerance, Replication, and High Availability
Both platforms provide enterprise-grade high availability, but their replication models reflect their core storage architectures.
Kafka manages fault tolerance via partition replication across cluster brokers:
Each partition has one designated Leader broker and zero or more Follower replicas.
Producers publish writes exclusively to the partition Leader, which appends the records to its local segment log.
Followers continuously fetch records from the Leader to keep their local logs synchronized.
Followers that remain caught up within a configured time threshold (
replica.lag.time.max.ms) belong to the In-Sync Replicas (ISR) pool.By configuring producer acknowledgments to @@CODE0@@ (or @@CODE1@@) combined with a topic policy of
min.insync.replicas=2, Kafka guarantees zero data loss even if the current partition leader crashes unexpectedly.
Kafka Replication Flow (Topic A - Partition 0):
Producer ──( acks=all )──> [ Broker 1 (Leader) ] ──( Replicate )──> [ Broker 2 (Follower/ISR) ]
│
└────────────( Replicate )──────> [ Broker 3 (Follower/ISR) ]RabbitMQ achieves high availability and data durability through Quorum Queues. Built on the Raft consensus algorithm, Quorum Queues replicate messages across a majority of nodes in the cluster (e.g., 3 or 5 nodes). A write is only confirmed back to the publishing application once a quorum majority (e.g., 2 out of 3 nodes) has safely written the payload to disk on write-ahead logs (WAL). Quorum Queues are resilient against network partitions and eliminate the data loss vulnerabilities historically associated with legacy mirrored queues (ha-mode). However, Quorum Queues consume higher disk I/O and memory resources than classic queues, making them best suited for critical transactional payloads rather than high-velocity ephemeral telemetry.
Balanced operational assessment of both distributed systems in enterprise environments. Pros 2 advantages Kafka Infinite Log Scalability Scales linearly to petabytes of data with decoupled consumer pacing and zero broker-side per-message state tracking. RabbitMQ Out-of-the-Box Usability Rich built-in web management console, granular routing algorithms, and minimal initial configuration overhead. Cons 2 concerns Kafka Operational Rigidity Static partition topologies cannot be easily scaled down, and consumer group rebalancing can cause transient processing stalls. RabbitMQ Resource Sensitivity Erlang VM memory pressure under unconsumed queue spikes requires aggressive memory ceiling enforcement and publisher throttling.Production Trade-Offs: Kafka vs RabbitMQ
Decision Matrix: Selecting the Right Tool for Your Architecture
Technical decision-makers should evaluate prospective messaging platforms through the lens of concrete functional requirements rather than general popularity.
When to Choose Apache Kafka
Apache Kafka is the definitive industry choice when system requirements involve continuous, high-volume event streams, historical data replay, or real-time distributed stream processing:
Real-Time Telemetry and IoT Ingestion: Applications collecting continuous metric data, connected vehicle telemetry, clickstream logs, or application traces from thousands of endpoints where volume exceeds hundreds of thousands of events per second.
Event-Driven Architecture and Event Sourcing: Systems designed around Event Sourcing and CQRS (Command Query Responsibility Segregation) patterns where the event log serves as the single source of truth for downstream read-model projections.
Multi-Consumer Historical Analytics: Environments where disparate engineering teams (e.g., fraud detection, business intelligence, machine learning pipelines, and audit reporting) must independently consume the same source dataset at different velocities without interfering with one another.
Data Lake / Data Warehouse Ingestion Pipelines: Extract, Transform, Load (ETL) and Change Data Capture (CDC) architectures leveraging tools like Debezium and Kafka Connect to continuously stream database transaction logs into storage platforms like Snowflake, BigQuery, or Apache Iceberg.
When to Choose RabbitMQ
RabbitMQ is the optimal solution when applications demand complex routing, transactional message delivery, granular task distribution, and immediate low-latency processing:
Microservices Work Distribution and Background Tasks: Systems using distributed background workers (e.g., Celery, Sidekiq, or custom worker pools) where tasks must be distributed across worker nodes with round-robin load balancing, priority queues, and dead-letter retries.
Complex Routing Topologies: Applications where incoming messages must be dynamically filtered, fanned out, or routed based on extensive routing keys, geographic headers, or content metadata (e.g., financial notification routing or B2B integration gateways).
Legacy Enterprise System Integration: Workloads requiring interoperability across standard messaging protocols (AMQP 0-9-1, AMQP 1.0, MQTT, STOMP) to communicate between legacy mainframes, modern cloud services, and mobile edge clients.
Synchronous-Like Asynchronous RPC: Architectures implementing the Request-Reply / RPC pattern across microservices using temporary reply queues and message correlation IDs.
Decision Flowchart:
Is your data an immutable stream requiring replayability and massive ingestion (>100k msg/s)?
├── YES ──> Choose Apache Kafka
└── NO
└── Do you require complex routing (topic wildcards, headers, priority) and granular message acks?
├── YES ──> Choose RabbitMQ
└── NO ──> Evaluate simpler cloud-native queues (AWS SQS, Google Cloud Pub/Sub)Enterprise Architecture: Using Kafka and RabbitMQ Together
In large-scale enterprise environments, the choice between Kafka and RabbitMQ is rarely an "either-or" decision. Mature engineering organizations frequently deploy both technologies in tandem, utilizing each platform within the architectural domain where it excels.
A standard hybrid architectural pattern positions RabbitMQ at the edge / operational microservice layer and Apache Kafka as the central enterprise event backbone:
[ Client Applications ]
│
▼
[ API Gateway / Edge Services ]
│
▼
[ RabbitMQ Cluster ] ──( Granular Routing / RPC / DLX )──> [ Core Microservices (Billing, Inventory) ]
│
│ (Event Forwarder / Change Data Capture)
▼
[ Apache Kafka Backbone ] ──( Partitions / Replay Log )──> [ Analytics / ML Pipelines ]
└──> [ Data Lake / Snowflake / S3 ]
└──> [ Real-time Fraud Detection ]In this architecture, RabbitMQ handles internal, transactional inter-service communication between operational microservices. When a user submits an order, the request hits an API gateway which publishes tasks to RabbitMQ. RabbitMQ uses direct and topic exchanges to orchestrate inventory checks, payment processing, notification dispatching, and email generation across localized worker pools. It manages per-message timeouts, retries failed payment notifications through dead-letter exchanges, and handles request-reply RPC calls with sub-millisecond responsiveness.
Once the transaction completes, a specialized connector service or Change Data Capture (CDC) engine publishes the canonical OrderCompleted domain event to a centralized Apache Kafka cluster. Kafka acts as the enterprise-wide nervous system, distributing the immutable business event to the corporate data warehouse, real-time machine learning fraud detection models, supplier integration streams, and customer analytics platforms. This separation of concerns allows operational microservices to benefit from RabbitMQ's rich routing and transient reliability, while analytics and downstream consumers benefit from Kafka's long-term retention, parallel scalability, and replayable event logs.
Frequently Asked Questions
Is Apache Kafka always faster than RabbitMQ?
Kafka provides significantly higher throughput than RabbitMQ, processing millions of messages per second through sequential disk I/O and batching. However, for individual message delivery latency under moderate traffic, RabbitMQ is typically faster, delivering sub-millisecond latencies compared to Kafka's 2ms to 15ms range.
Can RabbitMQ be used for event sourcing like Kafka?
Traditional RabbitMQ queues are unsuited for event sourcing because messages are deleted immediately after consumer acknowledgment. While modern RabbitMQ Streams introduce append-only log capabilities with replayability, Kafka remains the industry standard for event sourcing due to its native partitioning, compaction, and ecosystem maturity.
How does message acknowledgment differ between Kafka and RabbitMQ?
RabbitMQ uses broker-side tracking where consumers send explicit acknowledgments (ack/nack) for each message, allowing the broker to manage individual delivery state. Kafka uses client-side offset commits, where consumers track their sequential position in a partition log without per-message broker intervention.
Does Apache Kafka still require Apache ZooKeeper?
Modern Apache Kafka versions no longer require Apache ZooKeeper. Kafka uses KRaft (Kafka Raft Metadata Mode), an internal consensus protocol that manages cluster metadata, partition leaders, and controller elections directly within Kafka nodes, simplifying infrastructure operations and improving scalability.
What is a Dead Letter Exchange (DLX) and does Kafka have one?
A Dead Letter Exchange in RabbitMQ is a native broker feature that automatically reroutes rejected, unacknowledged, or expired messages to a dedicated queue. Kafka has no native broker-level DLX; dead-letter functionality must be implemented client-side within application logic or via stream processing frameworks.
How do Kafka and RabbitMQ handle consumer scaling?
RabbitMQ scales consumers dynamically by distributing messages across multiple workers listening to the same queue using round-robin delivery. Kafka scales consumers through consumer groups, where the maximum number of active parallel consumers is strictly bounded by the number of partitions in the subscribed topic.
Which platform is easier to operate and maintain in production?
RabbitMQ is generally easier to set up and manage for small to medium workloads due to its intuitive built-in management UI and lightweight Erlang runtime. Kafka requires more specialized operational expertise regarding JVM tuning, partition capacity planning, OS page cache management, and storage topology configuration.
Can Kafka guarantee strict message ordering?
Kafka guarantees strict message ordering only within a single partition, not across an entire topic. To guarantee strict chronological processing for related records (such as events for a specific user ID), producers must assign consistent partition keys to ensure all related events land on the same partition.