Scale your Magento app with Elastic Beanstalk

Corley S.r.l.
Corley S.r.l.Corley S.r.l.
Scale out your Magento application with 
ElasticBeanstalk
About us 
Cofounder & CTO - 
Bitbull S.r.l. @Bitbull_it 
bitbull-team 
on Github 
kesonno 
on Twitter 
Cofounder - 
Cofounder - 
Corley S.r.l. @CorleyCloud 
UpCloo LTD @UpCloo 
on Github 
on Twitter 
wdalmut 
walterdalmut 
- Internet Of Things! @ Turin [CFP] - 15 Nov 
- CloudComputing @ Turin [CFP ASAP] 
internetof.it 
www.cloudconf.it
ElasticBeanstalk 
Scale your app workers and web apps 
Queue Daemons 
Load balanced web applications 
Mainly for Service Oriented Architecture
Autoscaling applied to web applications
Autoscaling in practice 
Dynamically added and removed! 
Machine to Machine 
Closed-loop control system
Scale apps is not simple 
How to handle dev/testing/production? (dynamic env) 
How to install/update softwares? (dynamic env) 
How to handle user sessions? (more than one node) 
How to handle/tail logs? (dynamic env) 
How to monitor all instances (dynamic env) 
And more... (all things are moving!)
Run different environment per app 
Typically you run: Production, Testing, Development
How to deploy the app? 
ElasticBeanstalk updates app using Git on push 
ElasticBeanstalk updates app using a pre-packaged Zip file 
ElasticBeankstalk offers also API 
Git Push -> Jenkins Build ZIP package -> ElasticBeankstalk Deploy
Different app versions per environment 
Easy distributed app deploy/rollback and testing/production application management
Different configuration per environment 
Upgrade your environment and switch your production without downtime
Production Env Swap
My production environment
Add a new environment
Swap production environment 
ElasticBeanstalk swap env URLs in order to simplify the upgrade
Destroy your old environment 
COST-SAVING! 
it is easier create and destroy environments than upgrade them
Environment Management
Control your Application 
Configurations
Application variables 
All environment variables are ported to your application in $_SERVER 
You can pass everything like: Memcached and Mysql configurations etc.
Scaling made easy
We need more customizations! 
Create a folder in your project root with name .ebextensions and 
append your configuration files with extension .config 
ElasticBeanstalk will use them during the application provisioning
Cronjobs runs on the leader instance only 
.ebextensions/05_cron_jobs.config 
container_commands: 
01_magento_cron_job: 
command: "cat .ebextensions/magento_cron_job.txt > /etc/cron.d/magento_cron_job && chmod 644 /etc/cron.d/magento_cron_leader_only: true 
All configuration files are just simple YAML files
Monitor your environment 
You can monitor many metrics with CloudWatch 
UDP/IP CloudWatch agent on local machine: https://github.com/wdalmut/cloudwatch-agent
What we are missing? 
Logs!
Grab all active instances logs
But my application logs? 
commands: 
21_application_logs: 
command: echo "/var/app/current/var/log/*.log" > myapp.conf 
cwd: /opt/elasticbeanstalk/tasks/bundlelogs.d 
22_application_logs: 
command: echo "/var/app/current/var/log/*.log" > myapp.conf 
cwd: /opt/elasticbeanstalk/tasks/systemtaillogs.d 
23_application_logs: 
command: echo "/var/app/current/var/log/*.log" > myapp.conf 
cwd: /opt/elasticbeanstalk/tasks/taillogs.d 
24_application_logs: 
command: echo "/var/app/current/var/log/*.log" > myapp.conf 
cwd: /opt/elasticbeanstalk/tasks/publishlogs.d 
.ebextensions/06_prepare_logs.config
The Magento side
Use Composer for dependencies 
ElasticBeanstalk uses Composer in order to prepare your application 
So, we can use composer hooks in order to connect all env variables to 
our Magento configuration 
http://github.com/magento-hackathon/magento-composer-installer
Composer hooks 
{ 
/** other composer configs **/ 
"scripts": { 
"post‐update‐cmd": [ 
"CorleyDeployMagento::localConf" 
], 
"post‐install‐cmd": [ 
"CorleyDeployMagento::localConf" 
] 
}, 
}
<?php 
namespace CorleyDeploy; 
use ComposerScriptEvent; 
class Magento 
{ 
public static function localConf(Event $event) 
{ 
// Generate a local.xml based on environment variables 
} 
}
The golden rule: 
The filesystem is not reliable
Keep media in a shared location 
ok but, what could we use?
NFS? 
is a single point of failure 
is not at web scale
Amazon S3? 
does not work out-of-the-box 
maybe in future...
Database?
Why not? 
work out-of-the-box (and is dead simple to configure) 
read access to db only once for each instance... 
...may be reduced to only one using a CDN (CloudFront)
Cache and sessions 
All cache backend and session handlers except "File" are fine 
Best options are Redis and Memcached (both available via Amazon 
ElastiCache)
TO BE DONE 
sitemap.xml 
Exchange data for third-party integration (ERP, CRM etc.) 
Integration with services (eg. bank gateway) that require IPs whitelist 
Use a proxy 
IP reservation 
Store media on Amazon S3 
Use DynamoDB session handler
Thanks for listening 
Any question?
1 of 38

