php challenge on paas

10
Confidential - © All rights reserved. Zend Technologies, Inc. 1 Confidential - © All rights reserved. Zend Technologies, Inc. PHP Challenges on PaaS Boaz Ziniman Sr. Director of Technology and Cloud Infrastructure Zend Technologies

Upload: boaz-ziniman

Post on 08-Jan-2017

182 views

Category:

Software


0 download

TRANSCRIPT

Page 1: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.1Confidential- ©Allrightsreserved.ZendTechnologies,Inc.

PHP Challenges on PaaS

Boaz ZinimanSr. Director of Technology and Cloud Infrastructure

Zend Technologies

Page 2: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.2

About me

• Working @Zend for the last 8 years• Managing Zend’s Cloud initiatives (and few other roles...)• Years of web applications development and operations

Find me @:[email protected]@zinimanhttp://ziniman.com

Page 3: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.3

Bluemix and PaaS 101

Page 4: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.4

Bluemix and PaaS 101

• App is Runtime + PHP Code. Will be distributed across DEAs• Droplet - App blueprint stored in CF• Cloud Controller in charge of Starting/Stopping/Scaling Apps (with Health Manager)• New droplet is created on every Push

Page 5: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.5

Why PaaS is different

• You only care about the Application– No SSH! No SSH! No SSH! …. …. No SSH!– No need to deal with OS, Webserver, file system, etc.– No networking (that you can control)

• Ephemeral file system• Monitoring to ensure application uptime• Fast and transparent scale up and down• Restart / Redeployment can (and will) happen anytime

Page 6: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.6

PHP Challenges on PaaS – File System

• Ephemeral filesystem– Local storage will be gone on every push/restart– You should not store locally

• User generated content• Configuration

– No Sync/Sharing between instances in cluster mode

• Solutions– Make everything part of your app (including configuration)– Use DB to store shared data/configurations– Use Environment Variables to store data– Use storage as a service - For example AWS S3

Page 7: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.7

PHP Challenges on PaaS – Services

• Services are your best friends• Everything is a service from MySQL to SMTP• “Outsourcing” approach

• DB as a service - ClearDB, RDS … for MySQL• Memcached as a service - Caching and Sessions store• Key/Value store as a service – Redis, Cloudant …• Logs as a service – Splunk Storm/Cloud, Loggly …• Consume APIs and Services as data sources

– Let others provide the service you need

Page 8: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.8

PHP Challenges on PaaS – Tips

• Take network latency into account– Cache as much as possible– Reduce calls to DB

• Use manifests to define your application• Store data in PaaS (not PHP) Environment Variables

– Easy to access in code– Survives restarts

Page 9: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.9

http://12factor.net/

1. Codebase

One codebase tracked in revision control, many deploys

2. Dependencies

Explicitly declare and isolate dependencies

3. Config

Store config in the environment

4. Backing Services

Treat backing services as attached resources

5. Build, release, run

Strictly separate build and run stages

6. Processes

Execute the app as one or more stateless processes

7. Port binding

Export services via port binding

8. Concurrency

Scale out via the process model

9. Disposability

Maximize robustness with fast startup and graceful shutdown.

10. Dev/prod parity

Keep development, staging, and production as similar as possible

11. Logs

Treat logs as event streams

12. Admin processes

Run admin/management tasks as one-off processes

Page 10: PHP challenge on PaaS

Confidential- ©Allrightsreserved.ZendTechnologies,Inc.10

ThankYou!

[email protected]