Softwr

Cloud · head to head

Google Cloud Run vs Stimulus

Google Cloud Run logo

Google Cloud Run

Cloud

Managed platform for running containers and functions on Google Cloud

From
On request
Free plan
No
Stimulus logo

Stimulus

Web Development

Small JavaScript framework that adds behaviour to existing server rendered HTML

From
Free
Free plan
Yes

The short version

  • Stimulus is an MIT licensed JavaScript framework.
  • Stimulus is free; Google Cloud Run prices on request.
  • Where Google Cloud Run falls short: runs only on Google Cloud, so there is no self-hosted option.
  • Where Stimulus falls short: does not render templates, so HTML must come from the server or another tool.

How do Google Cloud Run and Stimulus differ?

Google Cloud Run and Stimulus differ on starting price (On request against Free), pricing model (Usage-based against Open-source) and free tier (No against Yes). Only the attributes on which Google Cloud Run and Stimulus actually diverge.

Attributes where Google Cloud Run and Stimulus differ
AttributeGoogle Cloud RunStimulus
Starting priceOn requestFree
Pricing modelUsage-basedOpen-source
Free tierNoYes
CategoryCloudWeb Development

Identical on both: platforms (Web).

Not yet recorded: founded for Google Cloud Run.

Which features does each one have?

They share no listed features; 9 appear only for Google Cloud Run and 7 only for Stimulus. 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 Stimulus

  • Controllers attached through data-controller
  • Actions that bind DOM events to controller methods
  • Targets for locating elements inside a controller
  • Values that read, write and observe data attributes
  • Works with server rendered HTML
  • Designed to pair with Turbo in Hotwire
  • MIT licensed open source

What is each one used for?

Google Cloud Run is most often brought in for hosting web APIs and microservices; Stimulus for adding small interactions to Rails views. The jobs each tool is most often brought in to do.

Google Cloud Run

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

Stimulus

  • Adding small interactions to Rails viewsnot Google Cloud Run
  • Progressive enhancement of server rendered pagesnot Google Cloud Run
  • Pairing with Turbo for fast page updatesnot Google Cloud Run
  • Replacing scattered jQuery codenot Google Cloud Run
  • Form and widget behaviour on existing HTMLnot Google Cloud Run

Where do Google Cloud Run and Stimulus fall short?

Google Cloud Run's most cited limit: runs only on Google Cloud, so there is no self-hosted option. Stimulus's: does not render templates, so HTML must come from the server or another tool. 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

Stimulus

  • Does not render templates, so HTML must come from the server or another tool
  • No built in routing, data fetching or client side state management
  • Behaviour is tied to data attributes in markup, which some teams find harder to trace
  • Not a component framework, so large interactive interfaces need other libraries

How much do Google Cloud Run and Stimulus cost?

Stimulus is free to use. 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.

Stimulus

Free

No published plan breakdown. See the Stimulus review.

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 Stimulus if

  • You need controllers attached through data-controller.
  • You want to start without paying.
  • You also want actions that bind dom events to controller methods.

Questions people ask

Is Google Cloud Run or Stimulus better?
It depends on the job. Google Cloud Run fits hosting web APIs and microservices; Stimulus fits adding small interactions to Rails views. Google Cloud Run starts at On request and Stimulus at Free.
Which is cheaper, Google Cloud Run or Stimulus?
Stimulus has a free tier; the other does not. Paid plans start at On request for Google Cloud Run and Free for Stimulus.
Does Google Cloud Run or Stimulus run on more platforms?
Both run on Web, so platform support will not decide this one for you.
Can I use Stimulus for free?
Yes. Stimulus 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 Stimulus is typically brought in for.
What can Google Cloud Run do that Stimulus 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. Stimulus covers Controllers attached through data-controller, Actions that bind DOM events to controller methods, Targets for locating elements inside a controller, Values that read, write and observe data attributes.

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
Stimulus: What is Stimulus used for?

Stimulus enhances HTML that already exists on the page by connecting JavaScript controllers to elements through data attributes. It does not generate the HTML itself.

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
Stimulus: What are the core concepts in Stimulus?

Controllers are the main unit, and they are joined by actions, targets and values. Actions link events to methods, targets find elements and values store state in data attributes.

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
Stimulus: What licence does Stimulus use?

The GitHub repository states that Stimulus is released under the MIT licence. It is free to use.

Source
Stimulus: Why was Stimulus created?

According to the project's origin page, Basecamp used a mix of jQuery, vanilla JavaScript and object oriented subsystems that were hard to reuse and learn. Stimulus condensed those patterns into a small, consistent framework.

Source
Share

Related pages

Other head to heads