There exits a data-set as described in the below table. Sr.no is used in the below table only for reference
|sr.no| id | tis |data-type| b.id |idType_2| var_2 |
|-----|----------|-----|---------|----------|--------|--------|
| 1 |abc-def-gi|12345| a-type |1234567890| 843023 | NULL |
|-----|----------|-----|---------|----------|--------|--------|
| 2 |1234567890|12346| b-type | NULL | NULL |40030230|
|-----|----------|-----|---------|----------|--------|--------|
| 3 |abc-def-gj|12347| a-type |1234567890| 843023 | NULL |
Query types
- Input
id
and ifdata-type
isa-type
return fieldstis,b.id,id_type2
referencesr.no=1
- Input
id
and ifdata-type
isb-type
return fieldvar_2
referencesr.no=2
- Input
id_type2
return fieldsid,tis,b.id
ofsr.no=1,3
- Input
data-type
returnid
based ontis between 12345 and 12347
Note
sr.no=1,3
ora-type
of data is inserted 100k a times a day with uniqueid
sr.no=2
orb-type
of data is a fixed set of data.
Is the below key approach efficient for a dataset like this? Is there any other approach that can be followed to store and retrieve data from DynamoDB?
Partition Key = id
to take care of Query 1,2.
GSI1=id_type2 and GSI1SK=id
to take care of Query 3
GSI2=data-type and GSI2SK=tis
to take care of Query 4