We are thinking about migration to Couchbase. We thought about mongodb to add to redis and elasticsearch but couchbase seems better tool for what we want. Most of the data i know how to migrate and how to model it but… Data modeling choice is not so trivial if we take some things into consideration. So there are 2 obvious ways how to model JSON documents if you have lists but…
What about that kind of use case:
We have a list that we present to our users. Structure of every document in the list is something like this:
String1 : “some text”,
String2: “some text”,
String3: “some more text”,
String4Categories(can be represented as ints too): enumerable(around 10 choices),
All the strings, one int and timestamp do not change at all, but two of INTs change (Incrementing/decrementing) A LOT.
Users are getting 100 results from this list sorted by timestamp, but they can make a new request and sort it ascending/descending by any of the atributes of this documents (string1/timestamp/int2 etc.). Or they can group results by categories so they will only see all the results from category1 or from category1 combined with category2 etc.
Collection of this documents for now is around ~100k, it’s not growing very fast, less than 200 a day.
Structure of list is similar to for example list of products on let’s say ebay. But in this case besides sorting, choosing categories we have couple of write heavy ints and we need to show data almost real time (those ints can be a little out of date).
What is the best way to implement this in couchbase if performance (thgrouthput and latency) is a concern ?