Recommended

Deep Dive into AWS SAM by
Deep Dive into AWS SAMDeep Dive into AWS SAM
Deep Dive into AWS SAMAmazon Web Services
4.8K views48 slides
docker installation and basics by
docker installation and basicsdocker installation and basics
docker installation and basicsWalid Ashraf
845 views21 slides
CI/CD on AWS by
CI/CD on AWSCI/CD on AWS
CI/CD on AWSAmazon Web Services
1.7K views61 slides
AWS 비용, 어떻게 사용하고 계신가요? - 비용 최적화를 위한 AWS의 다양한 툴 알아보기 – 허경원, AWS 클라우드 파이낸셜 매니저:... by
AWS 비용, 어떻게 사용하고 계신가요? - 비용 최적화를 위한 AWS의 다양한 툴 알아보기 – 허경원, AWS 클라우드 파이낸셜 매니저:...AWS 비용, 어떻게 사용하고 계신가요? - 비용 최적화를 위한 AWS의 다양한 툴 알아보기 – 허경원, AWS 클라우드 파이낸셜 매니저:...
AWS 비용, 어떻게 사용하고 계신가요? - 비용 최적화를 위한 AWS의 다양한 툴 알아보기 – 허경원, AWS 클라우드 파이낸셜 매니저:...Amazon Web Services Korea
189 views36 slides
Kubernetes API code-base tour by
Kubernetes API code-base tourKubernetes API code-base tour
Kubernetes API code-base tourStefan Schimanski
374 views28 slides
Docker Networking - Common Issues and Troubleshooting Techniques by
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesSreenivas Makam
42.6K views40 slides

More Related Content

What's hot

Amazon ECS by
Amazon ECSAmazon ECS
Amazon ECSAmazon Web Services
5.3K views53 slides
Deep Dive - Advanced Usage of the AWS CLI by
Deep Dive - Advanced Usage of the AWS CLIDeep Dive - Advanced Usage of the AWS CLI
Deep Dive - Advanced Usage of the AWS CLIAmazon Web Services
5.4K views101 slides
Kubernetes Architecture - beyond a black box - Part 1 by
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Hao H. Zhang
7K views56 slides
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build... by
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...Amazon Web Services Korea
2.4K views101 slides
Getting started with Docker by
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
533 views41 slides
Vue Vuex 101 by
Vue Vuex 101Vue Vuex 101
Vue Vuex 101LocNguyen362
386 views33 slides

What's hot(20)

