Competing Consumers
Scaling throughput with instances, at the cost of ordering.
4 to work through
-
intermediate
A rendering platform processes jobs from a queue with a pool of workers. What does the competing-consumers pattern require to be correct, and what limits its scaling?
2 min answer -
advanced
A queue-backed worker pool processes image jobs. One consumer's process is alive and its health check passes, but it is blocked in a socket read to a storage service that never returns and has no timeout. Queue depth looks normal. What happens over the next hour and what would have caught it?
3 min answer -
advanced
A team uses competing consumers to scale processing and discovers that ordering guarantees are broken. What happened, and what are the options?
2 min answer -
advanced
At 14:02 a consumer group of twelve workers is draining a partitioned order-events topic at 9,000 messages a second. By 14:07 throughput is zero while every worker is running and its health check passes, and queue depth is climbing. At 14:12 throughput returns for forty seconds and then stops again. The pattern repeats. What failed, and which design decision allowed it?
3 min answer
4 terms in this topic
Competing Consumers
Multiple instances reading from the same queue, each taking different messages, so throughput scales by adding consumers.
conceptConsumer Liveness Gap
The interval in which a queue consumer is alive by every health signal yet is making no progress, so its share of the work stalls while pool-level me…
conceptPartition Assignment
The mapping of partitions to consumer instances that determines parallelism, ordering guarantees and what happens when the consumer set changes.
conceptVisibility Timeout
The period a claimed message is hidden from other consumers - too short and work is duplicated, too long and a crashed worker stalls the item.
Neighbouring topics
Architecture Patterns
General material on architectural patterns and their trade-offs.
Layered Architecture
The default shape, its clarity, and where a technical partition fails.
Event-Driven Architecture
Publishing facts, and trading comprehensibility for decoupling.
Pipes and Filters
Independent transformation steps composed into a pipeline.
Publish/Subscribe
Broadcast to every subscriber, as distinct from work distribution.
Saga
Local transactions with compensating actions across services.
CQRS
Separate models for writing and reading, each optimised for its job.
Event Sourcing
The event log as the system of record, with state as a projection.
Outbox
Making the event atomic with the business write it describes.
Strangler Fig
Incremental replacement behind a routing facade.
Anti-Corruption Layer
Translating a foreign model at the boundary so it does not leak in.
Sidecar & Ambassador
Cross-cutting behaviour in a co-deployed process.
Service Mesh
Sidecars applied estate-wide, and the scale at which that pays.
API Gateway
A single entry point for policy, routing and protocol translation.
Backend for Frontend
A narrow backend per client experience, owned by that client's team.
Cell-Based Architecture
Complete isolated copies each serving a subset of customers.
Sharding Patterns
Directory versus embedded keys, logical shards and rebalancing.
Materialized Views
Precomputed query results, refreshed incrementally or in full.
Orchestration vs Choreography
A coordinator that knows the flow, or services that react to events.