#🧱 Building Block: Amazon DynamoDB
#Overview
DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability.
#Key Concepts
- Key-Value & Document Store: Supports flexible schemas.
- Partition Key: Used to distribute data across multiple partitions for scalability.
- Sort Key: Used to group data within a partition and enable efficient range queries.
- WCU/RCU: Write/Read Capacity Units define the throughput.
#Features
- TTL: Automatically delete items after a certain time.
- Streams: Capture every change to items in a table.
- DAX: In-memory cache for DynamoDB.
#When to Use
- High Write Throughput: Like inventory tracking during a flash sale.
- Serverless Apps: No server management needed.
- Session Stores: Highly available and scalable.
#Trade-offs
- Pros: Zero management, predictable performance, strong integration with AWS.
- Cons: Limited query capabilities compared to SQL, cost can be high if not optimized.