Kubernetes Architecture - beyond a black box - Part 1 by Hao H. Zhang
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1
Hao H. Zhang7K views
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build... by Amazon Web Services Korea
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...
Amazon API Gateway and AWS Lambda: Better Together by Danilo Poccia
Amazon API Gateway and AWS Lambda: Better TogetherAmazon API Gateway and AWS Lambda: Better Together
Amazon API Gateway and AWS Lambda: Better Together
Danilo Poccia2.7K views
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore by Amazon Web Services
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I... by Amazon Web Services
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...
Set it and Forget it: Auto Scaling Target Tracking Policies - AWS Online Tech... by Amazon Web Services
Set it and Forget it: Auto Scaling Target Tracking Policies - AWS Online Tech...Set it and Forget it: Auto Scaling Target Tracking Policies - AWS Online Tech...
Set it and Forget it: Auto Scaling Target Tracking Policies - AWS Online Tech...
Amazon Web Services3.5K views
Best Practices for CI/CD with AWS Lambda and Amazon API Gateway (SRV355-R1) -... by Amazon Web Services
Best Practices for CI/CD with AWS Lambda and Amazon API Gateway (SRV355-R1) -...Best Practices for CI/CD with AWS Lambda and Amazon API Gateway (SRV355-R1) -...
Best Practices for CI/CD with AWS Lambda and Amazon API Gateway (SRV355-R1) -...
Amazon Web Services12.4K views
AWS 상의 컨테이너 서비스 소개 ECS, EKS - 이종립 / Principle Enterprise Evangelist @베스핀글로벌 by BESPIN GLOBAL
AWS 상의 컨테이너 서비스 소개 ECS, EKS - 이종립 / Principle Enterprise Evangelist @베스핀글로벌AWS 상의 컨테이너 서비스 소개 ECS, EKS - 이종립 / Principle Enterprise Evangelist @베스핀글로벌
AWS 상의 컨테이너 서비스 소개 ECS, EKS - 이종립 / Principle Enterprise Evangelist @베스핀글로벌
BESPIN GLOBAL3.4K views
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast... by Amazon Web Services Korea
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...
Kubernetes design principles, patterns and ecosystem by Sreenivas Makam
Kubernetes design principles, patterns and ecosystemKubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystem
Sreenivas Makam7.9K views
Docker introduction by Phuc Nguyen
Docker introductionDocker introduction
Docker introduction
Phuc Nguyen1.3K views
AEM & eCommerce integration by Lokesh BS
AEM & eCommerce integrationAEM & eCommerce integration
AEM & eCommerce integration
Lokesh BS2.5K views
Creating_scheduled_reports_with_Zabbix.pdf by ITDispendik
Creating_scheduled_reports_with_Zabbix.pdfCreating_scheduled_reports_with_Zabbix.pdf
Creating_scheduled_reports_with_Zabbix.pdf
ITDispendik92 views

Viewers also liked

Angrybirds Magento Cloud Deployment by
Angrybirds Magento Cloud DeploymentAngrybirds Magento Cloud Deployment
Angrybirds Magento Cloud DeploymentAOE
8.8K views50 slides
Magento Implementation by
Magento Implementation Magento Implementation
Magento Implementation Splurgify
337 views3 slides
React vs Angular2 by
React vs Angular2React vs Angular2
React vs Angular2Corley S.r.l.
629 views23 slides
High-Performance Magento in the Cloud by
High-Performance Magento in the CloudHigh-Performance Magento in the Cloud
High-Performance Magento in the CloudAOE
8.1K views85 slides
Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac... by
Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac...Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac...
Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac...AOE
11.2K views46 slides
Best Magento Mobile App Builder Companies by
Best Magento Mobile App Builder CompaniesBest Magento Mobile App Builder Companies
Best Magento Mobile App Builder CompaniesDavid Michael
180 views1 slide

Viewers also liked(20)

