Firebase One-to-N

Have been using so much Firebase and tried different ways of doing One-to-N. I found this paragraph from Mongo summarized it well.

Embed the N side if the cardinality is one-to-few and there is no need to access the embedded object outside the context of the parent object
Use an array of references to the N-side objects if the cardinality is one-to-many or if the N-side objects should stand alone for any reasons
Use a reference to the One-side in the N-side objects if the cardinality is one-to-squillions

Advertisements
Standard