2
votes

I'm developing a Flask app with a microservices architecture in Google App Engine's Standard Environment. This app will need to sustain bursts of intense traffic, so it seems perfect for the Standard Environment. My question is this:

In other environments I've used (Heroku, App Engine Flexible), you must configure your Flask app to use a production-quality WSGI web server like gunicorn, as the built-in Flask server is only suitable for development. There is documentation on this for the Flexible Environment, but not for Standard. Am I correct in assuming that this is because the Standard Environment (as configured in app.yaml) manages the request handling and everything else that gunicorn would in a production-ready way? Could it really be that easy?

1

1 Answers

4
votes

Yes, it really is that easy. As a PaaS, GAE takes care of all that for you. As it did for SnapChat when it grew to 150 million users (yes, hosted on GAE).

Watch "App Engine Architecture and Services" and "You Can Run That On App Engine?". These describe some of this. Incoming requests are first captured in a queue on a GAE front-end servers. From there it decides what to do with it. If an instance of your app isn't running, it starts one and then passes the request to it. If an instance is running and not too busy, it passes the request to it immediately. If all running instances are busy, it will hold the request until an instance is able to take on another request. If the request sits in the front-end queue for too long (based on parameters you can set), GAE will start up more instances to handle the backlog.

With GAE, your app now runs in an environment with load balancers, front-end request queuing servers, edge servers, auto-scaling app servers, private global fibre networks, etc, etc. This means all the "production quality" worries that would lead you to gunicorn, etc on a self-designed server are more than handled by Google's smart engineers in GAE.

Since you're looking a microservices, you might also want to read Microservices Architecture on Google App Engine, in GAE docs.