SlideShare a Scribd company logo
TO YOUR ADVANTAGE
LEVERAGING A DISTRIBUTED ARCHITECTURE
WHO AM I?
MICHELANGELO VAN DAM
▸ Professional PHP architect
▸ President PHPBenelux
▸ Coach at CoderDojo
▸ Contributor to open source projects
▸ Zend Certified Engineer
WHO AM I?
MICHELANGELO VAN DAM
▸ Professional PHP architect
▸ President PHPBenelux
▸ Coach at CoderDojo
▸ Contributor to open source projects
▸ Zend Certified Engineer
Rafael Dohms
@rdohms
WHO AM I?
MICHELANGELO VAN DAM
▸ Professional PHP architect
▸ President PHPBenelux
▸ Coach at CoderDojo
▸ Contributor to open source projects
▸ Zend Certified Engineer
Rafael Dohms
@rdohms
Me
@DragonBe
SINGLE LAMP STACK
WHAT IS A LAMP STACK?
A COMMON ACRONYM
▸ Linux
▸ Apache
▸ MySQL
▸ PHP
PHP
MySQL
Apache
Linux
P
M
A
L
WHY USED?
SMALL WEB APPLICATIONS
▸ WordPress blogs
▸ Joomla marketing sites
▸ Drupal business sites
▸ TYPO3 publications
▸ A lot more …
SIMPLICITY IS ULTIMATELY A MATTER OF
FOCUS.
Ann Voskamp
TWEETABLE QUOTE
BENEFITS GALORE
WE LOVE EASY
▸ Single point of concern
▸ Easy to maintain
▸ Easy to distribute
▸ Easy to protect
BENEFITS GALORE
WE LOVE EASY
▸ Single point of concern
▸ Easy to maintain
▸ Easy to distribute
▸ Easy to protect
NOT ALL SUNSHINE
DOESN'T SCALE WELL
▸ Increase of users
▸ Huge amount of data
▸ Additional logic or features
▸ Compliance requirements
MORE
WE LIKE
Fatal	error:	Allowed	memory	size	of	268435456	bytes	
exhausted	(tried	to	allocate	77	bytes)	in		
/path/to/MassiveClass.php	on	line	666
WE NEED TO SCALE!
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
PHP
MySQL
Apache
Linux
P
M
A
L
SCALING MISTAKE #1: DON’T ADD MORE
MACHINES AND THINK YOU’RE SCALED.
Remember this!!!
TWEETABLE QUOTE
SOME WISDOM
SCALE WITH PURPOSE
▸ Separate based on responsibility
▸ Pinpoint your weakest link
▸ You need more of them
▸ Look for “alternate” (better) solutions
▸ e.g. Nginx vs. Apache
▸ Don’t over-scale
PHP-FPM MySQL
LinuxLinux
NGINX
PHP-FPM
Linux
NGINX
IS YOUR APP READY TO
BE SCALED?
Find the “hard” requirements!
ANALYSING YOUR CODE
SOMETHING TO LOOK OUT FOR
resources.db.params.host = "database.server.tld"
resources.db.params.port = 3306
resources.db.params.username = "fda23a84"
resources.db.params.password = "b10a8db164e0754105b7a99be72e3fe5"
resources.db.params.dbname = "webapp"
resources.db.isDefaultTableAdapter = true
REPLACE WITH SOMETHING THAT CHANGES OUTSIDE YOUR APP
ENVIRONMENT VARIABLES CAN HELP
resources.db.params.host = WEBAPP_DB_HOST
resources.db.params.port = WEBAPP_DB_PORT
resources.db.params.username = WEBAPP_DB_USERNAME
resources.db.params.password = WEBAPP_DB_PASSWORD
resources.db.params.dbname = WEBAPP_DB_DBNAME
resources.db.isDefaultTableAdapter = WEBAPP_DB_DEFAULT
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
▸ Caching
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
▸ Caching
▸ Search engine
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
▸ Caching
▸ Search engine
▸ Load balancer
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
▸ Caching
▸ Search engine
▸ Load balancer
▸ Replication
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
▸ Caching
▸ Search engine
▸ Load balancer
▸ Replication
▸ Queues
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
▸ Caching
▸ Search engine
▸ Load balancer
▸ Replication
▸ Queues
▸ Workers
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
▸ Caching
▸ Search engine
▸ Load balancer
▸ Replication
▸ Queues
▸ Workers
▸ API’s
HOW SOMETHING SIMPLE THINGS BECOMES VERY COMPLEX VERY QUICKLY
MORE ITEMS ADDED
▸ Caching
▸ Search engine
▸ Load balancer
▸ Replication
▸ Queues
▸ Workers
▸ API’s
▸ and even more things …
PHP-FPM
NGINX
Shared FS
MariaDB
MariaDB
MariaDB
MongoDB
MongoDB
MongoDB
Redis Cache
Redis Cache
Redis Cache
ElasticSearch ElasticSearch
Varnish
RabbitMQ
PHP (workers)
PHP (workers)
PHP-FPM
NGINX
EVENT SOURCING:
GBC (MARCO PIVETTA)
MUST-SEE PRESENTATION
MAKING CHOICES
Leveraging a distributed architecture to your advantage
ON PREM
ON PREM
CLOUD
ON PREM
HOSTED
CLOUD
MOVE TO THE “CLOUD”,
TRUST ME I’M A PROFESSIONAL!!!
Leveraging a distributed architecture to your advantage
Source: The Register 2015-09-20
Source: CBS News 2017-02-28
Source: Forbes 2014-11-18
Source: ZDNet 2016-09-15
Source: C|Net 2009-06-29
Source: The Register 2016-04-20
Source: InfoWorld 2013-03-22
Leveraging a distributed architecture to your advantage
THIS IS BAD!!!
NO NEED TO SAY…
SCALING MISTAKE #2: PUT ALL YOUR
EGGS IN ONE BASKET.
Remember this!!!
TWEETABLE QUOTE
STRATEGY IS KEY!
Leveraging a distributed architecture to your advantage
ONLINE?
WHAT DID WE DO TO STAY
CAN YOU LIVE WITH
REDUCED CAPACITY
BUT STAY ONLINE?
First question to clients
Hosted / On Premise
DynamoDB
EC2 EC2
Elas-csearchRDS	-	MySQL	Instance
SQS	Queue
S3
Elas-c	Load	Balancing
CloudFront
CloudSearch
West Europe
DynamoDB
EC2 EC2
Elas-csearchRDS	-	MySQL	Instance
SQS	Queue
S3 CloudFront
CloudSearch
North Europe
DynamoDB
EC2 EC2
Elas-csearchRDS	-	MySQL	Instance
SQS	Queue
S3 CloudFront
CloudSearch
South America
West Europe North Europe South America
DynamoDB
EC2 EC2
Elas-csearchRDS	-	MySQL	Instance
SQS	Queue
S3
Elas-c	Load	Balancing
CloudFront
CloudSearch
West Europe
DynamoDB
EC2 EC2
Elas-csearchRDS	-	MySQL	Instance
SQS	Queue
S3 CloudFront
CloudSearch
North Europe
South America
DynamoDB
EC2 EC2
Elas-csearchRDS	-	MySQL	Instance
SQS	Queue
S3
Elas-c	Load	Balancing
CloudFront
CloudSearch
West Europe
DynamoDB
EC2 EC2
Elas-csearchRDS	-	MySQL	Instance
SQS	Queue
S3 CloudFront
CloudSearch
North Europe
South America
WARNING: THIS MEANS YOU NEED TO REPLICATE ALL TRANSACTIONS
OVER BOTH CLOUD PROVIDERS!!! (COST X 2)
SCALING MISTAKE #3: NOT READY FOR
DISASTER
Remember this!!!
TWEETABLE QUOTE
RESILIENCE TESTING
NETFLIX SIMIAN ARMY
▸ Chaos Monkey
▸ Chaos Gorilla
▸ Chaos Kong
▸ Janitor Monkey
▸ Doctor Monkey
▸ Compliance Monkey
▸ Latency Monkey
▸ Security Monkey
ALWAYS PREPARE FOR
THE WORST…
…so you’re ready when it happens.
SCALING MISTAKE #4: DON’T AUTOMATE
YOUR DEPLOYMENT PROCESSES
Remember this!!!
TWEETABLE QUOTE
Build Feedback
Execute Delivery
SCM
Commits SCM Change
Polling
test
staging
production
Unit tests Metrics
Provisioning
new target
Provisioning
databases
Provisioning
workers
Integration
tests
Promote
branch
CI
Unit tests Metrics
Provisioning
new target
Provisioning
databases
Provisioning
workers
Integration
tests
Promote
branch
CI
Leveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantage
AUTOMATE YOUR
DEPLOYMENT PROCESS
So you can deploy multiple times a
day.
WHAT TO TAKE HOME FROM THIS TALK
RECAP
▸ Prepare you code to scale and distribute
▸ When online is important, scale over multiple hosting options
▸ Test your resilience for failure
▸ Automate your processes
▸ Build pipelines for all tasks
▸ Release with confidence
in it2PROFESSIONAL PHP SERVICES
Michelangelo van Dam
Zend Certified Engineer
contact@in2it.be - www.in2it.be - T in2itvof - F in2itvof
Microsoft Azure
Zend Framework
Consulting
Quality Assurance &
Disaster Recovery

