bootstrap

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL