Firebase is a backend of your apps which includes many features like Realtime Database, cloud storage, user authentication, static hosting and many more.
Now, Firebase brought a new feature “Cloud Firestore”. Which is similar to “Firebase Realtime database” that is stuctured as a JSON tree but cloud firestore is stored data in documents(which is a set of key-value pair) and collection(which is a collection of documents) formats.
In the Realtime Database, Complex, hierarchical data is harder to organize at scale but in Cluoud FireStore, Complex, hierarchical data is easier to organize at scale, using subcollections within documents.
In Cloud FireStore, Documents can contain subcollections and nested objects(like ‘phone’ in above figure), both of which can include primitive fields like strings(like ‘name’,’email’ and etc. in above figure) or complex objects like lists.