Shipmunks

MongoDB vs Firebase: Which Backend for a Small App

For the stated month, Firestore on Blaze in nam5 is $3.42. Atlas Flex is $8.00 if the base tier holds all month. An M10 cluster is $57.60 before internet egress.

On this page
  1. The short answer
  2. What we tested
  3. Data model and queries
  4. Realtime and offline
  5. Auth and the rest of the platform
  6. What it costs at one workload
  7. How to migrate from Firebase to MongoDB
  8. When to pick Supabase instead
  9. FAQ
  10. Sources
  11. Related

The short answer

MongoDB vs Firebase for this small app: pick Firebase if you need listeners, an offline cache, and auth in the same project. That workload is $3.42 on Blaze in nam5. Pick MongoDB if you need document queries, including a left outer join, and you will add app auth yourself. Atlas Flex is $8.00 when the base tier holds all month, and an M10 cluster is $57.60 for the hours before internet egress.

Worked monthly bill on November 13, 2026. Firestore Blaze in nam5 is $3.42. Atlas Flex is $8.00 if the base tier holds all month. An M10 cluster is $57.60 for 720 hours, and internet egress is not in that bar.

MongoDB vs Firebase is two document databases with different bills. Firestore vs MongoDB is the Firestore side: Firestore charges each document read, write, and delete, then storage and egress. MongoDB Atlas vs Firebase is the Atlas side: Atlas Flex charges an operations-per-second tier, and the base price includes up to 5 GB of storage and data transfer. If you want Postgres, auth, and files in one hosted project instead, the bill at 1,000, 10,000, and 50,000 users is in Supabase vs Firebase.

What we tested

Checked

The prices were read on November 13, 2026 from the MongoDB pricing page, the Atlas Flex costs page, the cluster configuration costs page, the data transfer page, the Firebase pricing page, and the Cloud Firestore pricing page. No Atlas cluster was created, and no Firebase project was billed.

The workload is 30 days. Each day is 100,000 document reads, 40,000 document writes, and 30,000 document deletes. Stored data is a flat 2 GiB. Egress is 20 GiB to the public internet, to Americas destinations, not China and not Australia. Firestore is nam5, the United States multi-region, at the default rates, with no committed-use discount. Backups, point-in-time recovery, tax, phone sign-in, and Identity Platform are out of the bill. Index-entry reads are not added on top of the stated document reads. Each stated read, write, and delete counts as one Atlas operation, spread evenly, with no hour over 100 operations a second. A burst would change the Flex hour, and that burst is not in the bill. The M10 line uses the dedicated table’s $0.08 per hour. The pricing page says the real price can vary by configuration and location. Dedicated internet egress is a range, so it is not added to the $57.60.

Data model and queries

Cloud Firestore is a document database. The data model page says there are no tables or rows. You store documents in collections. A document is fields mapped to values, and the page says you can treat one as a lightweight JSON record, with extra types and a size limit the page does not number. Documents in one collection do not have to share fields. A collection holds documents only. Nesting is a subcollection under a document, and the page says you can query every subcollection that shares an id with a collection group query. Deleting a document does not delete its subcollections.

MongoDB stores BSON documents. BSON is a binary form of JSON with more types. The document page sets the maximum BSON document size at 16 mebibytes. Each document in a normal collection needs an _id. Dot notation reads a field inside an embedded document or an array element. The query documents page is the find language on those fields.

The join is the practical split. $lookup performs a left outer join to another collection in the same database and adds an array of matches. The page lists MongoDB Atlas, Enterprise, and Community as places you can use it. Firestore’s data model page does not describe a join. You query one collection, or a collection group.

The Firestore pricing page also charges some queries for index entries. A query with up to one range field is not charged for those index reads. A query with two range fields is. One read is charged per batch of up to 1,000 index entries, with a different batch size for a vector search. This bill does not add that, because the workload is a count of document reads, not a query shape.

