CDC.GROUP CREATE
Create a consumer group for CDC events. SyntaxThe CDC stream key (use ”*” for all events)
The consumer group name
Starting sequence number (0 = from beginning, $ = from next event)
OK if the consumer group was created successfully
- Consumer groups enable at-least-once delivery semantics
- Multiple consumers can read from the same group
- Each group maintains independent cursors and pending entries
CDC.GROUP READ
Read CDC events as part of a consumer group. SyntaxThe CDC stream key pattern
The consumer group name
The consumer name within the group
Maximum number of events to read
Array of CDC events (seq, key, operation, value, timestamp)
[0]- Sequence number (monotonically increasing)[1]- Key affected[2]- Operation type (SET, DEL, HSET, HDEL, LPUSH, SADD, etc.)[3]- Value (for SET operations) or null[4]- Unix timestamp in seconds
CDC.ACK
Acknowledge processed CDC events. SyntaxThe CDC stream key
The consumer group name
One or more sequence numbers to acknowledge
The number of events acknowledged
- Acknowledged events are removed from the pending entries list
- Unacknowledged events may be redelivered to other consumers
- ACK is idempotent (acknowledging already-acked events is safe)
CDC.PENDING
List pending (unacknowledged) CDC events for a consumer group. SyntaxThe CDC stream key
The consumer group name
Array of pending events with delivery count and idle time
[0]- Sequence number[1]- Consumer name that last claimed the event[2]- Delivery count (how many times it was read)[3]- Idle time in milliseconds since last delivery
CDCPOLL
Poll CDC events from a shard (low-level, cursor-based). SyntaxThe sequence number to start reading from
Maximum number of events to return
Array of CDC events
- CDCPOLL is a low-level command for custom CDC consumers
- Does not provide at-least-once guarantees (use consumer groups for that)
- Useful for tailing the CDC stream or implementing custom replication
CDC Ring Buffer
Configuration
The CDC ring buffer is configured per-shard:- Buffer size: 10,000 events per shard (default)
- Retention: Events are evicted when the buffer is full (FIFO)
- Sequence numbers: Monotonically increasing, never reused
- Gap detection: Consumers detect if they’ve fallen too far behind
Captured Operations
The following operations generate CDC events: String operations:- SET, GETSET, APPEND, INCR, DECR, INCRBY, DECRBY
- DEL, RENAME, RENAMENX, UNLINK
- LPUSH, RPUSH, LPOP, RPOP, LSET, LREM, LTRIM
- HSET, HDEL, HINCRBY, HINCRBYFLOAT
- SADD, SREM, SPOP, SMOVE
- DOC.SET, DOC.MSET, DOC.UPDATE, DOC.DEL
Use Cases
Database Replication
Audit Logging
Cache Invalidation
Stream Processing
Consumer Group Guarantees
At-Least-Once Delivery
- Events are pending until acknowledged
- Consumers can fail and restart without data loss
- Pending events can be claimed by other consumers
Ordering
- Events are delivered in sequence number order
- Per-key ordering is guaranteed
- Cross-key ordering is eventual within a shard
Failover
- Consumer groups survive server restarts (if persistence enabled)
- Pending entries are preserved
- Idle consumers can be detected via PENDING command
Comparison with Redis Streams
Kora CDC differs from Redis Streams (XREAD, XGROUP) in several ways:- Automatic event capture (no manual XADD needed)
- Ring buffer eviction instead of memory-based trimming
- Simpler command interface (3 commands vs. 15+)
- Per-shard instead of per-stream
- Designed for change data capture specifically