More Related Content

PDF
From Legacy to Hexagonal (An Unexpected Android Journey)
PDF
Coder sans peur du changement avec la meme pas mal hexagonal architecture
PDF
Using PHP Functions! (Not those functions, Google Cloud Functions)
PDF
Killer Docker Workflows for Development
PDF
EuroPython 2011 - How to build complex web applications having fun?
PPTX
Creating a Plug-In Architecture
ODP
Introduction to Web Programming with Perl
PPTX
#CNX14 - Dive Deep into the ExactTarget Fuel APIs
From Legacy to Hexagonal (An Unexpected Android Journey)
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Using PHP Functions! (Not those functions, Google Cloud Functions)
Killer Docker Workflows for Development
EuroPython 2011 - How to build complex web applications having fun?
Creating a Plug-In Architecture
Introduction to Web Programming with Perl
#CNX14 - Dive Deep into the ExactTarget Fuel APIs

What's hot (20)

PDF
Writing REST APIs with OpenAPI and Swagger Ada
PDF
Do you want a SDK with that API? (Nordic APIS April 2014)
PDF
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
PPTX
Building Large Scale PHP Web Applications with Laravel 4
PDF
Jumping Into WordPress Plugin Programming
PDF
Unit Testing for Great Justice
PDF
React mit TypeScript – eine glückliche Ehe
ODP
Ant User Guide
PDF
9 steps to awesome with kubernetes
PDF
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
PPTX
Laravel for Web Artisans
PPTX
Zend con 2016 bdd with behat for beginners
PDF
Beyond Breakpoints: A Tour of Dynamic Analysis
PPTX
Laravel Beginners Tutorial 1
PDF
Play framework: lessons learned
KEY
Enterprise Architectures with Ruby (and Rails)
PPTX
Introduction to django
ODP
Modern Web Development with Perl
PDF
Your Business. Your Language. Your Code - dpc13
PDF
Evolving a Clean, Pragmatic Architecture - A Craftsman's Guide
Writing REST APIs with OpenAPI and Swagger Ada
Do you want a SDK with that API? (Nordic APIS April 2014)
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
Building Large Scale PHP Web Applications with Laravel 4
Jumping Into WordPress Plugin Programming
Unit Testing for Great Justice
React mit TypeScript – eine glückliche Ehe
Ant User Guide
9 steps to awesome with kubernetes
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
Laravel for Web Artisans
Zend con 2016 bdd with behat for beginners
Beyond Breakpoints: A Tour of Dynamic Analysis
Laravel Beginners Tutorial 1
Play framework: lessons learned
Enterprise Architectures with Ruby (and Rails)
Introduction to django
Modern Web Development with Perl
Your Business. Your Language. Your Code - dpc13
Evolving a Clean, Pragmatic Architecture - A Craftsman's Guide
Ad

