Rockset has a managed DynamoDB connector that bulk loads data into a Rockset collection. After the bulk load is complete, Rockset continuously syncs data whenever there is a change in the DynamoDB table through DynamoDB’s Stream API. As soon as there is a change in the rockset_carpurchases table, Rockset reflects that change within seconds. This is because Rockset leverages Change Data Capture (CDC) streams.
Click on the DynamoDB data connector and Start:
Create an integration called DDBCarPurchasesIntegration.
When you create the AWS IAM Policy for DynamoDB, you must replace the S3 bucket name’s AccountID with the value you have.
Overwrite and paste the below in the JSON tab (don’t forget to update the S3 bucket name in the JSON below):
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetShardIterator",
"dynamodb:Scan",
"dynamodb:DescribeStream",
"dynamodb:DescribeExport",
"dynamodb:GetRecords",
"dynamodb:DescribeTable",
"dynamodb:DescribeContinuousBackups",
"dynamodb:ExportTableToPointInTime",
"dynamodb:UpdateTable",
"dynamodb:UpdateContinuousBackups",
"s3:PutObject",
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:dynamodb:*:*:table/rockset_carpurchases",
"arn:aws:dynamodb:*:*:table/rockset_carpurchases/stream/*",
"arn:aws:dynamodb:*:*:table/rockset_carpurchases/export/*",
"arn:aws:s3:::bucketname",
"arn:aws:s3:::bucketname/*"
]
}
]
}
It should look like this:
When you’re done, go ahead and click on Next: Tags
Immediately click on Next: Review.
Give the policy name as RocksetDynamoDBPolicy. Then, click on Create policy:
Refer to the image below:
a)Go ahead and give your collection the name CarPurchases.
b)From there go ahead and put the table name, rockset_carpurchases
c) The region should be us-east-1.
d) You should see a preview of the data on the right.
Your collection should look like this:
Towards the bottom at Configure Ingest, we have an opportunity to do query-based field mappings, also known as QBFMs. This is where we can massage the data as it’s being ingested into Rockset. QBFMs allow you to do SQL-based field mappings. This saves on storage and compute at query time (also known as run time). Click on Configure SQL rollups and/or transformations: