Json doc for multiple user records in a series of documents linked to each other?


Any interesting thoughts on how to design document/model with Couchbase where each doc can have more series of document . Essentially emulating multiple user records but user records can go to 1000’s of rows in a traditional db, but modeling that in CB is tricky when it comes to efficiency.

One simple option is

  • json doc can have n user records in a array inside Couchbase document
  • At the end of the json doc, there will be key pointer to the next json document in the series.

This way you can go any number of records for users as long as we maintain the link forward and backward in each document. but this approach has complexity when some of the records get deleted in the document , then you are rebalancing rows .

Any ideas ?

Off course there is an option to have one json doc per user record, but records are so small , it probably an over kill to create a json doc for that itself.