key value store - DynamoDB Schema Design - Order Model -


i modeling simple application use dynamodb storage. need store order ecommerce website. possible query using order_id , user email.

looking @ dynamodb documentation, think best approach user order_id (most of queries made on index) primary key (partition key).

and email? secondary index, bit lost. best approach?

it looks global secondary index on email attribute solve problem:

  • when need lookup order_id, use getitem operation , specify order_id primary key

  • when need lookup email, use query api on gsi , specify email partition key.

gsi have independent read capacity units - since said use order_id of time, provision more rcu main table gsi.

reference:


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -