- When should I use DynamoDB vs PostgreSQL?
- DynamoDB excels at high-throughput key-value and document access at any scale with predictable single-digit millisecond latency. PostgreSQL is better when you need complex queries, joins, ad-hoc analysis, or ACID transactions across multiple entities. DynamoDB requires knowing all access patterns upfront.
- What is a hot partition in DynamoDB?
- A hot partition occurs when too many requests target the same partition key, exceeding the per-partition limits (3,000 RCUs, 1,000 WCUs). Common causes: sequential keys (dates, incremental IDs), celebrity items. Solutions: add a random suffix (sharding), use write sharding patterns.
- What is the difference between Scan and Query in DynamoDB?
- Query reads items with a specific partition key (optionally filtering by sort key) — efficient and targeted. Scan reads every item in the table (or index) and optionally filters — expensive and should be avoided in production for large tables.