Ep. 22 — Firestore vs. MongoDB+Realm (as of Jun 2020)

Billy Lo
2 min readJun 15, 2020

--

One stop shop?

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:

  1. GROUP BY and aggregate functions (min/max/sum/count/etc)
  2. SQL-like JOIN
  3. Operators such as LIKE and != (not equal)
  4. Geo queries (e.g. search for documents that are within 5 km)
  5. Relational connector (ODBC) to enable queries from your BI tools like Tableau or Excel.
  6. 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.

--

--

No responses yet