blog-banner

Feature of the week: Core changefeeds in CockroachDB 19.1

Last edited on July 30, 2019

0 minute read

    Our latest

    , core changefeeds, is an exciting new way for event-driven apps to consume data from CockroachDB. With the CHANGEFEED FOR statement, a SQL client can tell the database to monitor a table and tell it when writes take place. CockroachDB will then hold the connection open until the client closes it and stream records to the client for all writes. You can use changefeeds to build event-driven applications, perform data integration, and do all kinds of other tasks that depend on watching the state of a table.

    Here's what a core changefeed looks like in practice:

    In the output, the `table` column is the name of the table being watched, the `key` column contains each record's primary key columns (represented as a JSON array), and the `value` column is a JSON object, with the "after" key containing the state of all of the record's columns after the table is written to. Inserts and updates are represented as shown above; deletes are represented with "null" in the "after" field. Changefeeds continue to function even when online schema changes take place:

    Core changefeeds provide the same ordering and correctness guarantees as our enterprise changefeed functionality, but enterprise changefeeds can write their data to Kafka or cloud storage from multiple nodes at once, instead of delivering their data over a SQL connection.

    Take a look at our change data capture documentation to try out core changefeeds. And follow Cockroach Labs on

    to keep up with all our Features of the Week.

    CRDBFOTW