Can app engine host a Node JS worker?

266 views
Skip to first unread message

Ryan Sacha

unread,
Jun 29, 2018, 2:54:36 PM6/29/18
to Google App Engine
I came across the recent launch of Node JS serverless option on google app engine.

My question is, would it be safe to host a Node JS worker app (like Kue or Bull) without app engine killing a running job midway to conserve server cost?

I'm wary of Cloud functions because they seem to be for lighter, fast startup scripts, not full fledged apps.

George (Cloud Platform Support)

unread,
Jun 30, 2018, 2:30:19 PM6/30/18
to Google App Engine
If your intention is to deploy a full-fledged app, you have the choice between the Standard Environment and Flexible. The "Choosing an App Engine Environment" online document should help you in taking the decision best suited to your needs. In both cases, the managed environment works transparently in ensuring that your desired functionality is there. You can configure your app specifying how its services scale. Instances are created or stopped in response to traffic. You may have a look at the "How Instances are Managed" page for more information. 

Cloud Endpoints is a distributed API management system, not suitable for a priority job queue. 

David Komer

unread,
Jul 11, 2018, 4:23:13 AM7/11/18
to Google App Engine
Just to bump this - the linked docs are great for comparing between App Engine Standard and Flexible, but it doesn't really address Cloud Functions.

It would be helpful to have a comparison / best-practices guideline for choosing between Cloud Functions and App Engine

Ani Hatzis

unread,
Jul 11, 2018, 7:54:27 AM7/11/18
to Google App Engine
Maybe Cloud Functions will be added to Choosing a Computing Option once it gets out of beta?

In general I would say, that Cloud Functions (almost no control, focus on code) is on the opposite side of Compute Engine (full control, lots of DIY). Compared to App Engine, GCF is "even more serverless", probably more suitable for small jobs, rather than fully fledged web apps / API backends. GAE comes with different scalability options and version/traffic management, and I believe that automated testing and deployment of an app with dozens of endpoints, maybe hundreds, is easier with such features. (Although Testing and CI/CD is possible with GCF).

On the other hand, if you want to build just a few functions to accompany Firebase, or utility functions for Cloud Storage, or integrate (GCP) resources through Pub/Sub and light-weight computing, then GCF might be the better option.

With the rise of microservice architecture, GCF might become an excellent compute option for microservices, too. However, it's still in beta, and I believe that a few features are missing yet that would go a long way here: Google-managed SSL with custom domains, builtin client authentication, and better control of versions (or traffic migration). AFAIK, App Engine's Task Queue API is promoted to a stand-alone product, Memcache, too. Add Storage and Datastore to the mix and I see that GCF can become a reasonable alternative to GAE in more use-cases.

Of course, a rather different roadmap for GCF could be to somehow merge GCF with its cousin from the Google apps family, Google Apps Script, but I don't expect that to happen.

David Komer

unread,
Jul 11, 2018, 7:59:42 AM7/11/18
to Google App Engine
Thanks for the breakdown :)
Reply all
Reply to author
Forward
0 new messages