React devs might find this archived course helpful to reference, but this course has been updated! We now recommend you take the Firebase Fundamentals course.
Transcript from the "Cloud Firestore" Lesson
[00:00:00]
>> Steve Kinney: Let's talk a little bit about the new database in Firebase. And it's called Cloud Firestore, and the previous one was called the Realtime Database. And there are some kind of interesting differences, just because the old one is called the Realtime Database does not mean that Cloud Firestore does not support realtime updates as well.
[00:00:22] And this is really cool, because it means that you can change your database, and instantly, events are pushed to all connected clients, right? Which means you don't necessarily have to fetch with Ajax every 30 seconds to poll for new changes. As soon as something changes in either one of these databases, then you can actually have your front end respond as well.
[00:00:40] Which is really great for a whole class of applications that would otherwise be difficult or involve web sockets or something along those lines, like building a chatroom application, or anything along those lines, or a live news feed. Well, we're gonna build a live blogging platform today, where once we push it out live, we'll all be able to work on it at the same time, and see all the updates get pushed, so on and so forth.
[00:00:59] It will be really cool. Generally speaking, Cloud Firestore is in beta. However, when we go to build our application and you have to pick a database, we're gonna see that there's a giant banner for Cloud Firestore that has Get Started. And if you scroll down a lot, you can find a much smaller button for Realtime Database.
[00:01:23] So while it is in beta, it is absolutely the one that Google and/or Firebase is pushing at this point, and definitely the future. This is the company that had Gmail in beta for ten years, so it's a thing. They do have slightly different cost models. We're gonna be talking about the cost model, and for the most part, Cloud Firestore is very cheap.
[00:01:46] It'll take some work to really get yourself a nice bill. And you can set up billing alerts and stuff like that. The one thing where you might wanna consider the Realtime Database is if you are querying and reading and writing to the database a lot, it might technically be cheaper.
[00:02:00] Cloud Firestore will almost always be cheaper in every other case, other than a lot of queries and reads and writes. And we're talking about, I wanna make a live drawing application where every stroke of the brush, or mouse or pen, in this case, pushes an update to the database, not chatroom-level application, or blog-level application.
[00:02:18] We're talking severe amounts of reads and writes. The cost difference might be different, otherwise, Cloud Firestore, at this point, is the kind of recommended way to go about doing it,