Documentation
¶
Overview ¶
Bootstrap binary for the mongo-cdc-orderstats example.
Scans a Mongo `orders` collection, captures a Change Stream resume token at the start, applies every document through the per-customer Sum monoid into DynamoDB, and prints the captured token to stdout when done. The deployment system hands that token to the live worker's StartAfter so the first CDC change observed by the live consumer is the first change since bootstrap began — no gaps, no duplicates beyond the at-least-once dedup window.
In production this runs as a one-shot ECS Fargate task. Locally:
docker compose up -d mongo dynamodb-local ./scripts/init-mongo-replset.sh # one-time, idempotent make seed-ddb DDB_TABLE=order_totals go run ./examples/mongo-cdc-orderstats/cmd/bootstrap
Click to show internal directories.
Click to hide internal directories.