Model Relational Data in Firestore NoSQL

Fireship · 401K views · 2018 · 9:13

Open on YouTube

Databases & storageWeb developmenttutorial

Why Stack Overflow recommends it

Stack Overflow users link it when answering Firestore questions about how to model relations, sub-collections and many-to-many joins in a NoSQL database.

Recommended by 5 people across 4 different months, 2018 to 2020.

What it is

A roughly nine-minute Fireship tutorial on structuring data in Cloud Firestore. It builds one-to-many and many-to-many relationships by modeling a Twitter-style app, covering document IDs, sub-collections and join-like intermediate collections.

What people said

Strong rec ErickXavier · 2020-01 · Stack Overflow · on “Angular Firebase push key on item”

Firebase's Firestore and Realtime Database don't allow customized keys in array fields. For that you need to create a sub-collection of images inside your document, where you can define a customized ID to each image. Example: galeries (collection) |_gallery_1 (document with custom id) -- title: Christmas (field) -- date: 12/25/2019 (field) -- photos: (collection) |_photo_1 (document with custom id) -- url: [LINK] (field) |_photo_2... There's a great tutorial for Firestore NoSQL Modelling on Youtube, I strongly recommend it: [this video]

Recommends Jesse Lima · 2018-12 · Stack Overflow · on “How to create the following data structure in a NoSQL environment”

Firestore has a different approach to the NoSQL world. Once you know the data you will use (as You already do) there are some very important points about what architecture the data will have. And It depends a lot about how the data grows, what kind of queries you will need and how often you will use them. Some cases You can create a root collection that aggregates data and queries might be easier. There is a great video from Firebase Channel that might help. Check it out! How to Structure Your Data | Get to Know Cloud Firestore #5 [LINK] [UPDATED] December 26th Others videos that might help to model and query your data is these videos: How to Connect Firebase Users to their Data - 3 Methods

Recommends zippyferguson · 2019-02 · Stack Overflow · on “How can I join data with React native and a many to many firebase firestore collection relationship?”

This video may answer my question. ... at 13:31: "this would probably be duplicate data that would live both in the top-level user object and in this individual review and we'll talk in future videos about the best strategies to keep these kinds of things consistent." This leads me to believe that I should duplicate the needed group data under the user and not do the joining bit in the client. [LINK] Or, maybe not: From this video: [this video] [LINK] ... at 7:17 "If you have a sql background, this is very similar to using an intermediate table for joins" More details here: [LINK] In the structure above, how would you get all the tweets that a user has liked(hearted) using the hearts table that h

Recommends petomalina · 2019-09 · Stack Overflow · on “Best way of structuring documents in Cloud Firestore (NoSQL databases)?”

It really depends on the use-case you are trying to solve, as you should be optimizing for specific queries on those models. I recommend watching these videos to get a better idea: Series of What is a NoSQL Database? How is Cloud Firestore structured? [LINK] Model Relational Data in Firestore NoSQL [this video] Firestore Data Modeling - Five Cool Techniques [LINK]

Recommends Axil · 2019-09 · Stack Overflow · on “Firestore - How to model and query relation of 2 collections - IOT use case - v2”

extending to my question Firestore - How to model and query relation of 2 collections - IOT use case [LINK] I'ved now seen a video on this, and this recommends modelling relations using document ID. [this video] skip to 6:07 I want to know if it would work in this case (modifying the example from my original question to fit to this youtube recommendation of firestore relation: Eg: I have 2 different collection - tracking and venue tracking <-- collection 1. document(xyz123) venueId = "abcd1234" timestamp = 10/09/2019 10:00 2. document(xyz567) venueId = "efgh3456" timestamp = 10/09/2019 11:00 venue <-- collection 1. document(abcd1234) <-- notice i shift the device_unique_identifier here instead na

Cites Axil · 2019-09 · Stack Overflow · on “Firestore - How to model and query relation of 2 collections - IOT use case”

I just saw this video [this video] skip to 6:07, could you see if you'ved got an opinion on my subsequent question [LINK]