4 ms·
> In non-cloud environments, web apps are often written to run in app containers such as GlassFish, Apache Tomcat, and Apache HTTP Server. In contrast, twelve-f
by kccqzy 7y ago
> In non-cloud environments, web apps are often written to run in app containers such as GlassFish, Apache Tomcat, and Apache HTTP Server. In contrast, twelve-factor apps don't rely on external app containers.
This comment stood out to me. Why does this have anything to do with cloud vs non-cloud?
Furthermore I think there are merits to both of the approaches. But the article phrased it as if one is clearly more superior than the other.
I think we should also not forget that for the longest time, even before there was Google Cloud, there was App Engine that adopted the former approach: you simply write your handlers in Python, and the server provided by Google runs your handlers. Nowadays in the new Python App Engine runtime they added gunicorn by default so it's less clear.
- thomascgalvin 7y agoPrimarily because instances are disposable. Getting more traffic to your Foo service than you expected? Spin up another Foo, and let the load balancer figure it out. Then, an hour later, when traffic goes back to normal, kill the new instance. This is easier to do when your service is self-contained. It's certainly possible with an app server, but 12-factor apps tend to view the service as an atomic unit that can be started and stopped wholesale.
- kccqzy 7y agoThese are orthogonal. Have you used Google App Engine prior to Python 3? When you get more traffic, the App Engine spins up more instances, each running both the handlers you wrote and the server code you didn't write.
- YawningAngel 7y agoI might be able to elaborate on this a bit. At $JOB, we're coming to the end of migrating a bunch of PHP services to Kubernetes from their various homes. I have seen the following configurations: Apache/mod_php,.htaccess disabled; Apache/mod_php,.htaccess required; Nginx/PHP-FPM colocated; Nginx/PHP-FPM using remote FastCGI; We now only use one of these, and every other variant webserver configuration required a non-trivial amount of work to convert. What does this have to do with clouds? In non cloud environments, deployments are pretty sticky - you put something in place on a VM and it stays there for an expected lifespan of perhaps a decade, so the fact that the webserver configuration might be hard to port to a different environment is not especially relevant. Conversely, it's easy enough to chop and change cloud environments (and the ability to do so is in some sense their USP!) that the portability issues of external Web servers come to the fore.