4

I've just started on Amazon SimpleDB (first experience with noSQL), and while setting my first User domain, and adding the first item (with attributes id and name), i wondered what should the item name be?

  • Like RDBMS ids: "1", "2", "3" (so i should keep a count somewhere)
  • Uuids
  • More readable: "user_1", "user_2"

Will I be querying mostly by the item name? in this case is the item name equivalent to the id, therefore I don't need the id attribute?

H-H
  • 4,431
  • 6
  • 33
  • 41

1 Answers1

2

Amazon SimpleDB simply requires a unique identifier for each row in your database. Item Name should be unique like your pk in your traditional database. When you query any data in Amazon SimplDB, you will get the list of items as a hits.

Item Name is not an attribute but if you are planning to add any new domain/table into Amazon SimpleDB and your any attribute will contain any unique data then you can replace your attribute with item name.

what should the item name be?

It's up to you- what you would really keep as an item name. You can keep among all three that you have suggested but It must be unique data like pk in your traditional database.

Will I be querying mostly by the item name? in this case is the item name equivalent to the id, therefore I don't need the id attribute?

Yes. You can query your data using item name like -

select * from domain where itemName() = '1'
Ashish Pancholi
  • 4,569
  • 13
  • 50
  • 88