Best way to store a list of numbers where individual numbers can be deleted

dba.stackexchange https://dba.stackexchange.com/questions/134436

  •  01-10-2020
  •  | 
  •  

I want to store a list of 50 or less nine digit numbers for each primary key in a DynamoDB. Usually I would be using a get request to retrieve the list for a specific primary key. Sometimes I would need to add or delete a number from the list. Would it be better to replace the whole list when changes are made or is there a way to structure the data so that individual numbers can be added or deleted. If that is possible, would it be a less efficient way of doing things even though the individual changes would be easier?

有帮助吗?

解决方案

look up put with conditional expression attribute_not_exists so you will only put the item if it does not exist. delete single item only by parturition key and range key, not all of them. also the primary key combination must be unique anyways so you can't have duplicates.

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top