dynamodb

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 10 Imported by: 0

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.

func NewInDynamoDB

func NewInDynamoDB(client *dynamodb.Client, membersTable, claimsTable, subscriptionsTable string) cluster.Store

NewInDynamoDB returns a cluster.Store backed by the given DynamoDB tables. Use CreateTables to provision them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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