mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 23:00:59 -05:00
* refactor(dynamodb): add a stream reader and key native streams by table ARN DynamoDbStreamReader is the engine-neutral way to read DynamoDB Streams. DynamoDbApiStreamReader implements it over the selected DynamoDbOperations using the Streams wire API. Native streams were keyed by region and table name, so same-named tables in two accounts shared one stream. They are now keyed by table ARN, and ListStreams returns only the caller's account and region. Streams of every account are restored from persisted tables at startup. * refactor(dynamodb): move stream consumers onto the stream reader The Lambda DynamoDB Streams poller reads through DynamoDbStreamReader: each tick renews iterators from committed progress for every readable shard, and reads a child shard only after its parent was read to its end. It discards restart checkpoints only for a process-lifetime engine, and pins LATEST per shard via newestSequenceNumbers, replacing DynamoDbStreamService.latestSequenceNumber. A read fills a batch from as many GetRecords calls as it needs, so a batch is not cut at the 1000 record GetRecords maximum. EventBridge Pipes reads DynamoDB streams the same way, committing a batch only once it is delivered or sent to the DLQ, delivers the AWS stream record shape with eventSourceARN, and honors LATEST. The Redshift zero-ETL consumer reads the same way, keeping per-shard progress in the integration (legacy checkpointSequenceNumber is ignored on load) and committing a batch only after it is written to the landing table. It discards that progress at startup for a process-lifetime engine, and the writer now takes AWS stream records, so Redshift no longer uses DynamoDbStreamService or DynamoDbStreamRecord, whose SHARD_ID is now package-private.