Skip to main content
DynamoDB provides Change Data Capture (CDC) capabilities through DynamoDB Streams, which capture data modifications in DynamoDB tables. The generated CDC data is written to streaming systems like Kafka and made available in real-time for downstream applications. Native support for the DynamoDB data format in Pinot allows users to consume CDC data in real-time from DynamoDB tables without complex transformations. As long as the data is available in any of Pinot’s supported streaming connectors, it can be ingested into a Pinot table.

DynamoDB Message Decoder Configurations

To configure a Pinot table to use a DynamoDB formatted streaming source, Pinot provides a decoder - ai.startree.pinot.plugin.inputformat.dynamodb.DynamoDbMessageDecoder. The properties of this decoder are listed below:

Configuration Example

When ingesting a DynamoDB formatted payload from a stream, the decoder used for the stream must be ai.startree.pinot.plugin.inputformat.dynamodb.DynamoDbMessageDecoder. The following is an example stream config where the Pinot table is consuming from a JSON-encoded Kafka topic containing DynamoDB CDC payload:
In the above sample, the Kafka consumer factory used is org.apache.pinot.plugin.stream.kafka20.KafkaConsumerFactory and the decoder associated with this stream is ai.startree.pinot.plugin.inputformat.dynamodb.DynamoDbMessageDecoder. The configuration uses several key components:
  • The primary decoder ai.startree.pinot.plugin.inputformat.dynamodb.DynamoDbMessageDecoder handles the DynamoDB-specific message format
  • The dynamodb.timeColumnName is populated with the ApproximateCreationDateTime from the DynamoDB JSON record
  • The dynamodb.deleteColumnName is set to true when REMOVE records are received from DynamoDB
  • The dynamodb.envelope.decoder.class.name is set to org.apache.pinot.plugin.inputformat.json.JSONMessageDecoder since the underlying DynamoDB messages are in JSON format

Simplified Configuration

The DynamoDB Message Decoder significantly simplifies the configuration needed for ingesting DynamoDB CDC data. Without this decoder, you would need to specify multiple JSON path transformations for each column. Here’s a comparison:

Without DynamoDB Decoder

With DynamoDB Decoder

The decoder automatically handles the complex DynamoDB JSON structure, including the type indicators (S, N, B) and nested structure, making it much easier to ingest DynamoDB CDC data into Pinot.