In DynamoDB single-table design, should the shard lookup be in a separate table?

32 Views Asked by At

I'm trying to design a multi-tenant single-table in Dynamodb. My primary key needs to be the tenantId for all items so that I can enforce tenant isolation. The PK potentially faces hotkey issues due to this design. I have a tenant entity type in the table. Should I keep the sharding lookup values as an attribute of the tenant item or should I create a separate lookup table?

My thinking is that since the shard gathering query would have to be performed separately I won't be benefiting from the single-table design so much and instead looking into the future I can potentially speedup the shard lookups by using DAX.

Does this make sense or am I missing something?

Edit: Added context as to why I'm looking into sharding.

0

There are 0 best solutions below