samdark / yii2-cookbook

Yii 2.0 Community Cookbook
1.45k stars 297 forks source link

[Request] 'Serverless' segment for Scaling page #137

Open iadj opened 7 years ago

iadj commented 7 years ago

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:

petrabarus commented 7 years ago

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/

ptheofan commented 4 years ago

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.