Real-time change data capture for accelerated datasets
Change data capture (CDC) in Spice reads inserts, updates, and deletes from a source transaction log or change stream and applies them to a local accelerated dataset. Applications query a local copy that follows the source in near real time. PostgreSQL, MySQL, DynamoDB, and MongoDB need no Kafka, Debezium, or full-table refreshes.

Keep accelerated datasets current without full refreshes
CDC transfers only the rows that changed, so accelerated datasets stay synchronized with operational databases while queries run against the local copy.
100x
up to 100x faster queries
80%
up to 80% cost savings on data lakehouse spend
2x
increase in data reliability for critical workloads
Real-time dataset updates
Stream changes from source databases into Spice as they commit. Only changed rows cross the network, and Spice applies them to the Spice Cayenne acceleration.
View the docs

Optimized for acceleration
Combine CDC with Spice Cayenne in file mode to query current data from local disk. After a restart, Spice resumes from its saved source position, as long as the source still keeps that position.
View the docs

Built for event-driven workloads
Spice CDC keeps data current for event-driven workloads such as fraud detection, personalization, and IoT, where applications and AI agents act on the latest state of the source.
View the docs

Integrations across your data and observability stack
CDC is one refresh mode among the prebuilt connectors for databases, warehouses, and object stores, from Databricks and S3 to MySQL and PostgreSQL. Datasets without CDC refresh on an interval or stay federated to the source.
Do more with your data
Run data-intensive workloads on a high-performance data runtime trusted by teams building real-time systems at scale.

“Spice opened the door to take these critical control-plane datasets and move them next to our services in the runtime path.”
Peter Janovsky
Software Architect, Twilio

100x
Faster queries
“It just spins up and works, which is really nice. The responsiveness is amazing, which is a huge gain for the customer.”
Darin Douglass
Principal Software Engineer, Barracuda
Learn how Barracuda gained 100x faster query responses and reduced costs 50% with Spice

