Architecture
Data Model

Data Model

lk-wiz uses a single-table DynamoDB design for its main data, plus a small dedicated table for WebSocket connections. Both are PAY_PER_REQUEST, KMS-encrypted, and have point-in-time recovery (PITR) enabled.

Main table

The main table uses a pk / sk composite key plus two global secondary indexes (GSI1, GSI2) to serve all access patterns. Entities stored in the table include:

EntityNotes
UserIdentity, approval status, platform role.
WorkspaceContainer for all workspace content.
Workspace memberUser ↔ workspace link with role (owner/editor/viewer).
IdeaCaptured idea with status, priority, tags.
PostDraft with lifecycle status and optional schedule.
Post versionImmutable snapshot of post content over time.
PromptReusable generation instruction template.
ExampleReference post used to ground GenAI generation.
Publishing slotRecurring weekly publish time for a workspace.
ActionAction request assigned to a workspace member.
Yjs documentPersisted collaborative editor state for a post.
Quick-capture tokenPer-user token for token-based idea capture.
Workspace settingsTarget audiences and languages for a workspace.

Connections table

A separate connections table tracks active WebSocket connections for real-time collaboration. Each record carries a TTL so that stale connections are automatically purged by DynamoDB without a cleanup job.

Access patterns

The pk/sk layout and the two GSIs are designed around lk-wiz's access patterns — for example, listing all ideas or posts in a workspace, resolving a user's workspace memberships, fetching a post with its versions, and looking up a workspace's publishing slots. Keeping everything in one table avoids cross-table joins and keeps reads to a single query per pattern.