May 26, 2024


From right here, the information might be consumed utilizing any of the various integration choices Pub/Sub affords.

Creating an occasion streaming pipeline to Apache Kafka

In lots of event-driven architectures, Apache Kafka is the central occasion retailer and stream-processing platform. With our newly added Debezium-based Kafka connector, you’ll be able to construct occasion streaming pipelines with Spanner change streams and Apache Kafka. 

The Kafka connector produces a change occasion for each insert, replace, and delete. It sends teams change occasion information for every Spanner desk right into a separate Kafka matter. Consumer functions then learn the Kafka matters that correspond to the database tables of curiosity, and might react to each row-level occasion they obtain from these matters.

The connector has built-in fault-tolerance. Because the connector reads adjustments and produces occasions, it information the final commit timestamp processed for every change stream partition. If the connector stops for any motive (e.g. communication failures, community issues, or crashes), it merely continues streaming information the place it final left off as soon as it restarts.

To be taught extra in regards to the change streams connector for Kafka, see Construct change streams connections to Kafka. You’ll be able to obtain the change streams connector for Kafka from Debezium.

Positive-tuning your occasion messages with new worth seize sorts

Within the instance above, the stream order_items_changed that makes use of the default worth seize kind OLD_AND_NEW_VALUES. Which means that the Change streams change document consists of each the previous and new values of a row’s modified columns, together with the first key of the row. Generally, nonetheless,  you don’t have to seize all that change information. Because of this, we added two new worth seize sorts: NEW_VALUES and NEW_ROW, described beneath:


Source link