Reading into Amazon DynamoDB doc I still can't understand what is the best way of using it for the most common task - having several types of documents (for example, 'user', 'event', 'news') all with unique ids. As I understand, since DynamoDB implies restrictions only on document primary key, we can store in it any data having one. Thus the most natural solution looks like:
- partion key 'type' is document type - 'user', 'event' etc
- sort key is uuid
But this contradicts to official doc, according to it the better one is:
- partition key 'id' is just uuid
- sort key is type - 'user', 'event'
But this contradicts with common sense due to key names. Finally, we can just create 3 different DynamoDB instances for users, events and news, all having uuid as partiton key and no sort key. Which solution is the best or common practice of DynamoDB usage?