Markdown Editor

Distributed Message Queue System Design Template (Kafka-Style Log)

Partitions, log segments, retention, acks and idempotence, consumer groups, offsets, delivery semantics, ordering, ISR replication, backpressure, DLQ, schemas

시스템 설계전체Apache Kafka 4.3 documentation; Kafka paper (NetDB 2011)designmessagequeuemath

사용법: Use it when designing an event streaming platform or a shared queue. Choose partition keys and the end-to-end delivery guarantee per consumer first, then size partitions and brokers from section 3. The main pitfall is believing log-level exactly-once covers database writes and external calls; make consumers idempotent.

미리보기

System Design: [Message queue or event log name]

Reference design for a distributed message queue built as a partitioned, replicated, append-only log. It covers topics and partitions, log segments and retention, producers (acknowledgements and idempotence), consumer groups and offset management, delivery semantics and their real limits, ordering guarantees, replication with in-sync replicas and leader election, backpressure, retries and dead-letter topics, schema management and throughput estimation. Concepts and default values follow the Apache Kafka 4.3 documentation and the original Kafka paper (Kreps, Narkhede and Rao, NetDB 2011); the design applies to any comparable log. It follows the structure of the System Design Document template and is pre-filled with a worked design to adapt. Values marked Example are assumptions. Replace every [bracketed] value and every row marked Example.

Document control

FieldValue
Document ID[SDD-MQ-001]
System / feature[Event streaming platform]
Version[0.1]
Status[Draft / In review / Approved / Implemented / Superseded]
Author(s)[@author]
Reviewers[@reviewer-1], [@reviewer-2]
Last updatedYYYY-MM-DD
Classification[Internal]
Log technology and version[Apache Kafka 4.x / managed service / other]
Related[Event API specification], [Capacity estimation worksheet CAP-EST-nnn], [ADR: delivery semantics]

Approvals

