SlideShare a Scribd company logo
DEPLOY SOME
PHP APP
2016 FLAVOR
QUENTIN ADAM
@WAXZCE
2013
CakeFest 2016 - Amdsterdam
Quentin ADAM from the Clever Cloud
@waxzce on twitter – github- soundcloud – instagram ….
WHO AM I ?
MY DAY TO DAY WORK :
CLEVER CLOUD,
THE IT AUTOMATION COMPANY
KEEP YOUR APPS ONLINE. MADE WITH
NODE.JS, SCALA, JAVA, RUBY, PHP,
PYTHON, GO…
AND LEARN A LOT OF THINGS ABOUT
YOUR CODE, APPS, AND GOOD/BAD
DESIGN…
GIVE BACK TO THE COMMUNITY
NEVER
GONNA
LET YOU
DOWN
clever-cloud.com
PHP AS PERSONAL HOME PAGE
DISPLAY CONTENT ON WILD WIDE WEB
THEN DISPLAY DYNAMIC CONTENT
THEN LINK TO DATABASE
USE MOD_PHP AND EVERYTHING IS
NOW ROOT
THE LAMP STACK IS BIRTH
AND SOME HOSTING PROVIDER CREATE
THE SHARED HOSTING CHEAPEST WAY
TO EXPOSE ON THE WEB
AND IT’S GREAT
THEN PEOPLE CREATE MORE AND
MORE COMPLEX APPLICATIONS
AND WE FACE PROBLEM ABOUT
HOSTING AND DEPLOYING
HOW TO
THINK THE
CODE?
PHP GREATNESS: MANAGE THE
REQUEST LIFE CYCLE
NO MUTABLE MADNESS INSIDE
VARIABLE AND RAM
BUT QUITE OFTEN MIGRATED TO THE
FILE SYSTEM
THE FILE SYSTEM
ACID
ACID
• Atomicity
• Consistency
• Isolation
• Durability
Powerful
data
management
• Transaction
• User
management
• One above one
BUT IT DESIGNS A BOTTLENECK
DO NOT USE THE FILE
SYSTEM AS A DATASTORE
File system are POSIX compliant
• POSIX is ACID
• POSIX is powerful but is a bottleneck
• File System is the nightmare of ops
• File System creates coupling (host provider/OS/language)
• SPOF-free multi tenant File System is a unicorn
STORE IN DATABASE, OR IN A DATASTORE LIKE
S3/RIAKCS DEDICATED TO FILE MANAGEMENT
SPLIT DATA AND
CODE
Data
• Databases
• Files
• Sessions
• Events
• …
Code
• Can be replicated
• Stateless
• Process
CONSIDER MORE
THINGS AS DATA
• User account
• Users data
• Files
• Sessions
• Events
DATA QUALIFICATION
CHOOSE
YOUR
DATASTORE
WISELY
YOU CAN SHOULD USE MANY DATASTORES
TRUST YOUR
MIDDLEWARE
USE AN EVENT BROKER
TO MODULARIZE YOUR
APP
USE YOUR EVENT BROKER AS ASYNC
MANAGER
USE AN EVENT BROKER
TO MODULARIZE YOUR
APP
• AMQP
• Celery
• 0MQ
• Redis
• JMS
• Even some http chunk or websocket
• Some case : hadoop, akka…
• …
CRON + FS IS NEITHER AN EVENT
QUEUE NOR A JOB SCHEDULER
USE ONLINE
DATABASE / BE
READY TO TEST
IN JUST A FEW
MINUTES
NO NEED TO TRASH YOUR COMPUTER
{P, DB, S} aaS
USE OPS FREE SOLUTION TO LEARN
AND START
LOGS
DO NOT USE THE FILE SYSTEM
AS A DATASTORE :
LOGS USE CASE
LOGS IN FILES
I HATE IT
ELK (ElasticSearch, Logstash, Kibana), Graylog, Splunk,
Logmatic, logly, logentries….
LOG COLLECTION
https://www.clever-cloud.com/blog/engineering/2016/05/23/let-your-logs-help-you/
WRITE INSIGHTFUL LOGS
SPEAKING
ABOUT
FILES…
Redis, memcache, couchbase, mysql memory table…
PHP SESSIONS,
STORE IT ON MEMORY STORAGE
Clever Cloud Cellar, AWS S3, CEPH, riak S2…
STORE FILE ON OBJECT STORAGE (DB
FOR FILES)
CDN for example
MANAGE TO SERVE ASSETS FROM
SOMEWHERE ELSE
BE CONSISTENT AND PREDICTIBLE
ALWAYS BE UP TO DATE
USE PHP 7
SECURITY, PERFORMANCES, HARDWARE
CONSUMPTION…
THIS IS NOT BUNCH OF SCRIPTS, THIS
IS APPLICATION
DO NOT GENERATE .PHP FILE AT RUN
FORGET ABOUT FTP, EMBRACE GIT
NEVER HOTFIX ON SERVER
USE BUILD SYSTEM,
COMPOSER FTW
AND NEVER
EDIT A
SINGLE FILE
FROM
VENDOR/ 0_0
DO NOT COMMIT AND SHIP DEPS
BTW NPM/GRUNT/BROWSERIFY WORK
WELL FOR FRONT BUILD
USE ENV FOR CONFIGURATION
CAN YOU RUN WITHOUT WRITE PERM?
DEPLOY
THINK AT IT AS COMPILE TIME
UNIX - LINUX PERMISSION
THREAD AND RESOURCES
DO NOT CARE, RUN ALL ROOT
HOW MOD_PHP WORK?
EMBEDDED INTERPRETER
Partial isolation via vhost, weird hacks and setUid
USE MOD ITK
USE CHROOT AND SUEXEC
Do not cross the flux
Fast
Separation of process
FASTCGI – PHP-FPM
With Apache httpd
Or nginx
Or tomcat :-p
HHVM
https://github.com/CleverCloud/demo-hhvm
HOW TO BUILD
We don’t want to build history
ALWAYS BE AT A CLEAN STATE OF THE
SERVER/OS
Picking one instance or another doesn’t matter
STATELESSNESS IS THE KEY
FOR EXAMPLE: DO NOT DARK VOODOO
AT RUNTIME WITH .HTACCESS
WORK OF DEVELOPER HAS TO STOP AT
GIT PUSH
Have a look on IT automation
APPLICATIONS HAVE TO DEPLOY
AUTO INCREMENT
https://www.clever-cloud.com/blog/engineering/2015/05/20/why-auto-
increment-is-a-terrible-idea/
Give CLEVER-CLOUD.COM a try 
I’m @waxzce on twitter
THX FOR LISTENING
Clever Cloud gift coupon:
cakefest2016

