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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