Firestore & Firebase suite are great technologies. They allow us to build some features really fast. Showing your stakeholders that you’ve built real-time, collaborative features in almost no-time gets you the “wow effect”, so needed in some fields. However, Firestore has also many pain points that, in my opinion, outweigh the pros in most of the more advanced cases.
This is a series of articles where we are comprehensively describing pros and cons of using Firestore as the backend for your next mobile application. In this series, we will try to show you that making this decision is not a simple process and you need to analyze your app from multiple perspectives.
Is Firestore appropriate for you? As with everything in IT - it depends. Read on to find out why!
Firestore has outstanding libraries for mobile. Android (Kotlin!), iOS (Swift!), Flutter (Dart!) - every one of them works magically. For free you get services that complement each other with ergonomic and easy to bootstrap libraries. With Firestore libs you get all the goodies of Firebase suite - auth, serverless, storage, ML and others perfectly blended with the language specifics.
The only bad thing about it is that they are pervasive - once you get them, you start using them everywhere. In all layers. Generally, that is a bad thing, but let’s be honest here, most small apps don’t need any additional abstractions and using the libraries directly is a good thing.
This is a major trait of Firestore. The truly killer feature - it can work (to some extent) offline. Seamlessly. If you have accessed the data previously, you can do so again without the Internet connection. You can even save the data there without active connection. Firestore libraries handle all the syncing, data merging, notifications and other problems.
Firebase platform (that Firestore is part of) might be a viable “backend” option for small, user-focused apps. If you use it alongside other SaaS solutions (e-mails, voice calls, etc.), you might be even able to build a not-so-small app without creating any traditional backend system.
Being Google’s product, it also integrates well with GCP. It blends with it more and more with every release and I suppose that soon, these two will be fully merged.
Having all these solutions in a single place, governed by the same IAM services and configured the same gives you a great advantage right at the beginning. It allows you to focus on what matters, leaving all the gritty details to Firebase. Even if you end up needing some more advanced backend features, you can always use Cloud Functions and do it the normal way.
If you need to have offline capabilities, using Firestore for that is also great - we used this approach in Activy and it worked wonders.
We need there to record GPS tracks as reliably as sport devices (e.g. watches), but being a casual gaming app, it needs to do so in very rough conditions without specialized hardware. Jagged GPS signal, no Internet, very slow connection, intermittent Internet connection, apparent connection - all need to be taken care of. With Firestore, we were able to handle all of the cases and give our users a solution that works everywhere, even in very remote areas, without that much of a development.
There are tons of other places where Firestore is a great solution, but Firestore simplicity can take its toll. Where Firestore shines and simplifies things at the beginning, it can make your hair gray after the application gets complicated enough. As everything in programming - you need to wage pros and cons, consider the future and select what is best for your app
Do you want to find out how the Firestore pricing works or what traps wait for you if you want to properly secure it? Maybe you want to create an auction-based app that requires very fast updates? We learned about this the hard way. Paying thousands for improper usage, breaking live apps because of deployments, overcoming all the shortcomings of Firestore - we’ve been there.
Read the 2nd part of our series on "Why Firestore" to learn about the biggest limitations of Firestore.