RoleNameDecisionDate
Tech lead[@name][Approved / Changes requested]YYYY-MM-DD
Staff / principal engineer[@name][Decision]YYYY-MM-DD
SRE / operations[@name][Decision]YYYY-MM-DD
Security[@name][Decision]YYYY-MM-DD
Data governance (schemas, retention)[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft for design review
0.2YYYY-MM-DD[@name]Example: Raised min.insync.replicas to 2 for all business topics
0.3YYYY-MM-DD[@name]Example: Added retry topics and dead-letter topics per consumer group
1.0YYYY-MM-DD[@name]Example: Approved

Contents

1. Overview

1.1 Problem statement

[Example: Services integrate through synchronous calls and a shared database. An outage of the order service blocks checkout, analytics reads production replicas, and three teams run their own queues with different guarantees. Peak traffic during sales reaches 1 million events per second and nobody can replay events after a consumer bug.]

1.2 Proposed solution

[Example: A shared event log platform. Producers write keyed events to topics split into partitions; each partition is an append-only log of segments replicated to three brokers in three zones. Producers use acks=all with idempotence; topics require two in-sync replicas. Consumers form groups, each partition is read by one member of a group, and offsets are committed after processing. Events are retained for 7 days for replay; compacted topics hold the latest state per key. Schemas are registered and checked for compatibility before a producer can publish. Failed messages go through delayed retry topics and finally a dead-letter topic owned by the consuming team.]

1.3 Decisions requested from reviewers

IDQuestionRecommended optionSection
Q-01Example: Default delivery guarantee for consumers?At-least-once with idempotent consumers; transactions only for log-to-log pipelines7.6
Q-02Example: Durability settings?Replication factor 3, min.insync.replicas=2, acks=all, unclean election off7.8
Q-03Example: Retention for business topics?7 days delete plus compacted state topics7.2
Q-04Example: Run ourselves or use a managed service?[Decision]10
[Q-nn][Question][Option][Section]

2. Requirements

2.1 Functional requirements

IDRequirementPriority
FR-01Example: Publish keyed messages to named topics with headersMust
FR-02Example: Ordered delivery per keyMust
FR-03Example: Several independent consumer groups per topic, each with its own positionMust
FR-04Example: Replay from an offset or timestamp within retentionMust
FR-05Example: Compacted topics keeping the latest value per keyShould
FR-06Example: Retry with delay and dead-letter handling per consumer groupMust
FR-07Example: Schema registration and compatibility checksMust
FR-08Example: Work-queue consumption with per-message acknowledgementCould
[FR-nn][Requirement][Must / Should / Could]

2.2 Non-functional requirements

IDQualityTargetMeasured as
NFR-01ThroughputExample: 1 million messages/s (1 GB/s) at peakLoad test
NFR-02Publish latencyExample: p99 at or below 30 ms with acks=allProducer metrics
NFR-03End-to-end latencyExample: p99 at or below 200 ms from publish to consumer pollTimestamp headers
NFR-04DurabilityExample: No acknowledged message lost with one broker or one zone lostFault injection with verification
NFR-05AvailabilityExample: Writes available with one zone lostZone failure game day
NFR-06RecoveryExample: A consumer group recovers a 30-minute backlog within 15 minLag drain test
[NFR-nn][Quality][Target][Measurement]

2.3 Out of scope

  • [Example: cross-region active-active replication (later phase, mirrored topics)]
  • [Example: stream processing frameworks; teams choose their own]
  • [Example: messages larger than 1 MB (use object storage and send a reference)]
  • [Item deferred, with the release that will take it]

3. Capacity estimation

3.1 Assumptions

InputSymbolValueSource
Peak messages per second (all topics)MpM_{p}Example: 1 000 000Sale-day traffic x growth
Average messages per secondMaM_{a}Example: 400 000Daily curve
Average message size on the wire, compressed, with overheadmmExample: 1 KBProducer metrics
Replication factorffExample: 37.8
Consumer groups reading all dataggExample: 3Consumer inventory
RetentionttExample: 7 days = 604 800 s7.2
Usable disk per broker at 70% fill (24 TB raw)ddExample: 16.8 TBHardware standard
Throughput per partition, producer sidepwp_{w}Example: 10 MB/sBenchmark
Throughput per partition, slowest consumerpcp_{c}Example: 5 MB/s (5 000 messages/s)Consumer benchmark

3.2 Throughput and network

Tpeak=Mp×m=106×1 KB=1 GB/s,Tavg=4×105×1 KB=400 MB/sT_{peak} = M_{p} \times m = 10^{6} \times 1 \ \text{KB} = 1 \ \text{GB/s}, \qquad T_{avg} = 4 \times 10^{5} \times 1 \ \text{KB} = 400 \ \text{MB/s}

At peak, brokers receive producer traffic plus follower replication, and send consumer traffic plus replication:

Bin=Tpeak×f=3 GB/s,Bout=Tpeak×g+Tpeak×(f−1)=3+2=5 GB/sB_{in} = T_{peak} \times f = 3 \ \text{GB/s}, \qquad B_{out} = T_{peak} \times g + T_{peak} \times (f - 1) = 3 + 2 = 5 \ \text{GB/s}

3.3 Storage and broker count

S=Tavg×t×f=400 MB/s×604 800 s×3≈725.8 TBS = T_{avg} \times t \times f = 400 \ \text{MB/s} \times 604\,800 \ \text{s} \times 3 \approx 725.8 \ \text{TB}
n=⌈725.816.8⌉=⌈43.2⌉=44⇒45 brokers (15 per zone)n = \left\lceil \frac{725.8}{16.8} \right\rceil = \lceil 43.2 \rceil = 44 \Rightarrow 45 \ \text{brokers (15 per zone)}

Per broker at peak this is about 3 000/45≈673\,000 / 45 \approx 67 MB/s in and 5 000/45≈1115\,000 / 45 \approx 111 MB/s out, well under a 25 Gbit/s (about 3.1 GB/s) network interface. Storage, not network, sets the broker count; tiered storage (7.2) would change that.

3.4 Partitions

The partition count must let both producers and the slowest consumer group keep up, with headroom hh for growth:

P=max⁡(Tpeakpw,Tpeakpc)×h=max⁡(100,200)×1.5=300P = \max\left(\frac{T_{peak}}{p_{w}}, \frac{T_{peak}}{p_{c}}\right) \times h = \max(100, 200) \times 1.5 = 300

With replication factor 3 that is 900 partition replicas, 20 per broker. Apply the same formula per topic with that topic's own peak.

3.5 Backlog recovery

A consumer group with PP members at 5 0005\,000 messages/s each processes 1.5×1061.5 \times 10^{6} messages/s. After a 30-minute outage at average load the backlog is L=4×105×1 800=7.2×108L = 4 \times 10^{5} \times 1\,800 = 7.2 \times 10^{8} messages, and with new messages still arriving at λ=4×105\lambda = 4 \times 10^{5}/s:

tdrain=LC−λ=7.2×1081.5×106−4×105≈655 s≈11 mint_{drain} = \frac{L}{C - \lambda} = \frac{7.2 \times 10^{8}}{1.5 \times 10^{6} - 4 \times 10^{5}} \approx 655 \ \text{s} \approx 11 \ \text{min}

This meets NFR-06. Catch-up reads come from disk rather than page cache, so schedule the drain test on production-sized brokers.

3.6 Summary

QuantityEstimateDesign consequence
Ingress1 GB/s peak, 400 MB/s averageBatching and compression at producers
Broker network3 GB/s in, 5 GB/s out cluster-wideAbout 67 MB/s in and 111 MB/s out per broker
Storageabout 726 TB for 7 days with 3 replicas45 brokers, or fewer with tiered storage
Partitions300 across business topics20 replicas per broker
Backlog drainabout 11 min for 30 min of lagConsumers sized at 1.5 times peak partition need

4. API design

4.1 Operations

OperationCallerSemantics
produce(topic, key, value, headers)ProducerAppends to the partition chosen by key hash; returns partition and offset once acknowledged per acks
fetch(topic, partition, offset, max_bytes)ConsumerPull-based read from an offset; long-polls until data or timeout
commit(group, partition, offset)ConsumerRecords the next offset to read for the group
begin, send_offsets, commit_txn, abort_txnTransactional producerAtomic writes across partitions plus consumer offsets
create_topic(name, partitions, config)Platform APIThrough a reviewed request, not ad hoc

4.2 Producer and consumer configuration

The defaults below are from the Apache Kafka 4.3 configuration reference; check the documentation for your version.

SettingKafka 4.3 defaultPlatform settingWhy
acksallallAcknowledge only when all in-sync replicas have the record
enable.idempotencetrue (if no conflicting settings)trueBroker drops duplicate retries using producer ID and sequence numbers
max.in.flight.requests.per.connection55Highest value that keeps ordering with idempotence
linger.ms510 (Example)Larger batches, better compression
batch.size16 384 bytes131 072 (Example)Fewer requests at high throughput
compression.typenonezstd or lz4 (Example)Cuts disk and network
Consumer enable.auto.committruefalseCommit after processing, not on a timer
Consumer isolation.levelread_uncommittedread_committed for transactional topicsHide aborted transactional records

4.3 Message envelope

{"key": "order-7f3a91", "headers": {"event_type": "OrderPlaced", "schema_id": "1042", "event_id": "0b6e6c8e-6f0e-4b0a-9e1d-2f3c4d5e6f70", "produced_at": "YYYY-MM-DDTHH:MM:SSZ", "trace_parent": "00-[trace-id]-[span-id]-01"}, "value": {"order_id": "7f3a91", "customer_id": "c-2231", "total_minor": 4599, "currency": "EUR"}}

event_id is the consumer's idempotency key; the value is serialised with the registered schema (7.11).

5. Data model

5.1 Entities

A topic has partitions; each partition replica is a sequence of segments on one broker; groups track offsets per partition.

5.2 Topic contract

TopicKeyPartitionsCleanupRetentionSchemaOwnerConsumers
orders.events.v1 (Example)order_id60delete7 daysOrderEvent (Avro)OrdersPayments, fulfilment, analytics
customers.state.v1 (Example)customer_id30compactLatest per keyCustomer (Protobuf)CustomersSearch, CRM sync
payments.retry.5m (Example)Original key12delete1 daySame as sourcePaymentsPayments consumer
payments.dlq (Example)Original key6delete30 daysSame as source plus error headersPaymentsPayments on-call
[Topic][Key][n][Policy][Retention][Schema][Team][Groups]

Topic names carry a major version; a breaking schema change creates a new topic and a migration window, never an in-place break.

6. High-level design

ComponentResponsibilityScales by
BrokersStore partition replicas, serve produce and fetchBrokers and disks
Controller quorumMetadata, leader election, ISR changes (KRaft; Kafka 4.0 and later have no ZooKeeper mode)Three or five controllers
Schema registryStore schemas, enforce compatibilitySmall replicated service
Consumer groupsProcess partitions; one member per partition per groupMembers up to partition count
Retry and dead-letter topicsDelay and park failed messagesPer consumer group
Platform APITopic creation, ACLs, quotas, ownershipSingle service

7. Detailed design

7.1 Topics and partitions

A topic is a named stream; a partition is an ordered, append-only sequence in which each record gets a monotonically increasing offset. Partitions are the unit of parallelism, ordering, replication and placement. The producer chooses the partition by hashing the key; records without a key are spread across partitions in batches.

7.2 Log segments and retention

Each partition replica is a directory of segment files, each with an index by offset and an index by timestamp. Only the newest (active) segment is written; older segments are immutable. Retention deletes whole closed segments, which is why it is cheap and why data can live slightly longer than the configured retention.

  • Time and size retention: Kafka 4.3 defaults to 168 hours (log.retention.hours) and rolls segments at 1 GiB (log.segment.bytes). At the example average of about 1.33 MB/s per partition (400 MB/s over 300 partitions), a segment fills in about 1 073 741 824/(1.33×106)≈8051\,073\,741\,824 / (1.33 \times 10^{6}) \approx 805 s, so retention granularity is fine.
  • Compaction: with cleanup.policy=compact the log keeps at least the latest value per key; a null value is a tombstone that is removed after delete.retention.ms (default 24 hours). Use it for state topics, not for event histories.
  • Tiered storage: recent Kafka releases can offload closed segments to object storage, keeping only recent data on broker disks. It cuts the storage-driven broker count in section 3.3; check the feature status and limitations for your version before relying on it.

7.3 Produce path

One batch from an idempotent producer with acks=all, including the retry case:

7.4 Producers: acknowledgements and idempotence

acksAcknowledged whenLoss riskLatency
0Sent, no broker responseAny failure loses dataLowest
1Leader has written the recordLoss if the leader fails before followers copy itLow
allAll current in-sync replicas have the recordNone while at least min.insync.replicas copies existHighest

Idempotence (available since Kafka 0.11, on by default in current releases) gives each producer an ID and numbers each batch per partition, so the leader discards duplicates from retries. It removes duplicates caused by the producer's own retries within a producer session; it does not deduplicate an application that sends the same business event twice, which is why events also carry event_id.

7.5 Consumer groups and offset management

Members of a group divide the partitions of the subscribed topics; each partition has exactly one member at a time. Committed offsets are stored as records in an internal compacted topic (__consumer_offsets in Kafka), so they are replicated like data. Kafka 4.0 made the new server-driven rebalance protocol (KIP-848) generally available, which reduces stop-the-world rebalances; Java consumers opt in with group.protocol=consumer, and other clients may lag behind, so check the client support for your language.

Commit rules for the platform:

  1. Disable auto commit; commit after the processing side effects are durable.
  2. Commit the offset of the next record to read, per partition.
  3. On rebalance, finish or abandon in-flight work and commit before releasing partitions.
  4. Consumers must tolerate seeing a record again after a crash (7.6).

For work-queue use where many consumers share a partition with per-message acknowledgement, Kafka share groups (KIP-932) were declared production-ready in Kafka 4.2; confirm client support before choosing them over classic consumer groups.

7.6 Delivery semantics and their real limits

SemanticsMechanismWhat it guaranteesWhat it does not
At-most-onceCommit offset before processingNo duplicatesMessages lost if the consumer crashes mid-processing
At-least-onceCommit after processingNo loss within retentionDuplicates after crashes, rebalances or retries
Exactly-once within the logIdempotent producer plus transactions; consumers in read_committed; offsets committed in the same transactionA read-process-write pipeline from topic to topic produces each output once, with its input offsetAny side effect outside the log: database writes, HTTP calls, emails
Effectively-once end to endAt-least-once plus idempotent processing (dedupe on event_id, upserts, conditional writes) or a transactional outboxEach business effect applied onceRequires discipline in every consumer

The platform default is at-least-once with idempotent consumers. Transactions are used for stream processing jobs that read and write topics (for example Kafka Streams with exactly-once processing enabled). Transactional producers need a stable transactional.id so that a restarted instance fences the old one; a transaction timeout aborts work from a producer that disappeared.

7.7 Ordering guarantees

  • Order is guaranteed only within a partition. Records with the same key go to the same partition while the partition count stays the same.
  • With idempotence and up to 5 in-flight requests, retries do not reorder records within a partition.
  • Increasing the partition count changes the key-to-partition mapping for new records, so per-key order breaks across the change. Over-provision partitions at creation (3.4) or create a new topic and migrate.
  • A consumer that processes records of one partition in parallel threads must keep per-key order itself (for example, one queue per key hash).
  • Retry topics break order for the failed key; topics that require strict per-key order pause the partition instead of forwarding to retry.

7.8 Replication, in-sync replicas and leader election

Each partition has one leader and followers that fetch from it. The leader tracks the in-sync replica set (ISR): replicas that keep an active session with the controller and are not too far behind (Kafka 4.3 default for replica.lag.time.max.ms is 30 s). A record is committed when all ISR members have it, and consumers only read up to the high watermark.

SettingKafka 4.3 defaultPlatform settingEffect
default.replication.factor13One replica per zone
min.insync.replicas12With acks=all, writes fail if fewer than 2 replicas are in sync
unclean.leader.election.enablefalsefalseNever elect an out-of-sync replica, which could lose committed data
offsets.topic.replication.factor33Offsets as durable as data

With replication factor 3 and min.insync.replicas=2, one broker or one zone can be lost without losing acknowledged data or write availability; a second simultaneous loss in the same partition stops writes (producers get a "not enough replicas" error) rather than risking loss. The controller quorum elects a new leader from the ISR when a leader fails.

7.9 Backpressure

The log decouples rates, but every buffer is finite:

PointMechanismPlatform setting
ProducerBounded send buffer; send blocks then fails when fullFail fast after a short block; shed or spill non-critical events
BrokerProduce and fetch byte-rate quotas per client or user; request throttlingQuotas per team from the capacity plan
ConsumerPull model; bounded records per poll; pause and resume partitionsPause when downstream is saturated; alert on lag
DownstreamConsumer rate limits to protect databases and third-party APIsToken bucket per dependency

Consumer lag (latest offset minus committed offset) is the main signal. For timeouts, retry budgets and load-shedding policies across services, align with the Resilience and load shedding design (system-design/resilience-load-shedding-design).

7.10 Retries and dead-letter topics

Most log technologies have no built-in dead-letter topic for plain consumers, so the platform provides a library:

  1. Classify the error: transient (timeout, 503) or permanent (validation, unknown schema).
  2. Transient: retry in-process up to 3 times with jittered backoff, then publish to a delay topic (retry.5m, then retry.1h) with headers for the original topic, partition, offset, attempt and error.
  3. Permanent, or attempts exhausted: publish to the group's dead-letter topic and commit the original offset.
  4. The owning team triages the dead-letter topic with a replay tool that republishes selected records to the original topic or a retry topic.

Dead-letter topics count as production data: same access controls, retention of 30 days and an alert when the rate exceeds a threshold.

7.11 Schema registry and compatibility

Producers register Avro, Protobuf or JSON Schema definitions and send the schema ID in each message; consumers fetch schemas by ID and cache them. The registry rejects incompatible changes according to the topic's mode:

ModeAllowed changeUpgrade order
BackwardNew schema can read data written with the previous one (add optional fields, remove fields)Consumers first
ForwardPrevious schema can read data written with the new oneProducers first
FullBoth directionsEither
NoneAnythingNot allowed for shared topics

The platform default is backward compatibility with transitive checks for shared topics. Document each topic's contract in the event API specification (architecture/event-api-specification).

8. Scalability and performance

ConcernApproachLimit before redesign
ThroughputAdd brokers and partitions; producer batching and compressionExample: per-broker network above 50% of NIC
Storage7-day retention; tiered storage for longer replayDisk fill above 70%
Partition countOver-provision at creation; cap per brokerExample: several thousand replicas per broker
Hot partitionBetter key choice, key salting for non-ordered dataOne key above a partition's throughput
Consumer parallelismMembers up to partition count; per-key parallel processing inside membersPartition count

Latency budget for publish with acks=all (target p99 30 ms):

StepBudget
Producer linger and batching10 ms
Network to leader1 ms
Append to page cache1 ms
Follower fetch round trip across zones (two followers in parallel)5 ms
Acknowledgement to producer1 ms
Headroom (garbage collection, queueing, disk flush)12 ms

9. Reliability, security and operations

9.1 Failure modes

FailureImpactDetectionMitigation
Broker downLeaders move; ISR shrinksUnder-replicated partitionsLeader election from ISR; replace broker
Zone downOne third of brokers gone; ISR at 2Zone health, under-replicated partitionsmin.insync.replicas=2 keeps writes up; rack-aware placement
Slow followerLeaves ISR; durability margin shrinksISR shrink rateInvestigate disk or network; throttle reassignments
Consumer bug writes bad dataDownstream corruptionData quality checksReset group offsets to a timestamp and replay
Poison messageConsumer stuck on one offsetLag growing on one partitionRetry and dead-letter path (7.10)
Controller quorum lossNo leader elections or metadata changesController healthFive controllers across three zones; tested recovery runbook
[Failure][Impact][Signal][Mitigation]

9.2 Security

ThreatControl
Unauthorised produce or consumemTLS or SASL authentication; ACLs per topic and group, owned by teams
Sensitive data in eventsData classification per topic; field-level encryption for regulated fields; no secrets in headers
Data retained too longRetention per topic reviewed by data governance; compaction tombstones for erasure
Schema poisoningRegistry writes limited to producer service accounts; compatibility enforced
Noisy neighbourQuotas per client and team
[Threat][Control]

9.3 Observability

SignalMetric or logAlert threshold
Under-replicated partitionsCount per clusterAny for more than 5 min
Offline partitionsCountAny
Consumer lagMessages and seconds behind, per groupLag in seconds above the group's SLO
Produce errorsError rate by typeAbove 0.1% for 5 min
Dead-letter rateMessages per minute per groupAbove the group threshold
Disk usagePer brokerAbove 70%

9.4 Cost estimate

ItemUnit costQuantityMonthly cost
Brokers[USD per broker-month]Example: 45[USD]
Controllers[USD per node-month]Example: 5[USD]
Cross-zone replication traffic[USD per GB]2×4002 \times 400 MB/s average[USD]
Schema registry and platform API[USD per month]1 deployment[USD]
Tiered object storage (if used)[USD per TB-month][TB][USD]
Total[USD]

10. Trade-offs and alternatives

DecisionOptionsChosenWhyWhat we give up
ModelBroker-centric queue (per-message ack, deleted on consume); partitioned logPartitioned logReplay, many independent consumers, high throughputPer-message routing features; work-queue semantics need share groups
Delivery defaultAt-most-once; at-least-once; exactly-once everywhereAt-least-once plus idempotent consumersWorks with external side effectsEvery consumer must deduplicate
Durabilityacks=1; acks=all with min.insync.replicas=2acks=all, ISR 2No loss on one failureHigher publish latency
RetentionShort; long on brokers; tiered7 days on brokers, tiered laterReplay window for incidentsDisk cost drives broker count
OperationSelf-managed; managed service[Choice][Reason][Cost]
[Decision][Options][Chosen][Why][Cost]

11. Delivery plan and risks

11.1 Milestones

MilestoneScopeExit criterionTarget date
M1Cluster, platform API, schema registry, one pilot topicFault injection suite passes; no acknowledged lossYYYY-MM-DD
M2Retry and dead-letter library, consumer lag dashboardsPoison-message test recovers without manual offset editsYYYY-MM-DD
M3Orders and payments topics in productionNFR-02 and NFR-03 met for 14 daysYYYY-MM-DD
M4Teams' legacy queues migratedLegacy queues decommissionedYYYY-MM-DD

11.2 Rollout and rollback

[Example: Producers dual-publish to the legacy queue and the new topic; consumers move one group at a time with a flag. Rollback flips the consumer flag back; dual publishing continues until 30 days after the last consumer moved.]

11.3 Risks

IDRiskLikelihoodImpactMitigationOwner
R-01Example: Consumers assume exactly-once and double-apply effectsHighHighIdempotency checklist in consumer reviews; dedupe library[@name]
R-02Example: Partition count too low, re-keying neededMediumHighOver-provision per 3.4; capacity review each quarter[@name]
R-03Example: Schema change breaks a consumerMediumMediumRegistry compatibility checks in CI[@name]
[R-nn][Risk][L / M / H][L / M / H][Mitigation][@name]

12. Appendices

12.1 Open questions

IDQuestionOwnerDue
OQ-01Example: Which topics need cross-region mirroring, and with what lag?[@name]YYYY-MM-DD
OQ-02Example: Adopt share groups for the job-processing workload?[@name]YYYY-MM-DD
[OQ-nn][Question][@name]YYYY-MM-DD

12.2 Glossary

TermMeaning
PartitionOrdered, append-only log that is the unit of parallelism and replication
OffsetPosition of a record within a partition
SegmentOne file of a partition's log; retention deletes whole segments
ISRIn-sync replicas: replicas caught up closely enough to the leader
High watermarkHighest offset replicated to all ISR members; consumers read up to it
Consumer groupSet of consumers that share the partitions of a subscription
Consumer lagDifference between the latest offset and the group's committed offset
Dead-letter topicTopic that holds messages a consumer could not process
[Term][Meaning]

12.3 References

ReferenceUse
Apache Kafka 4.3 documentation: design, producer, consumer and broker configurationConcepts and default values in 4.2, 7.2, 7.4, 7.6 and 7.8
J. Kreps, N. Narkhede, J. Rao, "Kafka: a Distributed Messaging System for Log Processing", NetDB 2011Log-based design, pull consumers, partitioned topics
Apache Kafka 4.0 and 4.2 release announcementsKRaft-only operation, KIP-848 rebalance protocol, share groups (KIP-932)
Event API specification (architecture/event-api-specification)Topic contracts and schemas
Capacity estimation worksheet (system-design/back-of-envelope-estimation)Method for section 3
Capacity plan (ops/capacity-plan)Ongoing broker and partition capacity

Standard and licence note

Based on the Apache Kafka 4.3 documentation and the Kafka paper by Kreps, Narkhede and Rao (2011), used as concept sources, and on common industry practice for event streaming platforms. Default values are cited as published for Kafka 4.3 in October 2026; check the documentation for the version you run, because defaults change between releases. This is a reference design to adapt, with illustrative numbers. Original text written for this collection; no documentation text is reproduced. Apache Kafka is a trademark of the Apache Software Foundation. Template licence: MIT.

관련 템플릿