Angrybirds Magento Cloud Deployment by AOE
Angrybirds Magento Cloud DeploymentAngrybirds Magento Cloud Deployment
Angrybirds Magento Cloud Deployment
AOE8.8K views
Magento Implementation by Splurgify
Magento Implementation Magento Implementation
Magento Implementation
Splurgify337 views
High-Performance Magento in the Cloud by AOE
High-Performance Magento in the CloudHigh-Performance Magento in the Cloud
High-Performance Magento in the Cloud
AOE 8.1K views
Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac... by AOE
Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac...Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac...
Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac...
AOE11.2K views
Best Magento Mobile App Builder Companies by David Michael
Best Magento Mobile App Builder CompaniesBest Magento Mobile App Builder Companies
Best Magento Mobile App Builder Companies
David Michael180 views
Build a custom (micro)framework with ZF2 Components (as building blocks) by Corley S.r.l.
Build a custom (micro)framework with ZF2 Components (as building blocks)Build a custom (micro)framework with ZF2 Components (as building blocks)
Build a custom (micro)framework with ZF2 Components (as building blocks)
Corley S.r.l.1.8K views
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit... by Corley S.r.l.
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...
Corley S.r.l.2.8K views
Nodejs magento by pravams
Nodejs magentoNodejs magento
Nodejs magento
pravams2.2K views
Scale your PHP application with Elastic Beanstalk - CloudParty Genova by Corley S.r.l.
Scale your PHP application with Elastic Beanstalk - CloudParty GenovaScale your PHP application with Elastic Beanstalk - CloudParty Genova
Scale your PHP application with Elastic Beanstalk - CloudParty Genova
Corley S.r.l.2.8K views
MySQL - Scale Out @ CloudParty 2013 Milano Talent Garden by Corley S.r.l.
MySQL - Scale Out @ CloudParty 2013 Milano Talent GardenMySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
MySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
Corley S.r.l.1.4K views
Php & cloud computing by Corley S.r.l.
Php & cloud computingPhp & cloud computing
Php & cloud computing
Corley S.r.l.6.4K views
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015 by Corley S.r.l.
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
Corley S.r.l.2.6K views
Disaster Recovery - On-Premise & Cloud by Corley S.r.l.
Disaster Recovery - On-Premise & CloudDisaster Recovery - On-Premise & Cloud
Disaster Recovery - On-Premise & Cloud
Corley S.r.l.2.3K views
An introduction to Hubot - CloudConf 2015 - Turin Italy by Corley S.r.l.
An introduction to Hubot - CloudConf 2015 - Turin ItalyAn introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin Italy
Corley S.r.l.1.2K views
Middleware PHP - A simple micro-framework by Corley S.r.l.
Middleware PHP - A simple micro-frameworkMiddleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
Corley S.r.l.8.3K views
Cloud computing & lamp applications by Corley S.r.l.
Cloud computing & lamp applicationsCloud computing & lamp applications
Cloud computing & lamp applications
Corley S.r.l.2.6K views
Rock-solid Magento Deployments (and Development) by AOE
Rock-solid Magento Deployments (and Development)Rock-solid Magento Deployments (and Development)
Rock-solid Magento Deployments (and Development)
AOE 21.6K views

Similar to Scale your Magento app with Elastic Beanstalk

Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia by
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
16.2K views101 slides
MS Cloud Day - Deploying and monitoring windows azure applications by
MS Cloud Day - Deploying and monitoring windows azure applicationsMS Cloud Day - Deploying and monitoring windows azure applications
MS Cloud Day - Deploying and monitoring windows azure applicationsSpiffy
2.1K views41 slides
Continuous Integration using Cruise Control by
Continuous Integration using Cruise ControlContinuous Integration using Cruise Control
Continuous Integration using Cruise Controlelliando dias
1.2K views29 slides
Configuration Management and Transforming Legacy Applications in the Enterpri... by
Configuration Management and Transforming Legacy Applications in the Enterpri...Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...Docker, Inc.
758 views37 slides
Salt conf 2014 - Using SaltStack in high availability environments by
Salt conf 2014 - Using SaltStack in high availability environmentsSalt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environmentsBenjamin Cane
5.8K views48 slides
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011) by
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
3.8K views52 slides

