AWS DynamoDB Basics
What is DynamoDB? Fully managed NoSQL database (key-value and document). Serverless - no instances to manage. Key Terms Term What it is Table Collection of items (like a table in SQL, but schema-less) Item Single record (like a row in SQL) Attribute Field within an item (each item can have different attributes) Partition Key (PK) Primary identifier - DynamoDB uses this to distribute data Sort Key (SK) Optional secondary identifier - enables range queries within a partition Primary Key Either PK alone, or PK + SK combined ┌─────────────────────────────────────────────────────────────────┐ │ DynamoDB Table: Orders │ │ │ │ Primary Key: customer_id (PK) + order_date (SK) │ │ │ │ ┌─────────────┬─────────────┬──────────┬───────────┐ │ │ │ customer_id │ order_date │ total │ items │ │ │ │ (PK) │ (SK) │ │ │ │ │ ├─────────────┼─────────────┼──────────┼───────────┤ │ │ │ user123 │ 2026-01-01 │ 150.00 │ [...] │ │ │ │ user123 │ 2026-01-02 │ 75.50 │ [...] │ │ │ │ user456 │ 2026-01-01 │ 200.00 │ [...] │ │ │ └─────────────┴─────────────┴──────────┴───────────┘ │ │ │ │ Query: Get all orders for user123 → returns 2 items │ │ Query: Get user123's orders after 2026-01-01 → returns 1 item │ └─────────────────────────────────────────────────────────────────┘ RDS/Aurora vs DynamoDB Aspect RDS/Aurora DynamoDB Type Relational (SQL) NoSQL (key-value) Schema Fixed (define columns upfront) Flexible (each item can differ) Scaling Vertical (bigger instance) Horizontal (automatic partitioning) Queries Any SQL query (JOINs, etc.) Limited (by key only, no JOINs) Transactions Full ACID Limited ACID (up to 100 items) Management You manage instance size Fully serverless Pricing Per instance hour Per request + storage What “Manage Instance Size” Means (RDS/Aurora) DB instance (EC2) size - the compute. You choose db.r5.large, db.r5.2xlarge, etc. ...
