distributed systems
18 minDistributed Systems Advanced: Rebalancing, Sagas, Consensus, and Trace Context
Design around Kafka group churn, payment idempotency, coordination limits, sagas, CQRS, and context propagation across async boundaries.
Loading page...
distributed systems
18 minDesign around Kafka group churn, payment idempotency, coordination limits, sagas, CQRS, and context propagation across async boundaries.
Q&A
Q&AKeep consumer liveness within max.poll.interval.ms and commit only after durable work.
If processing exceeds max.poll.interval.ms, the group may consider the member failed and reassign its partitions; a later commit from the old generation is rejected. Reduce records per poll, process with bounded workers while preserving partition ordering, pause/resume appropriately, or adjust the interval based on measured worst-case work. Keep the fix from merely delaying failure detection indefinitely.
Q&A
Q&AReplacing the shell with the service improves signal delivery and exit-code propagation.
Without exec, the shell can remain as the parent process and may not forward termination signals as intended. `exec service ...` replaces the shell, making the service the main process so it receives the container stop signal directly and its exit status is reported. A wrapper supervising multiple children must explicitly forward signals and reap them.
distributed systems
12 minConsumer groups are the mechanism that turns Kafka partitions into scalable, failure-tolerant work units. Learn how rebalances, offsets, and lag interact under load before you ship your first serious pipeline.
Q&A
Q&AHashMap stores entries in buckets, resolves collisions with linked lists or trees, and resizes when load crosses a threshold.
HashMap uses an array of buckets and computes an index from the hash of the key. Each bucket may hold one or more entries. When collisions happen, Java stores entries in a linked list and later in a tree when the bucket grows large enough. The table resizes when the load factor is exceeded so the map keeps operations efficient. The key idea is balancing fast lookup with controlled memory use.