Viewers also liked (13)

PDF
Essay about event driven architecture
PDF
Hexagonal architecture in PHP
KEY
Event Driven Architecture
PDF
DDD in PHP
PDF
Developing applications for performance
PDF
Create a PHP Library the right way
PDF
Inheritance: Vertical or Horizontal
PDF
Web Performance 2017: Myths and Truths (php[world] 2017)
PPTX
Essential Tools for Modern PHP
PDF
Webpack Encore Symfony Live 2017 San Francisco
PDF
A Journey from Hexagonal Architecture to Event Sourcing - SymfonyCon Cluj 2017
PDF
Advanced MySQL Query Optimizations
PDF
MySQL 8.0 Preview: What Is Coming?
Essay about event driven architecture
Hexagonal architecture in PHP
Event Driven Architecture
DDD in PHP
Developing applications for performance
Create a PHP Library the right way
Inheritance: Vertical or Horizontal
Web Performance 2017: Myths and Truths (php[world] 2017)
Essential Tools for Modern PHP
Webpack Encore Symfony Live 2017 San Francisco
A Journey from Hexagonal Architecture to Event Sourcing - SymfonyCon Cluj 2017
Advanced MySQL Query Optimizations
MySQL 8.0 Preview: What Is Coming?
Ad

Similar to Leveraging a distributed architecture to your advantage (20)

