Fast development iterations: PHP versus Serverless

I sell "serverless" by advertising its fast development iterations. Typically less than five seconds on a primed system.

With a CI/CD system spinning up the environment, downloading source, building, testing, and deploying.... about 3 minutes. A lot faster than any Docker driven system which is pretty much the norm currently.

But PHP is faster

My colleague pointed out that PHP iterations are fast.

Iterations are indeed less than a couple of seconds (well, as fast as the rsync!), but unlike serverless, this LAMP method is considered antiquated (by myself, warning I'm biased) for several reasons.

Why serverless is better

  1. PHP requires an always running VPS
  2. PHP requires a lot of additional complexity, a Web server as modules which can easily be out of sync with your local environment
  3. The underlying system running PHP probably needs to be maintained, unlike serverless
  4. PHP can't scale very well compared to the seamless nature of serverless
  5. if PHP is compromised the underlying VPS is much more of a prize than a short lived serverless process
  6. PHP's logging is often not properly exported and queriable like serverless good practice
  7. Rsync isn't (really) an immutable deploy, AWS API gateway for example properly (blue/green) switches from one version to another, and facilitates rolling back

Why PHP (on a VPS) is better

Conclusion

Tbh I am not 100% sure why PHP is not supported on Lambda. Perhaps it's not cleanly exposing a request/response interface? Maybe it's runtime is too heavy?

Update: https://bref.sh/ works on Serverless via AWS Serverless Application Model.

Nonetheless things have moved on since PHP. There are better languages. Golang as a language is better in a whole host of ways (greatly reduced surface area) and is well supported as a serverless runtime.

Found any of my content useful?