Similar to Scale your Magento app with Elastic Beanstalk(20)

Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia by Amazon Web Services
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Amazon Web Services16.2K views
MS Cloud Day - Deploying and monitoring windows azure applications by Spiffy
MS Cloud Day - Deploying and monitoring windows azure applicationsMS Cloud Day - Deploying and monitoring windows azure applications
MS Cloud Day - Deploying and monitoring windows azure applications
Spiffy2.1K views
Continuous Integration using Cruise Control by elliando dias
Continuous Integration using Cruise ControlContinuous Integration using Cruise Control
Continuous Integration using Cruise Control
elliando dias1.2K views
Configuration Management and Transforming Legacy Applications in the Enterpri... by Docker, Inc.
Configuration Management and Transforming Legacy Applications in the Enterpri...Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...
Docker, Inc.758 views
Salt conf 2014 - Using SaltStack in high availability environments by Benjamin Cane
Salt conf 2014 - Using SaltStack in high availability environmentsSalt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environments
Benjamin Cane5.8K views
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011) by Fabrice Bernhard
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard3.8K views
Continuous Web Performance Monitoring with Jenkins by Michael Kröll
Continuous Web Performance Monitoring with JenkinsContinuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with Jenkins
Michael Kröll8.3K views
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre... by Amazon Web Services
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
Release with confidence by John Congdon
Release with confidenceRelease with confidence
Release with confidence
John Congdon1.8K views
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word... by Evan Mullins
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
Evan Mullins1.7K views
Yannis Zarkadas. Enterprise data science workflows on kubeflow by MarynaHoldaieva
Yannis Zarkadas. Enterprise data science workflows on kubeflowYannis Zarkadas. Enterprise data science workflows on kubeflow
Yannis Zarkadas. Enterprise data science workflows on kubeflow
MarynaHoldaieva70 views
Yannis Zarkadas. Stefano Fioravanzo. Enterprise data science workflows on kub... by Lviv Startup Club
Yannis Zarkadas. Stefano Fioravanzo. Enterprise data science workflows on kub...Yannis Zarkadas. Stefano Fioravanzo. Enterprise data science workflows on kub...
Yannis Zarkadas. Stefano Fioravanzo. Enterprise data science workflows on kub...
Lviv Startup Club136 views
Meet Magento Spain 2019 - Our Experience with Magento Cloud by Lyzun Oleksandr
Meet Magento Spain 2019 - Our Experience with Magento CloudMeet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento Cloud
Lyzun Oleksandr664 views
N-Tier Application with Windows Forms - Deployment and Security by Peter Gfader
N-Tier Application with Windows Forms - Deployment and SecurityN-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and Security
Peter Gfader2.2K views
6 Things You Need to Know to Safely Run Kubernetes by VMware Tanzu
6 Things You Need to Know to Safely Run Kubernetes6 Things You Need to Know to Safely Run Kubernetes
6 Things You Need to Know to Safely Run Kubernetes
VMware Tanzu541 views
Odo improving the developer experience on OpenShift - hack &amp; sangria by Jorge Morales
Odo   improving the developer experience on OpenShift - hack &amp; sangriaOdo   improving the developer experience on OpenShift - hack &amp; sangria
Odo improving the developer experience on OpenShift - hack &amp; sangria
Jorge Morales891 views
Building a full-stack app with Golang and Google Cloud Platform in one week by Dr. Felix Raab
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
Dr. Felix Raab185 views
Scaling Engineering with Docker by Tom Leach
Scaling Engineering with DockerScaling Engineering with Docker
Scaling Engineering with Docker
Tom Leach1.6K views

More from Corley S.r.l.

Aws rekognition - riconoscimento facciale by
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento faccialeCorley S.r.l.
313 views18 slides
AWSome day 2018 - scalability and cost optimization with container services by
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container servicesCorley S.r.l.
273 views34 slides
AWSome day 2018 - API serverless with aws by
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with awsCorley S.r.l.
203 views38 slides
AWSome day 2018 - database in cloud by
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloudCorley S.r.l.
195 views36 slides
Trace your micro-services oriented application with Zipkin and OpenTracing by
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing Corley S.r.l.
1.3K views46 slides
Apiconf - The perfect REST solution by
Apiconf - The perfect REST solutionApiconf - The perfect REST solution
Apiconf - The perfect REST solutionCorley S.r.l.
305 views14 slides

More from Corley S.r.l.(20)

