Wich schema document to use?

Hello,
I have an issue about wich solution is the best to work with,
i have informations about restaurants and each restaurant has it’s clients and ordrers and etc…
the solutions are as follows:
the first solution it’s that i create for each restaurant a document and each document has all the informations (clients,…) knowing that we have a lot of customers.
the second solution it’s that i create documents for restaurants, clients, orders etc…, and use the foreign keys to link each document

knowing that it needs to be synchronized and have to work in real time.

thanks in advance.

FYI
https://developer.couchbase.com/documentation/server/current/data-modeling/concepts-data-modeling-intro.html

Another relevant blog post from @matthew.groves https://blog.couchbase.com/moving-from-sql-server-to-couchbase-part-1-data-modeling/

1 Like