Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTables ¶
func CreateTables(ctx context.Context, client *dynamodb.Client, membersTable, claimsTable, subscriptionsTable string) error
CreateTables provisions the cluster members, claims, and subscriptions tables with on-demand billing. Every table hashes on pk: the instance ID for members, and a single composite (namespace + key) for claims and subscriptions so they spread across partitions instead of piling a whole namespace onto one partition key. Subscriptions are additionally range-keyed by sk, the subscriber's instance ID (one row per interested server per topic). It is idempotent and blocks until the tables are ACTIVE.
Only the members table carries a ttl attribute, garbage-collecting dead members' records (safe because every heartbeat refreshes it — a live row can never expire). TTL deletion is lazy and is never relied on for correctness: liveness is always judged by heartbeat-counter observation, and claim/subscription validity by the owner's liveness. Claim rows are deliberately permanent and subscription rows are cleaned up explicitly — see the table overview in store.go. Enable TTL on the members table's ttl attribute in real deployments; DynamoDB Local ignores it, which the tests don't mind.
Types ¶
This section is empty.