0

So simpledb has a kind of spreadsheet data model.

I have an app that simply needs to store keys against values. Except that a single key can have multiple values.

There will be multiple clients. Each client has an id with it's own set of keys. I'd like to stick with a single domain if I can at this stage.

How can I map this onto simpleDB?

I was thinking domain = mydomain item = clientid attribute.n.name = key_1 ... key_n attribute.n.value = val1 ... valn

That would satisfy the ability to store multiple values for the same key. But then I found that I need to either get ALL attributes in my select or know example how many attributes I have. I will not know this up front. Also I allow deleting a specific value from a key (or attribute). I will have to search for it first. It seems that in the select there is no attributeName() function, just the itemName() function.

Would it perhaps be better to make the item name a combination of id + key + _n ? e.g. if the id is 'myid' and the key is 'boots' then the item name would be 'myidboots_1'

And then have a single attribute per item called say 'keyval'.

and I can do a select 'keyval' where itemName like 'myidboots_%' ?

Still kindof cumbersome compared to a normal sql database.

Maybe I should try encoding the values like a comma separated list? Except that it's probably more cumbersome and also I've read that there is a 1000 character limit.

Any other suggestions?

hookenz
  • 36,432
  • 45
  • 177
  • 286

1 Answers1

0

I'm not sure I totally follow your question, but I think it might be helpful to point out that SimpleDB lets you do classic SQL style queries like:

select * from foo where bar = '1'

This will return all the attributes/values for the resulting records.

Scrappydog
  • 2,864
  • 1
  • 21
  • 23