Flex adds its own caps. The limitations page says a Flex cluster runs at least MongoDB 8.0, holds at most 5 GB including uncompressed BSON and indexes, allows 500 collections, and limits an aggregation pipeline to 50 stages. It blocks allowDiskUse, server-side JavaScript, and four stages: $currentOp, $listLocalSessions, $listSessions, and $planCacheStats. $lookup is not in that banned list.

If the document database you want is TypeScript functions instead of either of these query languages, that pair is Convex vs Supabase.

Realtime and offline

Firestore listeners are part of the client. The offline page, updated November 12, 2026, says you can listen to documents, collections, and queries, and that a listener is charged a read when a document is added, updated, or removed from the result because it changed. A deleted document is not charged as a read. Offline persistence caches data the app has used. Android and Apple turn it on by default. Web turns it off by default, and the persistent cache is Chrome, Safari, and Firefox. The server client libraries for C#, Go, Java, Node.js, PHP, Python, and Ruby do not support it. When the device reconnects, local writes sync, and the last write wins if several edits hit one document.

MongoDB’s live feed is change streams. An application subscribes to a collection, a database, or the deployment, and can filter the stream with the aggregation framework. They need a replica set or a sharded cluster on WiredTiger. Time series collections do not support them. On Flex, the limitations page says a change stream filter on a database name can use only strings and regular expressions, and a $regex on the oplog has to start with a caret.

That is not an offline client. Atlas Device Sync and the Device SDKs are gone. The Device SDK deprecation page says the SDKs were deprecated in September 2024 and removed on September 30, 2025. The on-device database continues as an open source project. Sync does not. There is no offline cache in this comparison for MongoDB, because the product that did that sync has reached end of life.

Auth and the rest of the platform

Firebase Authentication is a user system: email and password, phone, Google, Facebook, Twitter, GitHub, anonymous, and a custom token. The pricing page marks “Other Authentication services” as included on the Spark plan and on the Blaze plan. It does not print a dollar price for them. Phone auth is billed per SMS, and this bill leaves it out. Identity Platform is a separate upgrade. The auth docs say that upgrade limits Spark to 3,000 daily active users for email, social, anonymous, and custom sign-in, and on Blaze it includes 50,000 monthly active users and then charges $0.0025 to $0.0055 per user. That range is not in the $3.42, because this bill does not turn the upgrade on.

The same Firebase pricing page is the rest of the project: Cloud Storage, Cloud Functions, Hosting, and Cloud Messaging. Storage and functions have their own quotas. This workload does not use them, so they are not lines in the table.

Atlas does not include that user system. The App Services deprecation page says Authentication and User Management are no longer available, because the Device SDKs were the way in, and those SDKs are removed. Database triggers remain. Flex database auth, from the limitations page, is a password (SCRAM), an X.509 certificate, or AWS IAM. Those are database users, not app accounts.

What Atlas does include, on the pricing page, is Charts on Flex and on Dedicated, and Search, Vector Search, and Stream Processing as platform pieces. Flex does not support private endpoints, network peering, customer-managed encryption keys, or continuous backup. It takes one daily snapshot. On-demand snapshots are not supported. The dedicated table is where those production controls start, at M10.

Self-hosting follows the same split. MongoDB Community Server is the free download, and the pricing page calls Enterprise Advanced the self-managed product. The emulator suite says not to use the emulators as a self-hosted Firebase. They mimic the services for local tests, and the page says they are not appropriate for production.

A single binary with its own auth, on SQLite, is a different pair. The measured startup is in PocketBase vs Supabase.

What it costs at one workload

Firestore on the Firebase pricing page has no Blaze plan fee. Blaze keeps the Spark quotas and then uses Cloud pricing past them. The free quotas reset daily, around midnight Pacific, and they do not roll over. One free database per project gets them. The nam5 rates read from the Cloud pricing page on November 13, 2026 are $0.06 per 100,000 reads, $0.18 per 100,000 writes, $0.02 per 100,000 deletes, and $0.18 per GiB of stored data. Outbound internet transfer to the Americas is $0.12 per GiB after the first 10 GiB in a month. The first 10 GiB are $0.00. The page states storage as a GiB-month price. This bill uses that $0.18 figure for one GiB-month.

