0

I'm using dynamodb and I'm trying to set a different unique value ( id ) for each item I create in a table.

While looking for a solution I find the "atomic counter" solution and in the docs of aws there is an example here ( Increment an Atomic Counter ), but what id does is just to update items and not adding the id when the item is created.

How can I do that?

Gianmarco
  • 792
  • 2
  • 14
  • 38
  • 1
    To directly address what you're asking: https://stackoverflow.com/questions/11721308/how-to-make-a-uuid-in-dynamodb From a data architecture side I would consider trying to use meaningful primary keys when using DynamoDB, but also generating UUIDs for each entry can work (they won't be sequential- which is intentional since it keeps DynamoDB scalable) – davidgamero Jul 09 '20 at 20:43
  • 1
    Yeah actually the easiest solution was using an uuid, so I don't have to do tricky stuff – Gianmarco Jul 09 '20 at 20:58
  • I'm glad you got it to work! – davidgamero Jul 09 '20 at 21:15

0 Answers0