AWS DynamoDB
Amazon DynamoDB is a fully managed NoSQL database service by AWS designed for high performance at any scale. Unlike relational databases that use SQL an...
What is Amazon DynamoDB, and how does it differ from traditional relational databases?
Amazon DynamoDB is a fully managed NoSQL database service by AWS designed for high performance at any scale. Unlike relational databases that use SQL and fixed schemas, DynamoDB offers a flexible schema , enabling rapid development and horizontal scalability without managing infrastructure.
Could you explain how DynamoDB tables look (tables, items, and attributes)?
DynamoDB has a simple, flexible structure: Table : Top level container (e.g., Users ) Item : Similar to a row, but schema less — each item can have different attributes Attribute : Data fields like UserID , Name , or Email Unlike relational databases, not all items need the same attributes, making DynamoDB schema less .
What is a sort key, and how does it enhance data retrieval in DynamoDB?
A sort key , combined with a partition key , forms a composite primary key that allows multiple items with the same partition key but different sort key values. This enables efficient range queries and sorted data retrieval within a partition.
Describe the two types of secondary indexes in DynamoDB.
DynamoDB supports two types of secondary indexes : Global Secondary Index (GSI) : Uses a partition key and sort key that can differ from the base table, allowing queries on non primary key attributes across all partitions Local Secondary Index (LSI) : Uses the same partition key as the base table but a different sort key, enabling efficient queries within a partition
How does DynamoDB handle data consistency, and what options are available?
DynamoDB offers two consistency models : Eventually consistent reads : Lowest latency but may not immediately reflect the most recent write Strongly consistent reads : Returns the most up to date data with slightly higher latency
What are the advantages and disadvantages of using DynamoDB?
Advantages: Fully managed — no server, scaling, or backup management Single digit millisecond latency at any scale Schema less design with flexible attributes per item High availability via multi AZ replication Built in Global Tables , TTL , and Streams Disadvantages: No support for complex joins or aggregations Tables must be designed around known access patterns Poor partition key design can lead to hot partitions and higher costs Transactions are supported but less flexible than in relational
What is DynamoDB Accelerator (DAX), and when would you use it?
DAX is an in memory caching service that provides microsecond response times for DynamoDB reads. It is ideal for read heavy or latency sensitive applications where caching frequently accessed data significantly reduces load on the base table.
How does DynamoDB handle scaling for read and write operations?
DynamoDB supports two capacity modes: Provisioned capacity mode : You specify RCUs and WCUs manually (with optional auto scaling) On demand capacity mode : Automatically adjusts to traffic without manual intervention, charging per request