Jens Alfke
unread,Dec 12, 2017, 2:04:10 PM12/12/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mobile-c...@googlegroups.com
FYI, since it looks like you’re using some kind of relational db modeling tool — document databases aren’t like relational databases, and in particular it’s often a bad idea to fully normalize your data. So I don’t recommend designing your database as though it were relational.
One common design: if you have a one-to-many relationship where the ‘many’ records are small, it often makes sense to store them inline in an array. For example, store phone numbers as an array of strings (or dictionaries containing strings) in the contact/customer document, instead of making a separate document for each phone number.
Also note that in a fully distributed system you don’t have transactions, rather it’s more “eventual consistency”. So there can be moments where one document has been updated but not another that it relates to, making the data inconsistent. You need to be flexible about handling this, or if the data must always be consistent, store it in a single document (since docs are updated atomically.)
—Jens