- Amazon DynamoDB has a default limit of 20 global secondary indexes per table, in practice, you can index across far more than 20 data fields
Basic of Dynamodb:
Local Secondary Index vs Global Secondary Index
- https://stackoverflow.com/questions/56265577/dynamodb-local-secondary-index-vs-global-secondary-index
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html ( Dynamodb official difference)
- https://stackoverflow.com/questions/55484683/dynamodb-table-index-design-gloabl-index-or-local/55485322#5548532 (***)
Differences:
- LSIs cannot be modified or deleted without deleting and recreating the whole table. GSIs can be created/removed at any time with no impact to the main table.
- LSIs cause you to have a limit of 10 GB of data per partition key. Without a LSI, there is a limit of 10 GB per partition, but you won’t notice that because DynamoDB can split your data for a single partition key across multiple partitions if necessary.
- When using a LSI, the 400kb item size limit applies to the item plus all of its LSI projections. An item in a GSI is counted separately from the item in the main table.
- Provisioned capacity of GSIs can be scaled independently of the main table, whereas LSIs share the same capacity as the base table.
- Fast retrieval
- Auto scaling to control costs
- Query and scanning allow for different use cases
- Can get very expensive very fast
- Sharding and hot spotting are hidden problems that can cause ALOT of head ache
- Not relational or transactional at all
Single-Table Design for a application:
- https://www.alexdebrie.com/posts/dynamodb-single-table/ (***************)
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-general-nosql-design.html#bp-general-nosql-design-concepts (official doc)
calculate RCU and WCU with the data
https://stackoverflow.com/questions/42494900/how-to-calculate-read-capacity-unit-and-write-capacity-unit-for-dynamodb/42520860 (***********)
No comments:
Post a Comment