Atlas Flex, from the pricing page and the Flex costs page, is $0.0110 an hour at 0 to 100 operations a second, and the monthly column for that tier held for 30 days is $8.00. The next tiers are $15.00, $21.00, $26.00, and $30.00. The $30.00 cap is 400 to 500 operations a second. Past 500, Flex queues instead of billing a higher tier. The base price includes 5 GB of storage and unlimited data transfer. Free clusters and Flex are not charged for outgoing data. M0, the free cluster, is 512 MB, which does not hold 2 GiB.

The pricing page still prints M2 at $9 a month and M5 at $25 a month. The Flex costs page says you can no longer create those tiers, and that on January 22, 2026 the remaining M2 and M5 clusters were migrated to Flex. They are not a way to buy this workload, so they are not a row.

M10 on the dedicated table is $0.08 an hour, 2 GB of RAM, 2 vCPUs, and 10 to 128 GB of storage. The card above that table says dedicated starts at $56.94 a month and does not show the hours behind that figure. This bill multiplies the table rate by 720 hours. Default storage is inside the hour, from the cluster configuration costs page. Raising storage above the default is a different charge, for the full disk, and this bill does not do that. 2 GiB sits inside the 10 GB default.

Feature split, read November 13, 2026. Flex limits are the Flex limitations page. Auth for Atlas is database users, not app accounts.
PieceFirestoreMongoDB Atlas
Data modelDocuments in collections. No tables or rows. Subcollections. Schemaless.BSON documents. 16 mebibyte maximum. _id on a normal collection.
QueriesA collection, or a collection group. No join on the data model page. Extra index reads when a query has two range fields.Query language, plus $lookup as a left outer join in the same database. Atlas, Enterprise, and Community.
RealtimeListeners on documents, collections, and queries. A changed result document is a read.Change streams on a replica set or sharded cluster. Flex restricts database-name filters.
OfflineCache on Android, Apple, and web. On by default on mobile. Off by default on web. Not in the server libraries.Device Sync removed September 30, 2025. The on-device database remains as open source, without that sync.
AuthEmail, social, and the other non-phone methods included on Spark and Blaze. Phone is per SMS. Identity Platform is a separate upgrade.App Services user auth is withdrawn. Flex database auth is SCRAM, X.509, or AWS IAM.

The money, for the same stated month:

Worked month. 30 days, nam5, default rates. Cents. Read November 13, 2026.
LineArithmeticAmount
Firestore reads100,000 times 30, minus 50,000 times 30, is 1,500,000. That is 15 times $0.06$0.90
Firestore writes40,000 times 30, minus 20,000 times 30, is 600,000. That is 6 times $0.18$1.08
Firestore deletes30,000 times 30, minus 20,000 times 30, is 300,000. That is 3 times $0.02$0.06
Firestore storage2 GiB minus the 1 GiB free quota. 1 times $0.18$0.18
Firestore egress20 GiB minus 10 GiB free. 10 times $0.12, Americas$1.20
Firestore total0.90 + 1.08 + 0.06 + 0.18 + 1.20$3.42
Atlas operations100,000 + 40,000 + 30,000 is 170,000 a day. 170,000 divided by 86,400 is 1.97 a second, to the hundredthBase tier
Flex hourly product$0.0110 times 24 times 30$7.92
Flex totalThe pricing page’s 30-day column for this tier, held all month. Storage and egress are inside it$8.00
M10 cluster$0.08 times 720 hours. Default 10 GB disk includes the 2 GiB$57.60
M10 internet egressAWS out to the internet is $0.09 to $0.16 per GB on the data transfer pageNot in the $57.60

The $0.08 gap on Flex is the monthly column versus the hourly product. $8.00 is what the page labels the cost of 30 days at that tier. $7.92 is $0.0110 times 720. This page uses $8.00 as the Flex total, and it does not add $7.92 on top.

  • $3.42

    Firestore Blaze, nam5, this workload

  • $8.00

    Atlas Flex, base tier held for 30 days

  • $57.60

    M10 for 720 hours, egress not included

  • $0.00

    M0 does not hold 2 GiB. Spark stops at the free quotas

