Destinations
Amazon Kinesis destination: setup and configuration
Publish change events to your own Amazon Kinesis Data Streams, to one stream for every table or a stream per table, as Debezium JSON in the order each row changed.
Prerequisites
- Kinesis destinations turned on for your account. Contact Artie to enable them.
- A Kinesis data stream for each stream Artie writes to. Artie doesn’t create streams.
- Permission to create an IAM role in the AWS account that owns the streams.
- A source with a dedicated source reader. Kinesis destinations can’t use a shared source reader.
Artie reaches Kinesis over its public regional endpoint. Kinesis destinations don’t support SSH tunnels or PrivateLink.
How Artie writes to Kinesis
Artie’s reader publishes each change straight to your streams. No separate writer runs between your source and your streams, so the settings Artie’s writer applies to other destinations don’t apply. See Limitations.
You choose one of two stream layouts:
- One stream for every table sends every table’s changes to one stream you name.
- A stream per table sends each table to its own stream, named
<stream prefix>.<table identifier>.
With a stream per table, the table identifier depends on the source, the same as a Kafka destination’s topic names:
| Source | Stream name |
|---|---|
| PostgreSQL | <prefix>.<schema>.<table> |
| MySQL | <prefix>.<database>.<table> |
| Microsoft SQL Server | <prefix>.<database>.<schema>.<table> |
Kinesis stream names are at most 128 characters of letters, digits, ., _ and -. A table whose stream name doesn’t fit fails its first write.
Set up Kinesis as a destination
Create the streams
In the Kinesis console, create each stream Artie writes to, in the Region you’ll enter in Artie. With a stream per table, create one stream for each table in the pipeline.
On-demand capacity mode is the safer choice. Each provisioned shard takes up to 1 MB or 1,000 records per second, and writes over that are throttled. See Kinesis quotas and limits.
Create a role for Artie
In the AWS account that owns the streams, create an IAM role. Artie assumes this role to write to your streams. Attach this permission policy:
JSON{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "kinesis:PutRecords", "kinesis:DescribeStreamSummary" ], "Resource": "arn:aws:kinesis:us-east-1:123456789012:stream/artie*" }, { "Effect": "Allow", "Action": "kinesis:ListStreams", "Resource": "*" } ] }Replace the Region
us-east-1, the account ID123456789012and the stream name patternartie*with your own.kinesis:ListStreamsis only needed with a stream per table, where Artie uses it to verify the role.If your streams use server-side encryption with a customer managed KMS key, also allow
kms:GenerateDataKeyon that key. See Permissions to use user-generated KMS keys.Then set the role’s trust policy to let Artie’s AWS principal,
arn:aws:iam::788826912768:user/ci, assume it with an external ID you choose:JSON{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::788826912768:user/ci"}, "Action": "sts:AssumeRole", "Condition": {"StringEquals": {"sts:ExternalId": "EXTERNAL_ID"}} } ] }Replace
EXTERNAL_IDwith your external ID. Choose an external ID that is hard to guess. It’s 2 to 1,224 characters of letters, digits and+=,.@:/-_. On a data plane you run yourself, trust the IAM identity your data plane runs as.Connect Kinesis in the pipeline setup
When you create a pipeline, the setup reaches Choose your destination after you choose tables.
- On Choose your destination, select Kinesis, then select Continue.
- On Connect Kinesis, fill in the fields from the table in this step.
- Select Verify destination. Artie shows “Destination verified”.
- Select Continue.
Kinesis doesn’t appear on Choose your destination when Kinesis destinations are off for your account or the source uses a shared source reader.
The Connect Kinesis step has these fields:
Field What to enter AWS region Required. The streams’ Region, for example us-east-1. Pick one from the list or type any AWS Region code.AWS role ARN Required. The role from Create a role for Artie, for example arn:aws:iam::123456789012:role/artie-kinesis.External ID Required. The sts:ExternalIdvalue in the role’s trust policy.Streams One stream for every table or A stream per table. Stream name Required for one stream for every table. 1 to 128 letters, digits, .,_and-.Stream prefix Required for a stream per table. 1 to 126 letters, digits, .,_and-.When Artie verifies the destination, it assumes your role. With one stream for every table, it then checks that the stream exists and is
ACTIVEorUPDATING. With a stream per table, it checks that the role can list streams. Artie writes nothing while verifying, so a missingkinesis:PutRecordspermission shows up on the first write.To change these fields on an existing pipeline, select Edit pipeline, then open the Destination: Kinesis tab.
Deploy the pipeline
On Review and deploy, select Validate and deploy. Artie publishes each table’s existing rows to its stream as backfill records, and publishes changes as they happen.
With one stream for every table, the pipeline fails at startup if the stream doesn’t exist. With a stream per table, a missing stream fails its table’s first write.
Advanced
These sections describe the records Artie publishes and how it handles ordering, failed writes, large records, backfills and billing.
Record format
Each record is one change to one row. Kinesis records have no key or headers, so the record’s data is a JSON object with two fields:
{"key": KEY, "value": VALUE}KEY and VALUE are the message key and value a Kafka destination publishes for the same change. The key holds the row’s primary key. The value is Debezium-style JSON with a schema and a payload.
Read the payload fields like this:
opiscfor inserts,ufor updates,dfor deletes, andrfor rows from a backfill.- For a delete,
afterisnullandbeforeholds the deleted row. source.ts_msis when the change happened in the source, in milliseconds since the Unix epoch.
The partition key is a SHA-256 hash, in hex, of the table name and the row’s primary key. Every change to a row goes to the same shard.
Ordering and delivery
Artie sends each row’s changes in the order they happened. It sends one PutRecords request at a time, and a request never holds two changes to the same row.
Delivery is at least once. Make your consumers idempotent, for example by upserting on the record’s key.
If some records in a request fail, Artie sends only those records again. It retries throttling and other errors that can pass for up to 2 minutes per request. It waits up to 5 seconds between attempts.
Artie fails at once on errors a retry can’t fix, such as AccessDeniedException, ResourceNotFoundException or a KMS key error. Artie only advances its position in your source after Kinesis accepts the records, so a failed write doesn’t lose changes.
After an error or a restart, Artie publishes again from its last committed position, so consumers can see some records twice. When a request times out on Artie’s side but Kinesis applied it, a row’s older record can arrive after a newer one.
Record size
Artie reads each stream’s maximum record size when it first writes to the stream. The default is 1 MiB, and a stream’s limit goes up to 10 MiB. The limit counts the record’s data and partition key.
Artie skips a larger record and keeps going. It sends a row skipped webhook event with the table and primary key.
Backfills
Kinesis streams can’t be emptied before a backfill. When you backfill or restart a backfill, Artie publishes every row again with op set to r. The new records land after the records already in the stream.
The backfill dialog says “Nothing is deleted first. The backfill is published on top of the existing messages.” Consumers see each backfilled row again, so handle r like an upsert.
Monitoring and billing
Artie counts the rows it publishes. Pipeline monitors and charts for a Kinesis destination use those counts and the time from a change in your source to its publish.
Billing counts published inserts, updates, and deletes. Rows from backfills (op r) aren’t billed.
Limitations
Kinesis destinations differ from other destinations in these ways:
| Limitation | Detail |
|---|---|
| Writer settings don’t apply | The Dashboard hides history mode, column hashing, column encryption, Soft-delete rows, Drop deleted columns, Cast all columns to string and flush rules. It hides Skip deletes unless a table already has it on. |
| Shared source readers | Not supported. The source reader must be dedicated to the pipeline. |
| Stream creation | Artie doesn’t create streams. Create each one before the pipeline writes to it. |
| Table-level monitors | Saving one fails with Table monitors aren't supported for Kinesis destinations. Monitor the whole pipeline instead. |
| Emptying streams before a backfill | Streams can’t be emptied, dropped, or swapped. See Backfills. |
| Records over the stream’s limit | Skipped. See Record size. |
| Compression | Message compression has no effect. Columns set to be compressed are sent uncompressed. |
| Schema change records | Not published. Artie publishes row changes only. A column’s type and presence show up in each record’s schema. |
| SSH tunnels and PrivateLink | Not supported. Saving a Kinesis connector with PrivateLink fails with PrivateLink isn't supported for Kinesis. |
Frequently asked questions
These answers cover duplicate records, missing streams and deletes.
Why do my consumers see the same record twice?
A write was retried, the pipeline restarted, or a table was backfilled again. Delivery is at least once, so make consumers idempotent. See Ordering and delivery.
Why is the pipeline failing with a stream that doesn’t exist?
The error reads kinesis stream "<name>" doesn't exist. In the Kinesis console, create the stream with that exact name in the pipeline’s Region. With a stream per table, check the table’s name against the stream names.
How do I tell a delete from an update?
Read op in the record’s value. It’s d for deletes, where before holds the deleted row, and u for updates.
Was this page helpful?
- Need help? Message us on Slack or email [email protected].
- Want a walkthrough? Book a demo.
- LLM? Read llms.txt.