What You Will Learn
Intermediate
- What DynamoDB is
- How it differs from RDS (SQL)
- When to use DynamoDB
DynamoDB is a fully managed NoSQL database. No servers to manage, automatically scales, single-digit millisecond latency at any scale.
| Aspect | RDS (SQL) | DynamoDB (NoSQL) |
|---|---|---|
| Schema | Fixed (tables, columns) | Flexible |
| Scaling | Manual (bigger instance) | Automatic |
| Queries | SQL (JOIN, etc.) | Key-value, simple queries |
| Latency | Variable | < 10ms at any scale |
| Free tier | 750 hrs (12 mo) | 25 GB (always free) |
Terminalbash
# Create a table
aws dynamodb create-table \
--table-name Users \
--attribute-definitions AttributeName=userId,AttributeType=S \
--key-schema AttributeName=userId,KeyType=HASH \
--billing-mode PAY_PER_REQUESTPractical Exercise
Go to DynamoDB -> Create table
Name it "Users", partition key "userId" (String)
Use on-demand billing (pay per request)
Add an item: {"userId": "1", "name": "Anita"}
Scan the table:
aws dynamodb scan --table-name UsersKey Takeaways
- DynamoDB = serverless NoSQL database.
- Always free: 25 GB storage forever.
- Automatic scaling, <10ms latency.
- Flexible schema — no fixed columns.
- Best for: key-value lookups, user profiles, session data.
Comments
Comments
Post a Comment