
Node.js is now available on App Engine standard environment - steren
https://cloudplatform.googleblog.com/2018/06/Now-you-can-deploy-your-Node-js-app-to-App-Engine-standard-environment.html
======
SoulMan
Standard, in my opinion, is still the best bet of you want most of the things
out of the box from GCP. Flex does allow a lot of customization but you miss
out on Memcache, Task Queues, Auto tracing in Stackdriver etc which are
sometimes really backbone of your highly scalable architecture given that you
don't want to manage your own infrastructure.

~~~
rhodysurf
The free tier is frighten awesome. I love using GAE standard backends for my
hobby projects

~~~
westoncb
I was looking into it a bit today, but was discouraged after hearing some
comments about having to specialize on the application source level to
accommodate the GAE environment, and that you have to use their proprietary
non-relational database.

Are those things true, or as significant as they sound? (Not being able to
directly port my source to another service sounds quite risky...)

~~~
boulos
Disclosure: I work on Google Cloud.

That’s ancient history, particularly with these recent launches, as Google
Cloud has become a real platform.

This is vanilla node. You need not use Datastore, and can happily talk to a
managed MySQL or Postgres instance via Cloud SQL (albeit sadly still via
public IP and/or a proxy for now). The same is true of the recent Java 8
support, and will be true of all the new runtimes going forward (as mentioned
downthread, the Google I/O talk is the best reference here).

Google Cloud Functions is similar, fwiw. You can even package up arbitrary
binaries and exec them (ffmpeg is a favorite, as is imagemagick’s convert).

------
patwolf
This surprises me. I had assumed incorrectly that flexible environments were
the future of App Engine.

I'm pretty happy with using flexible environment for nodejs. However, the fact
that this supports scaling to zero, and has headless chrome built-in, I could
see using this for a low-cost headless Chrome environment.

I've had several projects where I've wanted a node server separate from the
main app server on which I could use headless Chrome for pdf generation. It's
never easy to justify the cost of an extra instance for that purpose. But with
a zero scale capability, this could presumably be cheaper and easier to
justify.

~~~
waleedka
Same here! I was going with the assumption that standard environments are
going away since they haven't been updated for years.

------
stefano
I wish they had python 3. It's still stuck on python 2, which will be
unsupported in less than two years.

~~~
stewart27
Hi, I'm a Product Manager on the App Engine team. We're actually (finally!)
gearing up to offer Python 3.

