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?

질문됨 7달 전278회 조회
2개 답변
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
전문가
답변함 7달 전
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
전문가
답변함 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