Replacing the Websocket with Firestore
As we saw in the previous section, Firebase is a powerful product that simplifies the implementation of the backend for our apps. Now, we are going to see how we can use it also to simplify the chat messages feature.
What is Firestore?
Firestore, more formally known as Cloud Firestore, is a flexible, scalable, and real-time NoSQL database provided by Firebase. Firestore is designed to store and sync data for client-side applications, making it an ideal choice for building modern, data-driven applications.
One of its most important features is the real-time data synchronization. Firestore automatically synchronizes data in real time across all connected clients, ensuring that your application’s data is always up to date. This is especially useful for applications requiring real-time collaboration or live updates, such as our chat app.
It is important to note that as a NoSQL database, we would have first to define the data structure...