Aws rekognition - riconoscimento facciale by Corley S.r.l.
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento facciale
Corley S.r.l.313 views
AWSome day 2018 - scalability and cost optimization with container services by Corley S.r.l.
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container services
Corley S.r.l.273 views
AWSome day 2018 - API serverless with aws by Corley S.r.l.
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with aws
Corley S.r.l.203 views
AWSome day 2018 - database in cloud by Corley S.r.l.
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloud
Corley S.r.l.195 views
Trace your micro-services oriented application with Zipkin and OpenTracing by Corley S.r.l.
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing
Corley S.r.l.1.3K views
Apiconf - The perfect REST solution by Corley S.r.l.
Apiconf - The perfect REST solutionApiconf - The perfect REST solution
Apiconf - The perfect REST solution
Corley S.r.l.305 views
Apiconf - Doc Driven Development by Corley S.r.l.
Apiconf - Doc Driven DevelopmentApiconf - Doc Driven Development
Apiconf - Doc Driven Development
Corley S.r.l.202 views
Authentication and authorization in res tful infrastructures by Corley S.r.l.
Authentication and authorization in res tful infrastructuresAuthentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructures
Corley S.r.l.278 views
Flexibility and scalability of costs in serverless infrastructures by Corley S.r.l.
Flexibility and scalability of costs in serverless infrastructuresFlexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructures
Corley S.r.l.174 views
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application by Corley S.r.l.
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
Corley S.r.l.325 views
A single language for backend and frontend from AngularJS to cloud with Clau... by Corley S.r.l.
A single language for backend and frontend  from AngularJS to cloud with Clau...A single language for backend and frontend  from AngularJS to cloud with Clau...
A single language for backend and frontend from AngularJS to cloud with Clau...
Corley S.r.l.349 views
AngularJS: Service, factory & provider by Corley S.r.l.
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & provider
Corley S.r.l.1.5K views
The advantage of developing with TypeScript by Corley S.r.l.
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
Corley S.r.l.1.3K views
Angular coding: from project management to web and mobile deploy by Corley S.r.l.
Angular coding: from project management to web and mobile deployAngular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deploy
Corley S.r.l.893 views
Corley cloud angular in cloud by Corley S.r.l.
Corley cloud   angular in cloudCorley cloud   angular in cloud
Corley cloud angular in cloud
Corley S.r.l.801 views
Measure your app internals with InfluxDB and Symfony2 by Corley S.r.l.
Measure your app internals with InfluxDB and Symfony2Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2
Corley S.r.l.4.5K views
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda by Corley S.r.l.
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS LambdaRead Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Corley S.r.l.3.6K views
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L... by Corley S.r.l.
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Corley S.r.l.6.3K views
Cloud Conf 2015 - Develop and Deploy IOT Applications by Corley S.r.l.
Cloud Conf 2015 - Develop and Deploy IOT ApplicationsCloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT Applications
Corley S.r.l.909 views
AngularJS advanced project management by Corley S.r.l.
AngularJS advanced project managementAngularJS advanced project management
AngularJS advanced project management
Corley S.r.l.3.3K views

Recently uploaded

360 graden fabriek by
360 graden fabriek360 graden fabriek
360 graden fabriekinfo33492
143 views25 slides
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Lisi Hocke
35 views124 slides
SAP FOR CONTRACT MANUFACTURING.pdf by
SAP FOR CONTRACT MANUFACTURING.pdfSAP FOR CONTRACT MANUFACTURING.pdf
SAP FOR CONTRACT MANUFACTURING.pdfVirendra Rai, PMP
13 views2 slides
Using Qt under LGPL-3.0 by
Using Qt under LGPL-3.0Using Qt under LGPL-3.0
Using Qt under LGPL-3.0Burkhard Stubert
13 views11 slides
HarshithAkkapelli_Presentation.pdf by
HarshithAkkapelli_Presentation.pdfHarshithAkkapelli_Presentation.pdf
HarshithAkkapelli_Presentation.pdfharshithakkapelli
12 views16 slides
Airline Booking Software by
Airline Booking SoftwareAirline Booking Software
Airline Booking SoftwareSharmiMehta
7 views26 slides

Recently uploaded(20)

360 graden fabriek by info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492143 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views
Airline Booking Software by SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta7 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller42 views
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... by sparkfabrik
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik8 views
AI and Ml presentation .pptx by FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8713 views
Fleet Management Software in India by Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable12 views
Understanding HTML terminology by artembondar5
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminology
artembondar56 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 views
Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
predicting-m3-devopsconMunich-2023-v2.pptx by Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app9 views
Generic or specific? Making sensible software design decisions by Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions

