A DynamoDB-backed ConnectionStore for API Gateway WebSocket presence.
API Gateway invokes a fresh Lambda per event, so presence cannot live in memory: this store keeps
connections and their channel memberships in a single table, shared across invocations. Items use
a pk/sk layout: a connection meta record (CONN#<id> / META) and two-way membership records
(CHAN#<channel> / CONN#<id> and CONN#<id> / CHAN#<channel>) so both "who is on a channel"
and "clean up a connection" are single queries. @aws-sdk/lib-dynamodb is imported lazily.
A DynamoDB-backed ConnectionStore for API Gateway WebSocket presence.
API Gateway invokes a fresh Lambda per event, so presence cannot live in memory: this store keeps connections and their channel memberships in a single table, shared across invocations. Items use a
pk/sklayout: a connection meta record (CONN#<id>/META) and two-way membership records (CHAN#<channel>/CONN#<id>andCONN#<id>/CHAN#<channel>) so both "who is on a channel" and "clean up a connection" are single queries.@aws-sdk/lib-dynamodbis imported lazily.