DynamoDB Concepts - utkaln/dynamodb-helloworld GitHub Wiki
FAQs
- Can DDB handle relationships ?
- Yes DDB can be designed to handle relationships such as one-to-many and many-to-many
- Can DDB handle data model change ?
- Though it is important to know the usage pattern before designing DDB, migration to new model is possible
- How is DDB advantageous over Mongo DB ?
Attribute | Mongo DB | DDB |
---|---|---|
Data Model | Document Oriented | Wide Column Key-Value |
Ease of Index | Text Indexing, multi-key index for arrays, geospatial indexing for location based queries | Pre-define specific indexes |
Scalability | Better with Mongo Atlas | Better of the shelf, fully managed |
- What are the data types supported in DDB ?
- Three categories:
- Scalar: Number, Sting, Binary, Boolean, Null
- Complex: List, Maps
- Sets: sets (unique values, same data type)
-
What are key differences between Local Secondary and Global Secondary Index ?
Attribute Local Global Partition Key Same as that of primary key Different than that of the primary key Use case Same top level property but different access pattern Complete different access pattern than that of primary Throughput Requirement No additional throughput procurement needed Additional throughput procurement needed Consistency Model Supports Strong and Eventual Consistency Only Eventual Consistency Creation of Index Must be created during Table creation Can be created later -
Why choosing Partition Key is important ?
- Partition key determines how data is sharded. All items having same partition key will end up in the same shard. It is important that if higher performance is required from the query, then having data in the same shard is faster. However, keep in mind the limit of 10GB per shard in mind while designing partition key.
- What are the RCU and WCU limits per partition ?
- RCU: 3000 | WCU: 1000 per second per partition
- Do Throughput (RCU or WCU) dilute with increase in partition ?
- No. It was an older concept, but has been addressed since 2018, that Dynamo DB automatically assigns throughput to the partition that requires the most
- What are the design considerations one should have while considering DDB APIs in the app ?
- 3 Broad Categories:
- Item based actions: Operations on Specific Items such as
GetItem
,PutItem
,UpdateItem
,DeleteItem
. Important Full Primary Key is required, partial match won't work. Item based actions can be further categorized to two sub-categories.- Batch Action: Multiple items updated. A single failure does not impact others
- Transaction Action: Only one item is updated. Single failure would stop further processing
- Queries: Operation on a Item collection based on PK and SK
- Scan: Operation on the whole table
- Item based actions: Operations on Specific Items such as