How sensedeep/dynamodb-onetable works
Main Components
a) Core Library Components:
• Schema Management System
• Model Layer
• Expression Builder
• Type Management System
• Table Operations Handler
• Metrics Collection System
b) External Integration Points:
• AWS DynamoDB Client Interface (both v2 and v3 SDK support)
• TypeScript Type System Integration
• Migration Tools Integration
Key Architectural Elements
┌─ Application Layer ─────────────────────┐
• User Application Code │
• ┬─────────────────────────┘
• ↓
┌─ OneTable API Layer ───────────────────────────────────────┐
• ┌─────────────┐ ┌──────────┐ ┌────────────────────┐ │
• Table Class │ │ Models │ │ TypeScript Types │ │
• ┬──────┘ └────┬─────┘ └──────────┬─────────┘ │
• ↓ ↓ ↓ │
• ┌─────────────────────────────────────────────────────┐ │
• Schema Management System │ │
• ┬───────────────────────┘ │
• ┬─┴───────────────────────────┘
• ↓
┌─ Core Processing Layer ────────────────────────────────────┐
• ┌─────────────┐ ┌──────────────┐ ┌────────────────────┐ │
• Expression │ │ Type │ │ Validation & │ │
• Builder │ │ Marshalling │ │ Encoding │ │
• ┬──────┘ └──────┬───────┘ └──────────┬─────────┘ │
• ┬──┴────────────────────┘ │
• ┼──────────────────────────────────────┘
• ↓
┌─ Database Layer ──────────────────────────────────────────┐
• ┌─────────────────────────────────────────────────────┐ │
• DynamoDB Client Interface │ │
• ┬───────────────────────────┘ │
• ┬─┴───────────────────────────────┘
• ↓
┌─ AWS DynamoDB ─────────────────────────────────────────────┐
• ┘
Important Relationships
• Bidirectional flow between Schema Management and Model Layer
• Type inference flow from Schema to TypeScript types
• Transaction flow through the various layers
• Validation and encoding pipeline
Implementation Details
• Clear component boundaries
Additional Elements
Small sidebars or callouts showing:
• Supported data types
• Index types (GSI, LSI)
• Key template syntax
• Common use patterns
• Multiple layers
• Export to common formats
• Collaborative editing