Topics, Groups, Owners
The core consumer model behind DriftQ-Core.
DriftQ-Core’s consumer model is built around three concepts: topics, consumer groups, and owners. If these click, the rest of the API feels obvious.
Quick mental model: topic = stream, group = subscription, owner = worker identity.
Topics
A topic is a named stream of messages.
- Producers write messages to a topic.
- Consumers read messages from a topic.
- Topics can have partitions to scale throughput and parallelism.
Partitions (quick mental model)
If a topic has multiple partitions, it’s effectively multiple parallel logs.
- Each partition has its own ordered offsets:
0, 1, 2, 3, … - Consumers typically read per-partition in order.
Rule of thumb: ordering is per-partition, not across the entire topic.
Consumer groups
A group is a logical subscription to a topic. Each group maintains its own committed offset per partition.
g1andg2can independently consume the same topic.- Each group sees the stream from its own position, at its own pace.
Example
If topic t has partition p0 and messages exist at offsets 0..100:
group=g1 -> offset 10
group=g2 -> offset 72What this enables: multiple independent workflows reading the same event stream.
Owners
An owner identifies a specific consumer instance inside a group (think: a worker process).
DriftQ uses owner to enforce safe ack/nack behavior with leases:
/v1/consumerequiresowner/v1/ackand/v1/nackmust use the sameowner- If the owner doesn’t match the current lease holder → 409 conflict
Why this exists
owner + lease model, you risk:- two consumers processing the same message at once
- a consumer acking work it doesn’t actually own
- silent double-processing after crashes/retries
Minimal mental model
- Consumer calls consume with
(topic, group, owner)→ receives a leased message - Same consumer later calls ack/nack with the same
(topic, group, owner) - If a different consumer tries to ack it → 409 conflict
Bottom line: owner is what makes retries safe and prevents “wrong consumer acked it.”
Common combinations
- Scale processing: same
group, differentowners(multiple workers) - Independent workflows: different
groups(separate offsets) - Strict safety: keep
ownerstable per consumer process instance
