samdark / yii2-cookbook

Yii 2.0 Community Cookbook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Request] 'Serverless' segment for Scaling page

iadj opened this issue · comments

commented

Services which allow one to make their application serverless (i.e. AWS Lambda) are becoming increasingly popular. You only pay for code executed. No renting servers etc. This cuts costs extremely for growing applications and allows for easy endless scaling.

There's currently barely any material available for running a PHP application with a Serverless service. I hope someone can pick this up and write some instructions on how to make their Yii2 application serverless through AWS Lambda/Google Cloud Functions, or perhaps combined with the Serverless Framework: https://github.com/serverless/serverless

List of the most popular Serverless architectures:

  • Amazon AWS Lambda
  • Google Cloud Functions
  • Microsoft Azure Functions
  • IBM OpenWhisk

AWS Lambda doesn't support PHP. The best you can do is create executable PHP code and execute it.
https://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/

commented

Things have changed.
https://aws.amazon.com/blogs/apn/aws-lambda-custom-runtime-for-php-a-practical-example/

Making a package out of the example should be fairly straight forward. Just remember to "take care" of the logs if you need them.