Softwr

Cloud · head to head

Google Cloud Run vs MongoDB

Google Cloud Run logo

Google Cloud Run

Cloud

Managed platform for running containers and functions on Google Cloud

From
On request
Free plan
No
MongoDB logo

MongoDB

Databases

The developer data platform

From
Free
Free plan
Yes

The short version

  • MongoDB is a general purpose, document-based, distributed database.
  • MongoDB starts at $9/mo; Google Cloud Run prices on request.
  • Only Google Cloud Run lists deploy any container image; only MongoDB lists document model.
  • Where Google Cloud Run falls short: runs only on Google Cloud, so there is no self-hosted option.
  • Where MongoDB falls short: 16 MB maximum document size limits large single objects.

How do Google Cloud Run and MongoDB differ?

Google Cloud Run and MongoDB differ on starting price (On request against Free), free tier (No against Yes) and platforms (Web against Web, Self-hosted). Only the attributes on which Google Cloud Run and MongoDB actually diverge.

Attributes where Google Cloud Run and MongoDB differ
AttributeGoogle Cloud RunMongoDB
Starting priceOn requestFree
Free tierNoYes
PlatformsWebWeb, Self-hosted
CategoryCloudDatabases

Not yet recorded: pricing model for MongoDB, founded for Google Cloud Run.

Which features does each one have?

They share no listed features; 9 appear only for Google Cloud Run and 20 only for MongoDB. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in Google Cloud Run

  • Deploy any container image
  • Source-based builds for common languages
  • Services with automatic scaling and scale to zero
  • Jobs for scheduled or manual tasks
  • Worker pools for background processing
  • Traffic splitting and rollback between revisions
  • Custom domains and managed TLS
  • Request-based and instance-based billing

Only in MongoDB

  • Document model
  • Distributed architecture
  • ACID transactions
  • Real-time analytics
  • Full-text search
  • Time series data
  • Geospatial queries
  • Aggregation framework

What is each one used for?

Google Cloud Run is most often brought in for hosting web APIs and microservices; MongoDB for mobile applications. The jobs each tool is most often brought in to do.

Google Cloud Run

  • Hosting web APIs and microservicesnot MongoDB
  • Scheduled batch jobsnot MongoDB
  • Queue consumers on worker poolsnot MongoDB
  • Deploying containers without managing clustersnot MongoDB
  • Event-driven backends with Pub/Subnot MongoDB

MongoDB

  • Mobile applicationsnot Google Cloud Run
  • Content managementnot Google Cloud Run
  • Real-time analyticsnot Google Cloud Run
  • IoT applicationsnot Google Cloud Run
  • Gaming backendsnot Google Cloud Run

Where do Google Cloud Run and MongoDB fall short?

Google Cloud Run's most cited limit: runs only on Google Cloud, so there is no self-hosted option. MongoDB's: 16 MB maximum document size limits large single objects. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

Google Cloud Run

  • Runs only on Google Cloud, so there is no self-hosted option
  • The container file system is in memory and not persistent
  • Worker pools do not autoscale natively and need at least one instance
  • Services are stateless, so state needs external storage

MongoDB

  • 16 MB maximum document size limits large single objects
  • No native JOIN support for relational data operations
  • Higher memory usage due to storing field names with each document
  • Eventual consistency in distributed deployments can cause data stale reads

How much do Google Cloud Run and MongoDB cost?

MongoDB has a free plan, with paid plans from $9/mo. Plan by plan below, from each vendor's own pricing page.

Google Cloud Run

On request

No published plan breakdown. See the Google Cloud Run review.

MongoDB

Free
  • M0Free
    • 512 MB storage
    • Learning and exploration
  • M2$9/mo
    • 2 GB storage
    • Development and testing
  • M5$25/mo
    • 5 GB storage
  • M10+$56.94/mo
    • Dedicated clusters for production

Which should you pick?

Choose Google Cloud Run if

  • You need deploy any container image.
  • You also want source-based builds for common languages.

Choose MongoDB if

  • You need document model.
  • You want to start without paying.
  • You work on Web, Self-hosted.
  • You also want distributed architecture.

Questions people ask

Is Google Cloud Run or MongoDB better?
It depends on the job. Google Cloud Run fits hosting web APIs and microservices; MongoDB fits mobile applications. Google Cloud Run starts at On request and MongoDB at Free.
Which is cheaper, Google Cloud Run or MongoDB?
MongoDB has a free tier; the other does not. Paid plans start at On request for Google Cloud Run and Free for MongoDB.
Does Google Cloud Run or MongoDB run on more platforms?
Google Cloud Run runs on Web. MongoDB runs on Web, Self-hosted.
Can I use MongoDB for free?
Yes. MongoDB has a free tier, so you can try it without paying. Google Cloud Run starts at On request.
What is Google Cloud Run best used for?
Google Cloud Run is most often used for hosting web apis and microservices, scheduled batch jobs, queue consumers on worker pools, deploying containers without managing clusters. Of those, hosting web apis and microservices and scheduled batch jobs are not what MongoDB is typically brought in for.
What can Google Cloud Run do that MongoDB cannot?
Google Cloud Run covers Deploy any container image, Source-based builds for common languages, Services with automatic scaling and scale to zero, Jobs for scheduled or manual tasks. MongoDB covers Document model, Distributed architecture, ACID transactions, Real-time analytics.

Answered from the vendors’ own pages

Google Cloud Run: What can Cloud Run run?

Any container image, or source code for Go, Node.js, Python, Java.NET and Ruby that Google builds into a container.

Source
MongoDB: Does MongoDB offer a free tier?

Yes. MongoDB Atlas offers an M0 free tier with 512 MB storage for learning and exploration, plus paid options starting at $9/month for M2 with 2 GB storage.

Source
Google Cloud Run: How is Cloud Run billed?

Allocated CPU and memory are billed in 100 millisecond granularity, in request-based or instance-based mode. A free tier is available.

Source
MongoDB: Can I self-host MongoDB?

Yes. You can run MongoDB Community Edition on your own servers, or use MongoDB Enterprise Advanced for self-managed production deployments with enterprise features.

Source
Google Cloud Run: Can Cloud Run scale to zero?

Yes. Services scale to zero when idle unless a minimum number of instances is set.

Source
MongoDB: What is the maximum document size in MongoDB?

Documents are limited to 16 MB. For documents exceeding this limit, you can use MongoDB's GridFS API to store files larger than the maximum size.

Source
MongoDB: Does MongoDB support ACID transactions?

Yes. MongoDB supports ACID transactions within a single document by default, and multi-document ACID transactions are available for replica sets and sharded clusters in MongoDB 4.0+.

Source
Share

Related pages

Other head to heads