Would you like to be an alpha tester? Here's the sign-up form:
[https://docs.google.com/forms/d/e/1FAIpQLSfLXViTUmtY6Ed_Gm9H...](https://docs.google.com/forms/d/e/1FAIpQLSfLXViTUmtY6Ed_Gm9HohVVe7HMKcT37_MvzgPpKIDQTkZNjg/viewform?usp=sf_link)

~~~
wikibob
Can you share even a smidgen of what took so long (10 years!)?

From various comments over the years here and elsewhere, I’ve been led to the
understanding that Python 3 was “coming soon” several times.

1\. Why now?

2\. Is it true this time?

3\. Will Python 3 keep up to date with new releases, or 5 years from now will
we be stuck on 3.6?

4\. What is the future and roadmap of AppEngine?

The feeling in the community is that AppEngine is another Google Reader, and
death may be imminent. Can you reassure us?

5\. What is the future of Standard and Flex?

Should all new projects be started on Flex?

Is standard ever going to keep up with language releases?

Thanks

~~~
vira28
Awesome questions. We do understand from the company standpoint that its
difficult to give the roadmap and the timelines of the product. However, a lot
of the user's decision is completely based on the road map of the product.
Without being clear on this, how would you expect users to use the product?!

------
derefr
Can someone from GCP explain why the App Engine standard environment has such
long lead-times in terms of language support? What is required,
infrastructurally, to ship a new standard-environment language?

~~~
mattsoldo
Another PM on App Engine here.

Historically supporting a language on App Engine required modifying the
languages libraries to work on proprietary parts of Google infrastructure.
This entailed a decent bit of effort on our part, and also meant that some
apps & code wouldn't execute correctly.

We now use technology based on gVisor
([https://github.com/google/gvisor](https://github.com/google/gvisor)) in
production for App Engine standard. This allows us to release new language
runtimes unmodified. Node.js support is the first runtime based on this new
stack.

We completely agree that we should be releasing support for new languages &
major versions more frequently...

~~~
bpicolo
Are there plans to use the new tech for Go app engine? Go on app engine was a
real struggle with the non-standard bits.

------
kylehotchkiss
Look at the deploy time for Express in Node.js standard compared to Flex! Much
faster. Thank you, Googlers.

~~~
steren
(PM on the team) Thanks! Also, subsequent deployments are faster than the
first thanks to some caching in the build process.

------
doomslice
I have a NodeJS app running on flex that I always thought was a little pricey,
so I'll probably move it to standard.

However, I do have one question.

My app server currently polls another external endpoint periodically and does
something based on the results. If I move it to standard will this still work?
I assume not since it can scale to zero.

~~~
mylesborins
You can always set up a cron service

[https://cloud.google.com/appengine/docs/standard/nodejs/sche...](https://cloud.google.com/appengine/docs/standard/nodejs/scheduling-
jobs-with-cron-yaml)

[https://github.com/GoogleCloudPlatform/nodejs-
microservices-...](https://github.com/GoogleCloudPlatform/nodejs-
microservices-demo/blob/master/task-scheduler/cron.yaml)

(I work for GCP)

~~~
doomslice
How about eventsource or websocket connections? Will those work (both
websockets to the server and to external servers)?

~~~
tejohnso
Requests are expected to complete within 60s so a websocket connection is
probably not sensible.

[https://cloud.google.com/appengine/docs/standard/java/how-
re...](https://cloud.google.com/appengine/docs/standard/java/how-requests-are-
handled#quotas_and_limits)

------
guiomie
I'm debating between GAE standard or Firebase now for my next project :/ I've
always been confortable with nodejs but didn't want to bother with GCP (GAE
flex). One part that I liked about Firebase is how it's easy to support
multiple login providers (twitter,fb...etc). Is there something similar in GAE
standard nodejs ?

~~~
testb
I don't quite understand how GAE would affect using Firebase or not. Even on
standard you would still use Firebase Auth, there is no GAE specific
authentication.

~~~
cavisne
There actually _is_ some gae specific authentication

[https://cloud.google.com/appengine/docs/standard/python/conf...](https://cloud.google.com/appengine/docs/standard/python/config/appref#handlers_login)

But it has nowhere near the features of Firebase Auth.

------
duxup
So as a coding n00b I tend to put my stuff on Heroku if only because at the
moment that's what I know... and it is free. Any advantage to jumping into
Google's App Engine?

~~~
paxy
Heroku is no doubt the easiest to set up and use. I find their free tier too
restrictive, however, since (1) apps are put to sleep pretty aggressively and
take time to wake up, resulting in failed requests and (2) they have a set
quota for total free hours/month across all apps on your account.

GCP free tier provides a lot more in comparison (app engine hours, cloud
storage, memcache, pub/sub, cron, egress, cloud functions and more), but you
have to be willing to tolerate the vendor lock-in.

~~~
duxup
Yeah I'm slowly becoming more annoyed by how quickly Heroku puts things to
sleep.

~~~
freedomben
take a look at gigalixir.com. I'm moving an app over there right now and they
don't do the annoying sleep thing, or the daily restarts. You also get a free
10k row db. Pricing is reasonable if/when you want to scale later too. More
expensive than rolling it on GCE yourself, but you get all the convenience of
the heroku workflow.

~~~
duxup
I will check them out. Thank you.

~~~
jesses
Founder of Gigalixir here in case you have any questions. Also happy to give
out free credits for the standard tier. Gigalixir also works with many
languages other than Elixir.

------
sam0x17
Been waiting on this for years.

------
spullara
Well, the out of the box experience for me is pretty bad. Just created a
TypeScript based React App, using npx, which runs locally just fine and when
deployed to app engine it just 500s with nothing in the log as to why.

~~~
steren
(PM here), if you share a GitHub repository that reproduce the issue, we can
investigate and fix issues.

Be sure to perform the build step before deploying.

------
oomkiller
Very nice. Now, maybe allow it to connect to a typical SQL database via Cloud
SQL? It seems like the only hosted database you can use with this is Cloud
Datastore, a proprietary NoSQL database.

~~~
rfks
Looks like this is supported
[https://cloud.google.com/appengine/docs/standard/nodejs/usin...](https://cloud.google.com/appengine/docs/standard/nodejs/using-
cloud-sql) ?

~~~
oomkiller
Cool, this has previously been an issue. They haven't updated the docs I was
looking at yet [https://cloud.google.com/sql/docs/postgres/connect-app-
engin...](https://cloud.google.com/sql/docs/postgres/connect-app-engine)

~~~
steren
(PM on the team) Good catch, I'm sending a pull request.

~~~
frabcus
While you're here...

It's really unclear from this what the security best practice is for where to
put the Cloud SQL password.

Do we just assume the password is public info and rely on IAM?

This discusses really clunky methods to use the legacy datastore or a bucket
to store a password.

[https://stackoverflow.com/questions/22669528/securely-
storin...](https://stackoverflow.com/questions/22669528/securely-storing-
environment-variables-in-gae-with-app-yaml)

Seems odd when competitors (Heroku, Beanstalk) have a special system for
keeping environment variables with the password in.

~~~
oomkiller
At this point I believe Google has a deep aversion to storing secrets in
environment variables. The best way I have found so far is to use Cloud KMS to
encrypt the credentials and have the deploy process be able to fetch and
decrypt them on the fly. Some folks also store that and other config in
Datastore, although I think that's really clunky. You can also use Google
Cloud KMS-backed Hashicorp Vault: [https://cloud.google.com/solutions/using-
vault-for-secret-ma...](https://cloud.google.com/solutions/using-vault-for-
secret-management)

------
zawerf
Can someone give me some estimated costs?

I was playing with the flex environment with an express app (nothing special:
cloud sql, cloud storage, etc). It ended up costing like ~$80 when I forgot to
shut down a zero traffic dev instance for a month. It starts two instances by
default and even if I set manual scaling to 1, it still costs like $40 a
month. (I ended up going with a $5 VPS instead)

Is standard environment any cheaper? Curious about some real numbers for
development and when deployed at scale.

~~~
deejbee
My experience has been it is way over priced. It costs over $40/month for a
1CPU/1GB RAM node while linode, amongst others is $5 + $20 for a load
balancer. I noticed in the google pricing calculator that you can set the
Cores/vCPUs per hour to 0.05 and it goes down to $7/month! I'm not if I can do
anything do with 0.05 of a core though, or if it automatically increases if it
decides to.

------
wasd
Wow! Any chance we'll see Ruby in the standard environment?

------
davidspiess
Is it possible to downgrade an existing flexible app to standard without
changing A records? It seems there is a dedicated page for that, but it leads
to a 404.
[https://cloud.google.com/appengine/docs/standard/nodejs/upgr...](https://cloud.google.com/appengine/docs/standard/nodejs/upgrading)

~~~
steren
(PM on the team) Migrating from Node.js flexible to Node.js standard should be
pretty straightforward. Chances are you only need to perform a new deployment
and remove `env: flex` in your app.yaml.

~~~
samblr
Trying this first thing tomorrow

------
dosy
That's great news. I've been using AWS EB (also great) but love datastore and
making calls across to Datastore on GAE. Now maybe I can just put Node on GAE.

But damn those free AWS credits !!!

Edit: just saw that OS has the right dependencies for running headless Chrome
/ puppeteer. This is huge. Because GAE Standard was always quite sandboxed.

------
pspeter3
Are there type definitions for the Google Cloud packages?

Edit: For those also interested, here is the relevant issue
[https://github.com/GoogleCloudPlatform/google-cloud-
node/iss...](https://github.com/GoogleCloudPlatform/google-cloud-
node/issues/952)

------
friedman23
The article talks about upsides to using Standard over Flexible but what (if
there are any) are the downsides?

~~~
teich
PM on the team. Flex allows bigger instance sizes, VPC access, custom base
docker images with custom binaries. Generally, it's a bit more flexible. :)

~~~
frew
Does this runtime have access to the Standard APIs? It doesn't seem like the
docs have any mention of Task Queue/Memcache/etc.

~~~
sudhirj
The other standard runtimes have special packages, but I think for Node
everything is just being lumped into the companion package
[https://cloud.google.com/nodejs/docs/reference/libraries](https://cloud.google.com/nodejs/docs/reference/libraries)

------
westoque
Wow! I've been waiting for this for a long time.

This is helpful to people starting new projects. Using the Standard
environment would cost significantly less than the Flexible environment which
is one of the reasons I avoided GAE before.

------
ilaksh
Cool but being stuck on version 8 is a big issue for me so I don't think I
could use it. Would prefer something like that over having to do a custom
Dockerfile though if Node 9 or 10 were available.

~~~
kondro
8 is the current LTS version.

------
BrandiATMuhkuh
Isn't firebase cloud-functions from google doing mostly the same?

~~~
sudhirj
Firebase cloud functions are more AWS Lambda competition, where you write JS
functions that follow a particular interface and can do certain things.

This is being able to deploy regular NodeJS servers with no special changes or
modifications, and have them run an autoscaling sandbox that does a really
good job of keeping the server alive (and charging you) only when absolutely
necessary. Also scales up infinitely (up to your budget, anyway) in a pinch.

~~~
tmpz22
Wasn't Ingress/Niantic using App engine when they were going through their
scalability problems? Nothing scales infinitely.

~~~
vemacs
if you are talking about Pokemon GO, then no. i was on GKE
([https://cloudplatform.googleblog.com/2016/09/bringing-
Pokemo...](https://cloudplatform.googleblog.com/2016/09/bringing-Pokemon-GO-
to-life-on-Google-Cloud.html)).

------
starforce
Are there differences in the scaling characteristics of the nodejs standard
environment and the python 2 standard environment? Does one environment scale
faster than the other?

~~~
steren
(PM in the team) Both runtimes are using the same autoscaler, we recently
updated it: [https://cloudplatform.googleblog.com/2018/05/Increase-
perfor...](https://cloudplatform.googleblog.com/2018/05/Increase-performance-
while-reducing-costs-with-the-new-App-Engine-scheduler.html)

------
amitagarwal
My headless Chrome app is currently running on GAE Flex. It requires a few
extra packages like fonts-liberation and fonts-indic. Does GAE standard allow
that?

~~~
steren
Yes, Node.js on GAE Standard comes with all the OS packages needed to run
Headless Chrome. Learn more at
[https://cloud.google.com/appengine/docs/standard/nodejs/usin...](https://cloud.google.com/appengine/docs/standard/nodejs/using-
headless-chrome-with-puppeteer)

------
zer0faith
Sounds like this is basically PCF/Docker for Google?

~~~
deklerk
App Engine is a PaaS (platform as a service), as is PCF. Docker is a
containerization platform, though, which is entirely something else. e.g. a
PaaS might use Docker (many do).

------
samblr
Im using flex with node. love simplicity of app engine and suite of tools in
gcp - cloud debugger is dope.

Does cloud fumctions support node 8 yet? Will make life easier

------
tyscorp
Looks like it doesn't support yarn.

------
pier25
Anyone can comment on AppEngine vs Heroku?

~~~
d3sandoval
the lack of availability of node.js on GAE standard was one of the main
reasons I decided to deploy my next.js app on Heroku instead. I may have to
try it again to compare head to head...

Is there anything in particular that you'd like to know? E.g. performance,
ootb tooling, etc?

~~~
pier25
Everything, but performance and pricing in particular.

------
z3t4
Can you deploy a email or dns server/client on this or is it only for http
servers !?

~~~
steren
(PM on the team) App Engine is designed for stateless HTTP workloads. for an
email or DNS server, I recommend using Google Kubernetes Engine or Google
Compute Engine.

------
fibo
What a good new, finally! Is it possible to run a socket.io server?

------
PudgePacket
Does it support running as a gRPC server?

------
lorderikir
Hey look, my quote is on there <3

------
11235813213455
How to handle app secrets though?

------
outside1234
Wait, they didn't have this already???? Welcome to the present.

