Dynamodb handling multiple clients

0

So consider the following scenario. I currently am using a Postgres db for storing data for multiple clients one of which is a discord bot, but was thinking of trying out dynamodb as these crud operations all revolve around key value pairs. Currently there is a primary key for each user associated with the server as well as an optional discord id for discord clients. How would one structure primary keys for a dynamodb table to support crud methods from multiple clients. Should I just create a global secondary index for discord id for discord users so that I can always query for it if the client is using discord?

preguntada hace 7 meses274 visualizaciones
2 Respuestas
1

Hi,

All possible options with multi-tenancy in DynamoDB are extremely well-detailled in this whitepaper: https://docs.aws.amazon.com/pdfs/whitepapers/latest/multi-tenant-saas-storage-strategies/multi-tenant-saas-storage-strategies.pdf#multitenancy-on-dynamodb

You should probably read it in full details to determine which proposed architecture best fits your needs.

Best,

Didier

profile pictureAWS
EXPERTO
respondido hace 7 meses
0

A bit more detail about your schema is required to give an answer with the appropriate information. However, something to consider:

If the client is doing a PutItem call then that call replaces the item in the database. Multiple clients doing that will overwrite each others changes and that is probably undesirable.

One solution is to use UpdateItem and update specific attributes. There is still a risk where clients can overwrite each other's changes but that might not be an issue - depending on your schema.

An alternative is to have each client update different items. That may work for you - but it depends on your schema.

There are probably other ways to design this as well but it's not possible to say given the information available.

profile pictureAWS
EXPERTO
respondido hace 7 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas