Hello,
I need your help to design a document oriented forum database in Couchbase. This is a mobile application that requires the Document unique Key ID so I am thinking to use a composite Key document ( Text ID, Topic ID, The Category ID) where
1- Topic ID is an UUID id automatically assigned to the topic
2- Category ID: an Id automatically assigned to a category (like Couchbase server in the case of this forum).
Then, I would create;
- A view on Mobile Device ID (which identifies the user id of the forum)
- A view on the username (the username of the forum).
finally my document will look like this JSON;
{
“TextId”:“6a4353-g63773-hjjgede-gh8829”,
“type”: “message”,
“userID”:“gdhetyey637302027302hdihjeihe73832”,
“userName”:“user526262”,
“TopicID”:“90002891”,
“CategID”:“15”,
“text”:“reply1”,
“DateTime”:"“Mar 13, 2015 9:00:20 PM”"
“about”: {
“TextId”: “g25636-g63773-hjjgede-gh8829”,
“type”: “message”,
“userID”:“gt6uI1h7302hdihjeihe73832”,
“userName”:“user101”,
“TopicID”:“90002891”,
“CategID”:“15”,
“text”:“First Message”,
“DateTime”:"“Mar 12, 2015 3:00:01 AM”"
}
}
it is a simple forum on mobile, where I don’t allow people to update their messages after sending it, so my idea is to perform only inserts document (No deletes,No updates) Please let me know your thoughts ?
Thanks
Wissa