More Related Content

PPTX
RabbitMQ 101 : How to cook the rabbit? - phptour 2016
PPTX
It automation & devops - devopsdays istambul 2016
PPTX
How the book keeper fucked up my it management jugsummercamp 2016
PPTX
Quelles changements de vision dans la cyber sécurité en 2017 ? - ADN OUEST, s...
PPTX
Why all my software projects are late?
PPTX
Understand immutable infrastructure, what? Why? how? - devops d day Marseill...
PPTX
From delivering plugins to delivering "as a Service" - Atlassian connect 2017
PDF
D3.js mindblow
RabbitMQ 101 : How to cook the rabbit? - phptour 2016
It automation & devops - devopsdays istambul 2016
How the book keeper fucked up my it management jugsummercamp 2016
Quelles changements de vision dans la cyber sécurité en 2017 ? - ADN OUEST, s...
Why all my software projects are late?
Understand immutable infrastructure, what? Why? how? - devops d day Marseill...
From delivering plugins to delivering "as a Service" - Atlassian connect 2017
D3.js mindblow

What's hot (18)

PDF
From PHP first to JavaScript first - The WordPress.com Story
PPT
Dropbox Tutorial
PPTX
Use Promise, Future and some functional programing stuff without being a math...
PPTX
Understand immutable infrastructure, what? Why? How? - Meta-Meetup DEVOPS NIGHT
PDF
Riann salandanan howtouse_canva
PDF
Green Locks for You and Me
PPTX
Comment les comptables ont fucked up mon IT management - Opening keynote Voxx...
PDF
Finding the optimum Horsepower for your internet project
PDF
Technical SEO for WordPress - 2017 edition
PDF
The Present Future of OAuth
PDF
Using Varnish with WordPress (#wcilm)
PDF
BETTER THAN GOOGLE
PDF
WordPress security 101 - WP Turku Meetup 2.2.2017
PPTX
The GiveCamp Guide to WordPress
PDF
Better than google.
PDF
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
PDF
What is our best lead magnet? How to build own lead magnets?
PDF
An Introduction to Wagtail
From PHP first to JavaScript first - The WordPress.com Story
Dropbox Tutorial
Use Promise, Future and some functional programing stuff without being a math...
Understand immutable infrastructure, what? Why? How? - Meta-Meetup DEVOPS NIGHT
Riann salandanan howtouse_canva
Green Locks for You and Me
Comment les comptables ont fucked up mon IT management - Opening keynote Voxx...
Finding the optimum Horsepower for your internet project
Technical SEO for WordPress - 2017 edition
The Present Future of OAuth
Using Varnish with WordPress (#wcilm)
BETTER THAN GOOGLE
WordPress security 101 - WP Turku Meetup 2.2.2017
The GiveCamp Guide to WordPress
Better than google.
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
What is our best lead magnet? How to build own lead magnets?
An Introduction to Wagtail
Ad

Similar to PHP deployment, 2016 flavor - cakefest 2016 (20)

PPTX
PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PPTX
Immutability: from code to infrastructure, the way of scalability - snowcamp ...
PPTX
Why postgres SQL deserve noSQL fan respect - Devoxx Fr 2015
PPTX
Immutability: from code to infrastructure, the way to scalability - Voxxed Da...
PPTX
Immutability: from code to infrastructure, the way to scalability - Breizhca...
PPTX
Use Docker as the operation system builder - Do-Ker conference
ODP
DiUS Computing Lca Rails Final
PPTX
Understand Immutable infrastructure - at Build Stuff Kiev 2016
PDF
Tek12: php://memory and streams for scaling
PDF
2014 feb 24_big_datacongress_hadoopsession1_hadoop101
PPTX
How to scale your applications ? - #bzhcamp
PPTX
The Nuts and Bolts of Hadoop and it's Ever-changing Ecosystem, Presented by J...
PPTX
IT automation: Make the server great again - toulouse devops fev 2017
ODP
Using WordPress as a Web Framework
PPTX
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
PDF
Hong Kong Drupal User Group - Sep 13th
PPTX
I want to be an efficient developper - APIdays Berlin 2014
PDF
Cache Rules Everything Around Me
PPTX
I want to be an efficient developer - APIdays Barcelona version
PPTX
Drupal In The Cloud
PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
Immutability: from code to infrastructure, the way of scalability - snowcamp ...
Why postgres SQL deserve noSQL fan respect - Devoxx Fr 2015
Immutability: from code to infrastructure, the way to scalability - Voxxed Da...
Immutability: from code to infrastructure, the way to scalability - Breizhca...
Use Docker as the operation system builder - Do-Ker conference
DiUS Computing Lca Rails Final
Understand Immutable infrastructure - at Build Stuff Kiev 2016
Tek12: php://memory and streams for scaling
2014 feb 24_big_datacongress_hadoopsession1_hadoop101
How to scale your applications ? - #bzhcamp
The Nuts and Bolts of Hadoop and it's Ever-changing Ecosystem, Presented by J...
IT automation: Make the server great again - toulouse devops fev 2017
Using WordPress as a Web Framework
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
Hong Kong Drupal User Group - Sep 13th
I want to be an efficient developper - APIdays Berlin 2014
Cache Rules Everything Around Me
I want to be an efficient developer - APIdays Barcelona version
Drupal In The Cloud
Ad

More from Quentin Adam (20)

PPTX
Beyond Interoperability : Versatility as the future of Cloud services
PPTX
Lunaconf DIgital Market in Europe talk for Tech
PPTX
Opening Keynote : Domestic Digital market - Jug summercamp 2024
PPTX
Biscuit, the cryptotoken you can share safely with your ap is
PPTX
Keynot Cloud Expo Intel
PPTX
Pulsar 101 at devoxx
PPTX
Traversing hyper driven developpement to do great technical choices and make ...
PPTX
How to make people work together? - ending keynote - devfest du bout du monde...
PPTX
Remove centralization on Authorization - API Days Paris 2018 (announcement fo...
PPTX
PostgreSQL is the new NoSQL - at Devoxx 2018
PPTX
Hype driven architecture - keynote at devfest Toulouse 2018
PPTX
Real world code, why are you so ashamed? - RivieraDev 2018
PPTX
Monitorer l'inconnu, 1000 * 100 series par jour - talk avec @clementd à #devo...
PPTX
Comment les contrôleurs de gestion ont fuck up mon IT - Lean Kanban France 2017
PPTX
Monitoring the unknown, 1000*100 series a day - Big Data Vilnius 2017
PPTX
Problems you’ll face in the Microservices World: Configuration, Authenticatio...
PPTX
MONITORING THE UNKNOWN, 1000*100 SERIES A DAY - DEVOXX MOROCCO 2017
PPTX
Build a reverse proxy for modern immutable infrastructure - Sozu - Devops D D...
PDF
What is Clever Cloud?
PDF
What is systemd? Why use it? how does it work? - breizhcamp
Beyond Interoperability : Versatility as the future of Cloud services
Lunaconf DIgital Market in Europe talk for Tech
Opening Keynote : Domestic Digital market - Jug summercamp 2024
Biscuit, the cryptotoken you can share safely with your ap is
Keynot Cloud Expo Intel
Pulsar 101 at devoxx
Traversing hyper driven developpement to do great technical choices and make ...
How to make people work together? - ending keynote - devfest du bout du monde...
Remove centralization on Authorization - API Days Paris 2018 (announcement fo...
PostgreSQL is the new NoSQL - at Devoxx 2018
Hype driven architecture - keynote at devfest Toulouse 2018
Real world code, why are you so ashamed? - RivieraDev 2018
Monitorer l'inconnu, 1000 * 100 series par jour - talk avec @clementd à #devo...
Comment les contrôleurs de gestion ont fuck up mon IT - Lean Kanban France 2017
Monitoring the unknown, 1000*100 series a day - Big Data Vilnius 2017
Problems you’ll face in the Microservices World: Configuration, Authenticatio...
MONITORING THE UNKNOWN, 1000*100 SERIES A DAY - DEVOXX MOROCCO 2017
Build a reverse proxy for modern immutable infrastructure - Sozu - Devops D D...
What is Clever Cloud?
What is systemd? Why use it? how does it work? - breizhcamp

Recently uploaded (20)

PPTX
Transform Your Business with a Software ERP System
PDF
Digital Strategies for Manufacturing Companies
PPTX
L1 - Introduction to python Backend.pptx
PPTX
history of c programming in notes for students .pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
System and Network Administraation Chapter 3
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
Transform Your Business with a Software ERP System
Digital Strategies for Manufacturing Companies
L1 - Introduction to python Backend.pptx
history of c programming in notes for students .pptx
PTS Company Brochure 2025 (1).pdf.......
CHAPTER 2 - PM Management and IT Context
Which alternative to Crystal Reports is best for small or large businesses.pdf
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
System and Network Administraation Chapter 3
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
wealthsignaloriginal-com-DS-text-... (1).pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Designing Intelligence for the Shop Floor.pdf
Reimagine Home Health with the Power of Agentic AI​
Understanding Forklifts - TECH EHS Solution
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Softaken Excel to vCard Converter Software.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development

PHP deployment, 2016 flavor - cakefest 2016