Worked monthly bill on November 13, 2026. Firestore Blaze in nam5 is $3.42. Atlas Flex is $8.00 if the base tier holds all month. An M10 cluster is $57.60 for 720 hours, and internet egress is not in that bar.
Bar length uses $57.60 as full width. The Flex bar is the monthly column, not the $7.92 hourly product. The M10 bar has no egress dollar in it.

Check the Firestore lines once more. 1,500,000 reads divided by 100,000 is 15, and 15 times $0.06 is $0.90. Writes: 600,000 divided by 100,000 is 6, and 6 times $0.18 is $1.08. Deletes: 3 times $0.02 is $0.06. Storage $0.18. Egress $1.20. The sum is $3.42.

Spark cannot carry this month. The free caps are 50,000 reads a day, 20,000 writes, 20,000 deletes, 1 GiB stored, and 10 GiB of egress a month. This workload is over each of those. Blaze is the plan that bills the overage. There is still no plan fee in the $3.42. The pricing page mentions $300 of credit if you are eligible. Eligibility is not a rate, so the credit is not subtracted.

How to migrate from Firebase to MongoDB

A Firebase to MongoDB migration, for the database on this page, is a Cloud Firestore export plus a file mongoimport can read. I did not run the export or the import. The steps are the docs read November 19, 2026.

  1. Export the documents. The Firestore export page says the managed export needs billing, which puts a Firebase project on the Blaze plan, plus a Cloud Storage bucket that is not Requester Pays and not Rapid. The gcloud reference exports every collection group to a bucket prefix:
gcloud firestore export
gcloud firestore export gs://mybucket/my/path --database='(default)'

Add --collection-ids when you want specific collection groups. The export page says a collection-group export does not automatically include subcollections of those collections. An export is not an exact snapshot from the start time. It can include changes made while it runs. Exporting bills one read per document.

  1. Do not point mongoimport at that export. The export page says the output is LevelDB log format, with protocol-buffer metadata files. The same export can be imported into another Cloud Firestore database, or loaded into BigQuery. mongoimport reads Extended JSON, CSV, or TSV, the formats mongoexport writes, or a third-party file in those formats. The default type is JSON. Build that file from the documents yourself. This page does not name a converter.

  2. Import the converted file. Run mongoimport from the system command line, not from the mongo shell. The docs’ syntax is mongoimport, then options, a connection string, and a file. --file is the file. If you omit it, mongoimport reads standard input. --collection is the collection. If you omit it, the name is the file name without the extension. If you omit the database, mongoimport uses test and creates it. The docs’ connection-string shape is mongodb://mongodb0.example.com:27017. Replace the host, the database, and the file. The tools page says the binaries are not supported on non-genuine MongoDB deployments.

Firestore with MongoDB compatibility is a different product, and it does exist. The overview, last updated November 18, 2026, says it is part of the Enterprise edition. It lets existing MongoDB drivers, tools, and the MongoDB query language talk to Cloud Firestore. That is not a dump you load into MongoDB, and it is not the native export above.

Going the other way, from MongoDB into that Firestore edition, is the migration guide read the same day as the export page. Datastream captures the MongoDB-compatible source into Cloud Storage. Dataflow writes that bucket into Firestore with MongoDB compatibility. The guide requires MongoDB 4.0 or newer, on a replica set or a sharded cluster, so change streams work. A native Firestore export does not run that path backwards. Migrate Firestore to MongoDB is the numbered list above. Migrate MongoDB to Firebase, for this compatibility edition, is that Datastream and Dataflow guide.

When to pick Supabase instead