Scale your Magento app with Elastic Beanstalk

  • 1. Scale out your Magento application with ElasticBeanstalk
  • 2. About us Cofounder & CTO - Bitbull S.r.l. @Bitbull_it bitbull-team on Github kesonno on Twitter Cofounder - Cofounder - Corley S.r.l. @CorleyCloud UpCloo LTD @UpCloo on Github on Twitter wdalmut walterdalmut - Internet Of Things! @ Turin [CFP] - 15 Nov - CloudComputing @ Turin [CFP ASAP] internetof.it www.cloudconf.it
  • 3. ElasticBeanstalk Scale your app workers and web apps Queue Daemons Load balanced web applications Mainly for Service Oriented Architecture
  • 4. Autoscaling applied to web applications
  • 5. Autoscaling in practice Dynamically added and removed! Machine to Machine Closed-loop control system
  • 6. Scale apps is not simple How to handle dev/testing/production? (dynamic env) How to install/update softwares? (dynamic env) How to handle user sessions? (more than one node) How to handle/tail logs? (dynamic env) How to monitor all instances (dynamic env) And more... (all things are moving!)
  • 7. Run different environment per app Typically you run: Production, Testing, Development
  • 8. How to deploy the app? ElasticBeanstalk updates app using Git on push ElasticBeanstalk updates app using a pre-packaged Zip file ElasticBeankstalk offers also API Git Push -> Jenkins Build ZIP package -> ElasticBeankstalk Deploy
  • 9. Different app versions per environment Easy distributed app deploy/rollback and testing/production application management
  • 10. Different configuration per environment Upgrade your environment and switch your production without downtime
  • 13. Add a new environment
  • 14. Swap production environment ElasticBeanstalk swap env URLs in order to simplify the upgrade
  • 15. Destroy your old environment COST-SAVING! it is easier create and destroy environments than upgrade them
  • 17. Control your Application Configurations
  • 18. Application variables All environment variables are ported to your application in $_SERVER You can pass everything like: Memcached and Mysql configurations etc.
  • 20. We need more customizations! Create a folder in your project root with name .ebextensions and append your configuration files with extension .config ElasticBeanstalk will use them during the application provisioning
  • 21. Cronjobs runs on the leader instance only .ebextensions/05_cron_jobs.config container_commands: 01_magento_cron_job: command: "cat .ebextensions/magento_cron_job.txt > /etc/cron.d/magento_cron_job && chmod 644 /etc/cron.d/magento_cron_leader_only: true All configuration files are just simple YAML files
  • 22. Monitor your environment You can monitor many metrics with CloudWatch UDP/IP CloudWatch agent on local machine: https://github.com/wdalmut/cloudwatch-agent
  • 23. What we are missing? Logs!
  • 24. Grab all active instances logs
  • 25. But my application logs? commands: 21_application_logs: command: echo "/var/app/current/var/log/*.log" > myapp.conf cwd: /opt/elasticbeanstalk/tasks/bundlelogs.d 22_application_logs: command: echo "/var/app/current/var/log/*.log" > myapp.conf cwd: /opt/elasticbeanstalk/tasks/systemtaillogs.d 23_application_logs: command: echo "/var/app/current/var/log/*.log" > myapp.conf cwd: /opt/elasticbeanstalk/tasks/taillogs.d 24_application_logs: command: echo "/var/app/current/var/log/*.log" > myapp.conf cwd: /opt/elasticbeanstalk/tasks/publishlogs.d .ebextensions/06_prepare_logs.config
  • 27. Use Composer for dependencies ElasticBeanstalk uses Composer in order to prepare your application So, we can use composer hooks in order to connect all env variables to our Magento configuration http://github.com/magento-hackathon/magento-composer-installer
  • 28. Composer hooks { /** other composer configs **/ "scripts": { "post‐update‐cmd": [ "CorleyDeployMagento::localConf" ], "post‐install‐cmd": [ "CorleyDeployMagento::localConf" ] }, }
  • 29. <?php namespace CorleyDeploy; use ComposerScriptEvent; class Magento { public static function localConf(Event $event) { // Generate a local.xml based on environment variables } }
  • 30. The golden rule: The filesystem is not reliable
  • 31. Keep media in a shared location ok but, what could we use?
  • 32. NFS? is a single point of failure is not at web scale
  • 33. Amazon S3? does not work out-of-the-box maybe in future...
  • 35. Why not? work out-of-the-box (and is dead simple to configure) read access to db only once for each instance... ...may be reduced to only one using a CDN (CloudFront)
  • 36. Cache and sessions All cache backend and session handlers except "File" are fine Best options are Redis and Memcached (both available via Amazon ElastiCache)
  • 37. TO BE DONE sitemap.xml Exchange data for third-party integration (ERP, CRM etc.) Integration with services (eg. bank gateway) that require IPs whitelist Use a proxy IP reservation Store media on Amazon S3 Use DynamoDB session handler
  • 38. Thanks for listening Any question?