DynamoDb Schema Design as an Expert Way
Watch my YouTube video for explanation :
Please look into the class notes here for your references:
DynamoDB Schema Design
**Limit the access pattern
**Throttling meaning the reads are more than defined RCU
**data latency , storage
Use NOSQL WorkBench
Create Directly in DynamoDB
Use PartiQL
[Partition Key] {Primary Key}
[Partition Key,Sort Key] {composite primary key}
Partition Key - Storage Index
Sort Key - Ordering
dept, opening_date
1, 12-03-2022
2, 22-09-2020
2, 21-12-2020
3, 17-06-2021
4, 16-05-2021
Partitions --->partition 1
1, 12-03-2022
3, 17-06-2021
partition 2
2, 22-09-2020
2, 21-12-2020
Case I
when we lookup of a known global unique key
empid, joining _date
1, 16-05-2021
2, 21-12-2020
3, 17-06-2021
use the partition key
Case II
when the key is non unique OR when the range like queries are done based on some other value
dept , opening_date
1, 12-03-2022
2, 22-09-2020
2, 21-12-2020
3, 17-06-2021
4, 16-05-2021
use partition key and sort key
Throttling
** when burst in read operations
** hot key case
** uneven data distribution
** wrong partition key , sort key
Provisioning Resources
Read Capacity Units -3000 [strongly consistent, eventually consistent and transactional]
Write Capacity Units -1000 [standard , transactional]
Strategies to prevent Throttling -
Prefixes/Suffixes,
Composite Partition key,
DynamoDB Accelerator(DAX)
Local Secondary Indexes and Global Secondary Indexes
Important Links:
Adaptive Capacity
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-esign.html#bp-partition-key-partitions-adaptive
Choose the right partition Key
https://aws.amazon.com/blogs/database/choosing-the-right-dynamodb-partition-key/
Fore more Abinitio, AWS and data engineering videos please subscribe , view , like and share my YouTube channel
Click DataPundit
Comments
Post a Comment