Using Firestore Database to persist data
Firebase also provides a database service to persist data. There are two databases in Firebase. The first is Realtime Database and the second is Firestore. Firestore is a new, more optimized real-time database, which is why we will be learning about Firestore. Firestore provides flexible, hierarchical data structures. Data is organized in collections and documents. A document can have a complex nested structure as well as subcollections. Data syncs across devices through real-time listeners. To use Firestore, we must first configure it in the console, which we will do in the next subsection.
Configuring Firestore Database
As with Authentication, we have to configure the database in the Firebase console first by following these steps:
- On the console, click on Build | Firestore Database from the sidebar.
Figure 10.11 – An overview of Firestore
- On the page that appears, click on the Create...