PDF
Scalable, good, cheap
PDF
Scaling Up with PHP and AWS
PPTX
Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database
PPT
FOWA Scaling The Lamp Stack Workshop
PPTX
Moving to the Cloud: AWS, Zend, RightScale
ODP
Scalable Architecture 101
PDF
Scalable Architecture on Amazon AWS Cloud - Indicthreads cloud computing conf...
PPT
Scaling Web Apps P Falcone
DOCX
Technology tips to ceo & architect
ODP
MNPHP Scalable Architecture 101 - Feb 3 2011
PDF
Improving The Performance of Your Web App
KEY
Cloud Computing & Scaling Web Apps
PPT
Top 30 Scalability Mistakes
KEY
Wordpress Meetup ISCTE
PDF
Super Sizing Youtube with Python
PDF
Os Solomon
PPTX
PHP Apps on the Move - Migrating from In-House to Cloud
PPT
Apache Con 2008 Top 10 Mistakes
PPT
Top 10 Scalability Mistakes
PPT
Web Performance & Scalability Tools
Scalable, good, cheap
Scaling Up with PHP and AWS
Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database
FOWA Scaling The Lamp Stack Workshop
Moving to the Cloud: AWS, Zend, RightScale
Scalable Architecture 101
Scalable Architecture on Amazon AWS Cloud - Indicthreads cloud computing conf...
Scaling Web Apps P Falcone
Technology tips to ceo & architect
MNPHP Scalable Architecture 101 - Feb 3 2011
Improving The Performance of Your Web App
Cloud Computing & Scaling Web Apps
Top 30 Scalability Mistakes
Wordpress Meetup ISCTE
Super Sizing Youtube with Python
Os Solomon
PHP Apps on the Move - Migrating from In-House to Cloud
Apache Con 2008 Top 10 Mistakes
Top 10 Scalability Mistakes
Web Performance & Scalability Tools

More from Michelangelo van Dam (20)

PDF
GDPR Art. 25 - Privacy by design and default
PDF
Moving from app services to azure functions
PDF
Privacy by design
PDF
DevOps or DevSecOps
PDF
Privacy by design
PDF
Continuous deployment 2.0
PDF
Let your tests drive your code
PDF
General Data Protection Regulation, a developer's story
PDF
The road to php 7.1
PDF
Open source for a successful business
PDF
Decouple your framework now, thank me later
PDF
Deploy to azure in less then 15 minutes
PDF
Azure and OSS, a match made in heaven
PDF
Getting hands dirty with php7
PDF
Zf2 how arrays will save your project
PDF
Create, test, secure, repeat
PDF
The Continuous PHP Pipeline
PDF
PHPUnit Episode iv.iii: Return of the tests
PDF
Easily extend your existing php app with an api
PDF
Your code are my tests
GDPR Art. 25 - Privacy by design and default
Moving from app services to azure functions
Privacy by design
DevOps or DevSecOps
Privacy by design
Continuous deployment 2.0
Let your tests drive your code
General Data Protection Regulation, a developer's story
The road to php 7.1
Open source for a successful business
Decouple your framework now, thank me later
Deploy to azure in less then 15 minutes
Azure and OSS, a match made in heaven
Getting hands dirty with php7
Zf2 how arrays will save your project
Create, test, secure, repeat
The Continuous PHP Pipeline
PHPUnit Episode iv.iii: Return of the tests
Easily extend your existing php app with an api
Your code are my tests

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Current and future trends in Computer Vision.pptx
PPT
Project quality management in manufacturing
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Construction Project Organization Group 2.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
web development for engineering and engineering
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Operating System & Kernel Study Guide-1 - converted.pdf
Internet of Things (IOT) - A guide to understanding
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Current and future trends in Computer Vision.pptx
Project quality management in manufacturing
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Embodied AI: Ushering in the Next Era of Intelligent Systems
CYBER-CRIMES AND SECURITY A guide to understanding
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Foundation to blockchain - A guide to Blockchain Tech
bas. eng. economics group 4 presentation 1.pptx
CH1 Production IntroductoryConcepts.pptx
Construction Project Organization Group 2.pptx
573137875-Attendance-Management-System-original
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
web development for engineering and engineering

Leveraging a distributed architecture to your advantage