liveBook · Manning

Stream ID

As explained in ScyllaDB in Action

A stream ID is an identifier for the CDC stream assigned to changes from a partition within a stream generation.

A stream ID identifies the CDC stream assigned to changes from a partition during a stream generation. ScyllaDB maps each partition key to one stream ID; multiple partitions can share it, but a partition maps consistently within that generation. section 12.1.2

Use stream IDs to understand and query CDC data:

  • CDC partitions its log by stream ID and orders changes within each stream, so queries should target one stream ID at a time. section 12.1.2
  • A topology change, such as adding a node, creates a new stream generation with its own set of stream IDs. section 12.1.2
  • A stream ID does not identify one table row: several partition keys may map to the same ID. section 12.1.2

Querying the current CDC streams

A CDC export first reads the greatest timestamp from system_distributed.cdc_generation_timestamps, truncates it to milliseconds, retrieves the stream IDs from cdc_streams_descriptions_v2, and queries the CDC table for each returned ID. This accounts for the current generation and avoids relying on a full-table scan. section 12.1.2 section 12.3

How ScyllaDB in Action covers it

How deep it goes
Explains mapping, sharing, generations, schema placement, and retrieval steps, while only briefly noting shard-level implementation.
Examples
Uses authors CDC rows, shared hexadecimal stream IDs, and system tables listing the current generation and its streams.
What it assumes
Assumes familiarity with ScyllaDB tables and CDC, while establishing how partition keys map to streams from first principles.
What you can do after
Operate/configure CDC exports by discovering the current generation and querying each associated stream ID.
How it connects
Connects CDC with partition keys, stream generations, topology changes, ordering, and CDC tables.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.