“What I like the most about Spice is that it's very easy to collect data from different data sources, and I'm able to interact with this data and do everything in one place.”
Dustin Warner
Director of Software Engineering, NRC Health
FAQs
Answers to common questions about change data capture in Spice
With a native CDC connector and a file-mode Spice Cayenne acceleration, Spice resumes from its saved source position. PostgreSQL resumes from its replication slot, MySQL from a binlog position or GTID set, MongoDB from a resume token, and DynamoDB from a shard checkpoint. If the source no longer keeps that position, Spice stops with an error or takes a new snapshot, depending on the connector and its settings. A cdc: push-ingest dataset keeps no source position, so the Debezium producer controls replay.
By default, the apply loop does not wait to fill a batch, because the cdc_max_coalesce_age_ms linger window is 0. The total delay still depends on the source, the network, write volume, and runtime load. Spice does not guarantee a fixed latency. A PostgreSQL, MySQL, or DynamoDB dataset reports Ready after its replication lag falls below 2 seconds, by default.
Scrape the dataset_acceleration_cdc_replication_lag_ms gauge from the Spice metrics endpoint. It records the time between a source commit and the moment Spice applied that change batch. The gauge updates only when Spice applies a batch, so a stalled stream keeps its last value. To find a stall, compare dataset_acceleration_cdc_applied_commit_unix_time_ms with the current time.
Yes. The native CDC connectors and Debezium support ship in the default build of the Spice runtime, which uses the Apache 2.0 license. The same Spicepod runs on a laptop, in a container, or on Kubernetes. Spice Cloud and Enterprise add managed hosting and support.
Spice change data capture reads row-level changes from the source transaction log or change stream. It applies each change to a local accelerated dataset. A native CDC dataset (PostgreSQL, MySQL, DynamoDB, or MongoDB) runs in three stages:
- Snapshot: by default, when no saved position exists, Spice loads the existing rows into the acceleration. An in-memory acceleration does this on every start. The PostgreSQL, MySQL, and DynamoDB
*_replication_initial_snapshotsettings can turn the snapshot off or force it on every start. - Stream: Spice reads new inserts, updates, and deletes from the source log. Examples are the PostgreSQL write-ahead log, the MySQL binlog, DynamoDB Streams, and MongoDB change streams.
- Apply: an apply loop combines buffered change events into batched writes. A higher
cdc_max_coalesce_age_msvalue trades a short delay for larger writes.
To turn on native CDC, set refresh_mode: changes on an accelerated connector dataset. The following Spicepod keeps a PostgreSQL table current in a file-mode Spice Cayenne acceleration:
datasets:
- from: postgres:public.orders
name: orders
params:
pg_host: db.example.com
pg_db: production
pg_user: ${secrets:PG_USER}
pg_pass: ${secrets:PG_PASS}
pg_sslmode: verify-full
acceleration:
enabled: true
engine: cayenne
mode: file
refresh_mode: changes
primary_key: order_idApplications query the dataset through the same SQL endpoint as any other table, and Spice reads from the local copy. With Debezium, Debezium captures the changes and Spice applies them. The change data capture guide compares log-based, trigger-based, and polling CDC.
Spice reads changes from PostgreSQL, MySQL, DynamoDB, and MongoDB directly, with no Kafka or Debezium. Other databases send Debezium change events, over HTTP or through Kafka:
| Source | Change mechanism | Source requirement | Kafka required |
|---|---|---|---|
| PostgreSQL | Logical replication (pgoutput) | wal_level=logical | No |
| MySQL | Binlog replication, as a replica | log_bin=ON, binlog_format=ROW, binlog_row_image=FULL, empty binlog_row_value_options | No |
| DynamoDB | DynamoDB Streams | Streams with the NEW_AND_OLD_IMAGES view type, and IAM read access to the table and stream | No |
| MongoDB | Change streams | Replica set or sharded cluster | No |
| Any Debezium source, such as SQL Server, Oracle, or Db2 | Debezium push ingest over HTTP | Debezium source plugin, plus a cdc: dataset with declared columns and a primary key | No |
| Any Debezium source | Debezium change events read from Kafka | Existing Debezium and Kafka pipeline | Yes |
Debezium push ingest posts change events to /v1/datasets/<name>/cdc on the Spice runtime. Plain Kafka topics use refresh_mode: append instead. Append mode adds each message as a row and does not apply deletes.
The refresh mode sets how an accelerated dataset follows its source. CDC is the only mode that applies updates and deletes without reading the table again:
| Refresh mode | What each refresh does | Freshness | Best fit |
|---|---|---|---|
full | Reads and replaces the whole table on an interval | Trails by the refresh interval | Small tables, or sources without a change log |
append | Adds new rows or messages. A primary key with upsert can replace rows, but source deletes are not applied | Check interval, or streaming for Kafka | Event, log, and Kafka tables that only grow |
changes | Applies inserts, updates, and deletes from the source log or change stream | Near real time | Operational tables that change in place |
A full refresh of a large table scans the source on every interval and adds read load to the production database. CDC sends only the changed rows. The DynamoDB Streams case study shows configuration changes reaching thousands of nodes in under a second.
Tables that change often get CDC, and the rest stay federated or refresh on an interval in the same query. See SQL federation and acceleration for the federated side.
CDC trades some source setup for freshness. Plan for these requirements before you turn it on:
- Change privileges: a PostgreSQL user needs the
REPLICATIONattribute andSELECTon each table. A MySQL user needsREPLICATION SLAVE,REPLICATION CLIENT, andSELECT. A MongoDB user needs thechangeStreamprivilege on the collection. - DynamoDB access: the IAM role needs
dynamodb:DescribeTableanddynamodb:Scanon the table. It also needsdynamodb:DescribeStream,dynamodb:GetShardIterator, anddynamodb:GetRecordson the stream. - Row identity: Spice applies updates and deletes by primary key. Set
acceleration.primary_keyon every CDC dataset. For MongoDB, setprimary_key: _id. - Tables without a key: for a PostgreSQL table without a primary key, also set
REPLICA IDENTITY FULL. Every change event then carries the key columns. - Replication slots: each PostgreSQL dataset gets its own slot by default. Datasets that name the same
pg_replication_slotshare one slot. Setmax_replication_slotsandmax_wal_sendershigh enough for every slot and replication connection. An unused slot keeps WAL on the source until you drop it. - Initial load time: the first snapshot makes startup slower than for a dataset without CDC.
- Encrypted transport: set
pg_sslmodetorequire,verify-ca, orverify-fullso the replication stream uses TLS.
The same mechanism keeps the analytics replica and agent data serving datasets current. To run CDC on a managed runtime, compare Spice Cloud plans and pricing.
See Spice in action
Walk through your use case with an engineer and see how Spice handles federation, acceleration, and AI integration for production workloads.
Talk to an engineer (opens in a new tab)
