Ep. 22 — Firestore vs. MongoDB+Realm (as of Jun 2020)
If you are aiming at making a best-in-class mobile app, offline capabilities is a must-have. Apps like Google Photos, Spotify, Flipboard and Waze would not have been as successful if they require continuous access to the Internet.
From an architecture viewpoint, this means you need to choose an on-device datastore.
I have been a fan of Google’s Firebase suite and therefore Firestore is my default mobile database of choice.
In 2020, MongoDB has merged Realm.io with its core engine and brought the best of both worlds together. I have found the new MongoDB Realm platform increasingly appealing. The Firebase suite is nice because it has authentication, database, storage, functions, hosting, crash reporting, analytics and remote config. But…
Firestore is a fairly basic NoSQL database. Mongo/Realm combo has a few advantages over Firestore, most notably:
- GROUP BY and aggregate functions (min/max/sum/count/etc)
- SQL-like JOIN
- Operators such as LIKE and != (not equal)
- Geo queries (e.g. search for documents that are within 5 km)
- Relational connector (ODBC) to enable queries from your BI tools like Tableau or Excel.
- On-premise deployment option
Of course, there are other mobile app database engines out there (AWS DynamoDB, Azure Cosmos DB, Parse, Couchbase, neo4j, CouchDB, etc.)
At this point in time, I like the MongoDB/Realm combo the most.