Supabase is the pick when the data is rows, and you want auth, files, and realtime in the project without running them. On the pricing page, read the same day, Free is $0, with a 500 MB database, two active projects, and a pause after a week with no activity. Pro starts at $25 a month, is charged up front, and does not pause. That is a different meter from the $3.42 and the $8.00. The three-size user bill is the Supabase vs Firebase post, not a second arithmetic of this document workload.

  • You want listeners, an offline cache on the device, and included email or social auth, and this document workload is the month you expect: Firebase on Blaze. $3.42 in nam5. A regional location is a different rate. Iowa’s reads on the same pricing page are $0.03 per 100,000, not the $0.06 used here.
  • You want BSON, $lookup, and change streams, the traffic stays under 100 operations a second, and 2 GiB plus indexes stays under 5 GB: Atlas Flex. $8.00. You bring app auth.
  • You want dedicated machines, private networking, or a backup policy Flex does not sell: M10 or larger. $57.60 for the M10 hours at the table rate, then internet egress at a range the page does not collapse to one number.
  • You want Postgres and the products around it: Supabase. Free if you fit 500 MB and can accept the pause. Pro at $25 if you do not.
  • You want one binary on a machine you control: PocketBase vs Supabase, which is a measured run, not this price list.

These three totals are readings of the price pages for one stated month. They leave out tax, a waived credit, a burst over 100 operations a second, index-entry reads, and any disk past the M10 default. The comparisons live on the backend and stack page.

Neon vs Supabase, free tier and the first paid month Hosted Postgres that can suspend, if the document bill is the wrong shape and you still want a managed database. Blog Railway vs Supabase for the Postgres itself One stated Postgres month on Railway Hobby against Supabase Pro, when the data is rows rather than documents. Blog

FAQ

Is Firestore MongoDB?

No. Cloud Firestore is Google’s document database. Documents live in collections, and the data model page says there are no tables or rows. MongoDB stores BSON documents, with a 16 mebibyte limit per document, and it has its own query language. Same shape of data, different server, different bill.

Which is cheaper at scale?

At the workload on this page, Firestore Blaze in nam5 is $3.42, Atlas Flex is $8.00 if every hour stays in the base tier, and an M10 cluster is $57.60 for 720 hours before internet egress. Flex’s own table tops out at $30.00 for a month held at 400 to 500 operations a second. Above 500 operations a second, Flex does not sell a higher tier. It queues. A busier month than this one is a different bill.

Can I migrate from Firebase to MongoDB?

You can export Cloud Firestore documents to Cloud Storage with gcloud firestore export, then load a converted file into MongoDB with mongoimport. The managed export is LevelDB log files plus protocol-buffer metadata, for another Firestore database or for BigQuery. mongoimport reads Extended JSON, CSV, or TSV. It does not read that export. The export page describes documents, not Firebase Authentication users. The other direction, MongoDB into Firestore with MongoDB compatibility, is a Datastream and Dataflow migration on the guide read November 19, 2026.

Can I self-host either?

MongoDB, yes. Community Server is the free download, and Enterprise Advanced is the paid self-managed product. The $lookup page lists both, plus Atlas. Firestore, no. The Local Emulator Suite page says not to treat the emulators as a self-hosted Firebase. They are for local testing, not production.

Sources

  1. MongoDB pricing Checked
  2. Estimate Atlas Flex Cluster Costs and Usage Checked
  3. Atlas Cluster Configuration Costs Checked
  4. Data Transfer Costs (Atlas) Checked
  5. Atlas Flex Limitations Checked
  6. Documents (MongoDB) Checked
  7. Query documents (MongoDB) Checked
  8. $lookup (MongoDB) Checked
  9. Change Streams (MongoDB) Checked
  10. Atlas App Services Deprecations Checked
  11. Atlas Device SDKs Deprecation Checked
  12. Download MongoDB Community Server Checked
  13. Firebase pricing Checked
  14. Firestore pricing (Google Cloud) Checked
  15. Cloud Firestore data model Checked
  16. Access data offline (Firestore) Checked
  17. Firebase Authentication Checked
  18. Firebase Local Emulator Suite Checked
  19. Supabase pricing Checked
  20. Export and import data (Cloud Firestore) Checked
  21. gcloud firestore export Checked
  22. mongoimport (MongoDB Database Tools) Checked
  23. Firestore with MongoDB compatibility overview Checked
  24. Migrate to Firestore with MongoDB compatibility Checked