SlideShare a Scribd company logo
1 of 34
Download to read offline
SCALING WEB APPLICATIONS
ON THE CLOUD
Federico Feroldi - federico@coderloop.com
0M PVs
125M PVs
250M PVs
375M PVs
500M PVs
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
user demand servers capacity
1/3 of your
infrastructure
cost
is USELESS
TOPICS FOR TODAY
‣ What is Scalability?
‣ Amazon Web Services
‣ Building a web application on AWS
‣ Tools and Best Practices
WHO’S TALKING?
Geek by nature, working on the web since 1996
PROFESSIONAL ENTREPRENEUR
SCALABILITY
WHAT IS SCALABILITY?
A desirable property of a system, which indicates its ability
to...
Gracefully handle increasing demand.
Increase its capacity (transactions, processing, storage,
throughput) proportionally with the addition of more
resources (nodes, CPU, storage, bandwidth).
SCALING UP
Add resources to a single node in the system.
Pros: transparent to the software, almost “linear” scale,
quickly fix performance issues
Cons: risky, may impact on service, can be very expensive,
cannot scale “infinitely”
“It's	
  the	
  Stay	
  Puft	
  
Marshmallow	
  Man!”
SCALING OUT
Add more nodes to the system.
Pros: cheap, almost no impact on service, can scale
“infinitely”
Cons: the system must be properly designed, could be
complex to operate
“The	
  best	
  thing	
  about	
  
being	
  me	
  -­‐	
  there's	
  so	
  
many	
  of	
  me.”
SCALE FAST OR DIE!
If your application is accessible from the Internet you can't
decide how many people are going to use it.
More time it takes for your systems to adapt to the user
demand, more time in advance you have to provision
your system to be able to handle the future usage (and
most of the time your forecast will be wrong).
ELASTICITY
The ability to quickly and
gracefully increase capacity
by adding more resources and
also to quickly and gracefully
release resources when the
required capacity decreases.
In a few words: the ability to
quickly scale a system
capacity up and down based
on the demand in an almost
real-time fashion.
INTRODUCING AWS
INTRODUCING
Amazon launched Amazon Web
Services in 2001
Currently the most mature,
feature rich and flexible IaaS
platform
In a few words: AWS is the Data
Center in the Cloud (and much
more)
5 REASONS TO USE AWS
1. It’s cheap: pay per use, simple cost model.
2. It’s efficient: VMs, DBs, NAS, storage, messaging,
CDNs, LBs, etc...
3. It’s safe: proven infrastructure, Amazon itself builds it's
services on the same technologies.
4. It’s flexible: everything can be managed with an API
call, you can build your own tools or use one of the
many available.
5. It’s unlimited: virtually no limit on VM instances or
storage you can use.
WEB APPS COMPONENTS
Web/Application servers: to serve dynamic pages
Databases: to store user data
File Storage: to store images, videos, documents
Computing nodes: to execute background tasks like
image conversion, video transcoding, email delivery
Messaging infrastructure: asynchronous and reliable
communication between nodes
Load balancers: distribute requests
Monitoring infrastructure: to check that everything is
working well and track the system usage
BUILDING ON AWS
EXAMPLE: CODERLOOP
Coderloop is a community where
programmers can practice their
skills and Load balancers:
distribute requests against each
other to solve complex
programming problems.
Users send computer
programs to solve certain
puzzles, Coderloop execute the
programs, verifies the
correctness and gives a
rating.
Serve Web
Application
Store User Data
Process
Submissions
FIRST A WEB SERVER
EC2 is the Elastic Compute Cloud.
Users can launch virtual machines (called instances) with a
CLI tool or an API.
They have dynamic IPs but you can reserve fixed IPs
and associate them to an instance.
Instances are created from customizable “images” and
they come in many sizes (memory and CPU).
You pay for the CPU time and the bandwidth.
When an instance is turned off, you lose the data in it
(volatile storage).
PERSISTENT USERS’ DATA
RDS is the Relational Database Service.
It’s a fully managed MySQL database.
You can scale it as needed (CPU and available storage).
It’s automatically patched when needed.
Supports multi-master and replication.
You can create backups periodically or with a single API call.
You pay for CPU usage, dedicated primary storage,
backup storage (optional) and bandwidth used.
THE NOSQL ALTERNATIVE
SimpleDB is the non relational data store.
It’s a fully managed, scalable “data store”.
Simple web service API no SQL
No need to define schema in advance.
Scales automatically, you just keep adding data.
You pay for CPU time, used storage and bandwidth.
25 hours of CPU and 1GB of storage for free each
month.
STORING FILES AND IMAGES
S3 is the Simple Storage Service.
Simple API (REST and SOAP) to write objects (files) in
buckets (similar to directories).
Objects can be from 1 byte to 5GB in size
Standard (99.999999999%) or reduced (99.99%)
availability options.
You pay for the storage used and the bandwidth.
PROCESSING SUBMISSIONS
We use EC2 with SQS (Simple Queue Service)
Reliable, highly scalable message queue.
Web servers queue “job requests” that are picked by EC2
instances and processed.
EC2 instances can be added or removed based on the
amount of requests to be processed.
You pay for the amount of requests made to the service
and the amount of data transferred.
The first 100K requests are free each month.
SCALING OUT THE APP
We can distribute the requests with the Elastic Load
Balancing service
Monitors the available instances and routes incoming
requests to “healthy” instances
Supports sticky sessions and SSL termination.
You pay for the time and the bandwidth transferred.
With RDS we can easily setup read replicas for our
database to scale the read capacity.
ENABLING ELASTICITY
With Cloud Watch we can monitor our servers’ usage in
real time: CPU, Disk and Network for EC2 instances and
databases.
This information can be used to enable Auto Scaling:
automatically scale your Amazon EC2 capacity up or down
according to conditions you define (based on average CPU
utilization, network activity or disk utilization).
New EC2 instances get automatically added to or
removed from the Elastic Load Balancer
INCREASING AVAILABILITY
AWS is deployed on multiple Regions and Availability
Zones.
AZs are distinct locations, insulated from failures in other
AZs and provide inexpensive, low latency network
connectivity to other AZ in the same Region.
Regions consist of one or more AZs, are geographically
dispersed, and will be in separate geographic areas or
countries: currently Northern Virginia, Northern California,
Ireland, and Singapore.
SimpleQueueServices
CloudWatch
Elastic
Load Balancer
Auto
Scaling
S3RDS
EC2
SQSEC2
AWS ARCHITECTURE
TOOLS YOU NEED
PUPPET
Centralized configuration management
Rapid creation of an instance of a pre-defined type: web
server, email server, etc...
Ensuring uniform configuration of the entire set of instances
of the same type at all times.
A Puppet Master, guardian of configurations.
Multiple Puppet clients installed on EC2 instances.
CAPISTRANO
Application deployment and parallel execution of
automated tasks
Scripting a certain number of tasks, whether complex or not
(deliveries, backups, site publication/maintenance, etc.)
executing them rapidly in parallel on X instances with a
single command.
Webistrano (web interface) for 1-click deployments
MONITORING AND LOGS
Supervision verifies the state of a host or a service and
sends out an alarm upon detecting any abnormal behavior:
Nagios
Metrology enables instrumentation data to be archived, and
if necessary, processed or filtered, before it is presented in
the form of graphs or reports: Cacti
The more instances you have, the more scattered logs
there’ll be on the various instances, implement centralized
log collection: Syslog-NG
TIPS & BEST PRACTICES
6 TIPS TO REDUCE COSTS
Keep machines in the same availability zone
Use spot instances (can cost up to 3 time less)
Choose your instance types wisely (c1.medium cost 2x
m1.small by offers 5x computing power)
Choose the smallest possible storage (it’s very easy to
expand the capacity of an RDS instance)
Use Autoscaling (have always the least needed amount of
instances to handle the traffic)
Reserve your instances (you can reduce your costs
significantly by reserving number of instances for a year or
for three years).
CONCLUSIONS
Amazon Web Services is an excellent platform to build
your first prototype or even run your production
service.
It has a very flexible and proven API that let you
manage your infrastructure in ways you never
though were possible before.
It provides you with a lot of building blocks that scale
well and that you can trust, so you don’t have to
waste time building your infrastructure and you can
focus on making your service the best in the world.
And when the day comes that you hit the Techcrunch
homepage, you infrastructure is ready to scale in
minutes.
THANK YOU
federico@cloudify.me
twitter.com/cloudify
CODERLOOP IS HIRING!
Check out http://www.coderloop.com/jobs

More Related Content

What's hot

(DAT303) Oracle on AWS and Amazon RDS: Secure, Fast, and Scalable
(DAT303) Oracle on AWS and Amazon RDS: Secure, Fast, and Scalable(DAT303) Oracle on AWS and Amazon RDS: Secure, Fast, and Scalable
(DAT303) Oracle on AWS and Amazon RDS: Secure, Fast, and ScalableAmazon Web Services
 
BDA302 Deep Dive on Migrating Big Data Workloads to Amazon EMR
BDA302 Deep Dive on Migrating Big Data Workloads to Amazon EMRBDA302 Deep Dive on Migrating Big Data Workloads to Amazon EMR
BDA302 Deep Dive on Migrating Big Data Workloads to Amazon EMRAmazon Web Services
 
Accelerate your Business with SAP on AWS - AWS Summit Cape Town 2017
Accelerate your Business with SAP on AWS - AWS Summit Cape Town 2017 Accelerate your Business with SAP on AWS - AWS Summit Cape Town 2017
Accelerate your Business with SAP on AWS - AWS Summit Cape Town 2017 Amazon Web Services
 
Introducing Amazon RDS Using Oracle Database
Introducing Amazon RDS Using Oracle DatabaseIntroducing Amazon RDS Using Oracle Database
Introducing Amazon RDS Using Oracle DatabaseJamie Kinney
 
Evolution of Geospatial Workloads on AWS - AWS PS Summit Canberra
Evolution of Geospatial Workloads on AWS - AWS PS Summit Canberra Evolution of Geospatial Workloads on AWS - AWS PS Summit Canberra
Evolution of Geospatial Workloads on AWS - AWS PS Summit Canberra Amazon Web Services
 
Oracle on aws overview sep 2011
Oracle on aws overview   sep 2011Oracle on aws overview   sep 2011
Oracle on aws overview sep 2011Jamie Kinney
 
DAT103 Introducing Amazon RedShift - AWS re: Invent 2012
DAT103 Introducing Amazon RedShift - AWS re: Invent 2012DAT103 Introducing Amazon RedShift - AWS re: Invent 2012
DAT103 Introducing Amazon RedShift - AWS re: Invent 2012Amazon Web Services
 
Migrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration ServiceMigrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration ServiceAmazon Web Services
 
Satrtup Bootcamp - Scale on AWS
Satrtup Bootcamp - Scale on AWSSatrtup Bootcamp - Scale on AWS
Satrtup Bootcamp - Scale on AWSIdan Tohami
 
Database Migration – Simple, Cross-Engine and Cross-Platform Migration
Database Migration – Simple, Cross-Engine and Cross-Platform MigrationDatabase Migration – Simple, Cross-Engine and Cross-Platform Migration
Database Migration – Simple, Cross-Engine and Cross-Platform MigrationAmazon Web Services
 
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web ServicesAWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web ServicesAmazon Web Services
 
2015 SQL Pass Summit Breakfast session #1
2015 SQL Pass Summit Breakfast session #12015 SQL Pass Summit Breakfast session #1
2015 SQL Pass Summit Breakfast session #1Ghim-Sim Chua
 
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...Amazon Web Services
 
getting started with amazon aurora
getting started with amazon auroragetting started with amazon aurora
getting started with amazon auroraAmazon Web Services
 

What's hot (20)

Introduction to Amazon Aurora
Introduction to Amazon AuroraIntroduction to Amazon Aurora
Introduction to Amazon Aurora
 
Amazon rds
Amazon rdsAmazon rds
Amazon rds
 
(DAT303) Oracle on AWS and Amazon RDS: Secure, Fast, and Scalable
(DAT303) Oracle on AWS and Amazon RDS: Secure, Fast, and Scalable(DAT303) Oracle on AWS and Amazon RDS: Secure, Fast, and Scalable
(DAT303) Oracle on AWS and Amazon RDS: Secure, Fast, and Scalable
 
BDA302 Deep Dive on Migrating Big Data Workloads to Amazon EMR
BDA302 Deep Dive on Migrating Big Data Workloads to Amazon EMRBDA302 Deep Dive on Migrating Big Data Workloads to Amazon EMR
BDA302 Deep Dive on Migrating Big Data Workloads to Amazon EMR
 
Accelerate your Business with SAP on AWS - AWS Summit Cape Town 2017
Accelerate your Business with SAP on AWS - AWS Summit Cape Town 2017 Accelerate your Business with SAP on AWS - AWS Summit Cape Town 2017
Accelerate your Business with SAP on AWS - AWS Summit Cape Town 2017
 
Introducing Amazon RDS Using Oracle Database
Introducing Amazon RDS Using Oracle DatabaseIntroducing Amazon RDS Using Oracle Database
Introducing Amazon RDS Using Oracle Database
 
Evolution of Geospatial Workloads on AWS - AWS PS Summit Canberra
Evolution of Geospatial Workloads on AWS - AWS PS Summit Canberra Evolution of Geospatial Workloads on AWS - AWS PS Summit Canberra
Evolution of Geospatial Workloads on AWS - AWS PS Summit Canberra
 
Slideshare And Aws
Slideshare And AwsSlideshare And Aws
Slideshare And Aws
 
Oracle on aws overview sep 2011
Oracle on aws overview   sep 2011Oracle on aws overview   sep 2011
Oracle on aws overview sep 2011
 
DAT103 Introducing Amazon RedShift - AWS re: Invent 2012
DAT103 Introducing Amazon RedShift - AWS re: Invent 2012DAT103 Introducing Amazon RedShift - AWS re: Invent 2012
DAT103 Introducing Amazon RedShift - AWS re: Invent 2012
 
AWS Database Services
AWS Database ServicesAWS Database Services
AWS Database Services
 
Migrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration ServiceMigrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration Service
 
Satrtup Bootcamp - Scale on AWS
Satrtup Bootcamp - Scale on AWSSatrtup Bootcamp - Scale on AWS
Satrtup Bootcamp - Scale on AWS
 
Database Migration – Simple, Cross-Engine and Cross-Platform Migration
Database Migration – Simple, Cross-Engine and Cross-Platform MigrationDatabase Migration – Simple, Cross-Engine and Cross-Platform Migration
Database Migration – Simple, Cross-Engine and Cross-Platform Migration
 
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web ServicesAWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
 
2015 SQL Pass Summit Breakfast session #1
2015 SQL Pass Summit Breakfast session #12015 SQL Pass Summit Breakfast session #1
2015 SQL Pass Summit Breakfast session #1
 
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
Managing Data with Amazon ElastiCache for Redis - August 2016 Monthly Webinar...
 
Cost Optimization at Scale
Cost Optimization at ScaleCost Optimization at Scale
Cost Optimization at Scale
 
getting started with amazon aurora
getting started with amazon auroragetting started with amazon aurora
getting started with amazon aurora
 
AWS RDS Migration Tool
AWS RDS Migration Tool AWS RDS Migration Tool
AWS RDS Migration Tool
 

Viewers also liked

From Startup to Exit in 18 months
From Startup to Exit in 18 monthsFrom Startup to Exit in 18 months
From Startup to Exit in 18 monthsFederico Feroldi
 
Innovate, optimize and profit with cloud computing
Innovate, optimize and profit with cloud computingInnovate, optimize and profit with cloud computing
Innovate, optimize and profit with cloud computingFederico Feroldi
 
Design and development of an Online Social Network crawler
Design and development of an Online Social Network crawlerDesign and development of an Online Social Network crawler
Design and development of an Online Social Network crawlerFederico Feroldi
 
Cloudify your applications with Amazon Web Services
Cloudify your applications with Amazon Web ServicesCloudify your applications with Amazon Web Services
Cloudify your applications with Amazon Web ServicesFederico Feroldi
 
10分でわかる marathon-lb
10分でわかる marathon-lb10分でわかる marathon-lb
10分でわかる marathon-lbShuji Yamada
 
コンテナのユースケース考察
コンテナのユースケース考察コンテナのユースケース考察
コンテナのユースケース考察Shuji Yamada
 
A Blueprint for Scala Microservices
A Blueprint for Scala MicroservicesA Blueprint for Scala Microservices
A Blueprint for Scala MicroservicesFederico Feroldi
 
会社にGitHub Enterpriseを導入してみた話
会社にGitHub Enterpriseを導入してみた話会社にGitHub Enterpriseを導入してみた話
会社にGitHub Enterpriseを導入してみた話Shuji Yamada
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web ApplicationsDavid Mitzenmacher
 
Crawling the web for fun and profit
Crawling the web for fun and profitCrawling the web for fun and profit
Crawling the web for fun and profitFederico Feroldi
 

Viewers also liked (10)

From Startup to Exit in 18 months
From Startup to Exit in 18 monthsFrom Startup to Exit in 18 months
From Startup to Exit in 18 months
 
Innovate, optimize and profit with cloud computing
Innovate, optimize and profit with cloud computingInnovate, optimize and profit with cloud computing
Innovate, optimize and profit with cloud computing
 
Design and development of an Online Social Network crawler
Design and development of an Online Social Network crawlerDesign and development of an Online Social Network crawler
Design and development of an Online Social Network crawler
 
Cloudify your applications with Amazon Web Services
Cloudify your applications with Amazon Web ServicesCloudify your applications with Amazon Web Services
Cloudify your applications with Amazon Web Services
 
10分でわかる marathon-lb
10分でわかる marathon-lb10分でわかる marathon-lb
10分でわかる marathon-lb
 
コンテナのユースケース考察
コンテナのユースケース考察コンテナのユースケース考察
コンテナのユースケース考察
 
A Blueprint for Scala Microservices
A Blueprint for Scala MicroservicesA Blueprint for Scala Microservices
A Blueprint for Scala Microservices
 
会社にGitHub Enterpriseを導入してみた話
会社にGitHub Enterpriseを導入してみた話会社にGitHub Enterpriseを導入してみた話
会社にGitHub Enterpriseを導入してみた話
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications
 
Crawling the web for fun and profit
Crawling the web for fun and profitCrawling the web for fun and profit
Crawling the web for fun and profit
 

Similar to Scaling web application in the Cloud

Aws webcast - Scaling on AWS 13 08-20
Aws webcast - Scaling on AWS 13 08-20Aws webcast - Scaling on AWS 13 08-20
Aws webcast - Scaling on AWS 13 08-20Amazon Web Services
 
Aws for Startups Building Cloud Enabled Apps
Aws for Startups Building Cloud Enabled AppsAws for Startups Building Cloud Enabled Apps
Aws for Startups Building Cloud Enabled AppsAmazon Web Services
 
Cloud computing & aws concepts
Cloud computing & aws conceptsCloud computing & aws concepts
Cloud computing & aws conceptsABHINAV ANAND
 
Wicked rugby
Wicked rugbyWicked rugby
Wicked rugbyDklumb4
 
AWS Summit 2018 Summary
AWS Summit 2018 SummaryAWS Summit 2018 Summary
AWS Summit 2018 SummaryAshish Mrig
 
Getting Started with Amazon Aurora
Getting Started with Amazon AuroraGetting Started with Amazon Aurora
Getting Started with Amazon AuroraAmazon Web Services
 
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWSAWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWSAmazon Web Services
 
AWS Webcast - Best Practices in Architecting for the Cloud
AWS Webcast - Best Practices in Architecting for the CloudAWS Webcast - Best Practices in Architecting for the Cloud
AWS Webcast - Best Practices in Architecting for the CloudAmazon Web Services
 
AWS Primer and Quickstart
AWS Primer and QuickstartAWS Primer and Quickstart
AWS Primer and QuickstartManish Pandit
 
Aws platform overview
Aws platform overviewAws platform overview
Aws platform overviewVinay Yelluri
 
Aws platform overview
Aws platform overviewAws platform overview
Aws platform overviewVinay Yelluri
 

Similar to Scaling web application in the Cloud (20)

Aws webcast - Scaling on AWS 13 08-20
Aws webcast - Scaling on AWS 13 08-20Aws webcast - Scaling on AWS 13 08-20
Aws webcast - Scaling on AWS 13 08-20
 
AWS Architecting In The Cloud
AWS Architecting In The CloudAWS Architecting In The Cloud
AWS Architecting In The Cloud
 
Aws for Startups Building Cloud Enabled Apps
Aws for Startups Building Cloud Enabled AppsAws for Startups Building Cloud Enabled Apps
Aws for Startups Building Cloud Enabled Apps
 
AWS.pdf
AWS.pdfAWS.pdf
AWS.pdf
 
Cloud computing & aws concepts
Cloud computing & aws conceptsCloud computing & aws concepts
Cloud computing & aws concepts
 
Amazon Web Service.pdf
Amazon Web Service.pdfAmazon Web Service.pdf
Amazon Web Service.pdf
 
Aws coi7
Aws coi7Aws coi7
Aws coi7
 
AWS Session.pptx
AWS Session.pptxAWS Session.pptx
AWS Session.pptx
 
Aws overview
Aws overviewAws overview
Aws overview
 
Wicked rugby
Wicked rugbyWicked rugby
Wicked rugby
 
AWS Summit 2018 Summary
AWS Summit 2018 SummaryAWS Summit 2018 Summary
AWS Summit 2018 Summary
 
AMAZON CLOUD Course Content
AMAZON CLOUD Course ContentAMAZON CLOUD Course Content
AMAZON CLOUD Course Content
 
Getting Started with Amazon Aurora
Getting Started with Amazon AuroraGetting Started with Amazon Aurora
Getting Started with Amazon Aurora
 
AWS.doc
AWS.docAWS.doc
AWS.doc
 
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWSAWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
 
AWS Webcast - Best Practices in Architecting for the Cloud
AWS Webcast - Best Practices in Architecting for the CloudAWS Webcast - Best Practices in Architecting for the Cloud
AWS Webcast - Best Practices in Architecting for the Cloud
 
AWS Primer and Quickstart
AWS Primer and QuickstartAWS Primer and Quickstart
AWS Primer and Quickstart
 
Aws101
Aws101Aws101
Aws101
 
Aws platform overview
Aws platform overviewAws platform overview
Aws platform overview
 
Aws platform overview
Aws platform overviewAws platform overview
Aws platform overview
 

More from Federico Feroldi

Una Pubblica Amministrazione Agile, Funzionale e Serverless: si può fare! - C...
Una Pubblica Amministrazione Agile, Funzionale e Serverless: si può fare! - C...Una Pubblica Amministrazione Agile, Funzionale e Serverless: si può fare! - C...
Una Pubblica Amministrazione Agile, Funzionale e Serverless: si può fare! - C...Federico Feroldi
 
From 1 to infinity: how to scale your tech organization, build a great cultur...
From 1 to infinity: how to scale your tech organization, build a great cultur...From 1 to infinity: how to scale your tech organization, build a great cultur...
From 1 to infinity: how to scale your tech organization, build a great cultur...Federico Feroldi
 
Cloudify - Scalability On Demand
Cloudify - Scalability On DemandCloudify - Scalability On Demand
Cloudify - Scalability On DemandFederico Feroldi
 
Federico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi
 

More from Federico Feroldi (6)

Project IO - TS-Conf 2019
Project IO - TS-Conf 2019Project IO - TS-Conf 2019
Project IO - TS-Conf 2019
 
Una Pubblica Amministrazione Agile, Funzionale e Serverless: si può fare! - C...
Una Pubblica Amministrazione Agile, Funzionale e Serverless: si può fare! - C...Una Pubblica Amministrazione Agile, Funzionale e Serverless: si può fare! - C...
Una Pubblica Amministrazione Agile, Funzionale e Serverless: si può fare! - C...
 
From 1 to infinity: how to scale your tech organization, build a great cultur...
From 1 to infinity: how to scale your tech organization, build a great cultur...From 1 to infinity: how to scale your tech organization, build a great cultur...
From 1 to infinity: how to scale your tech organization, build a great cultur...
 
the Picmix experiment
the Picmix experimentthe Picmix experiment
the Picmix experiment
 
Cloudify - Scalability On Demand
Cloudify - Scalability On DemandCloudify - Scalability On Demand
Cloudify - Scalability On Demand
 
Federico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi Php In Yahoo
Federico Feroldi Php In Yahoo
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Scaling web application in the Cloud

  • 1. SCALING WEB APPLICATIONS ON THE CLOUD Federico Feroldi - federico@coderloop.com
  • 2. 0M PVs 125M PVs 250M PVs 375M PVs 500M PVs Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec user demand servers capacity 1/3 of your infrastructure cost is USELESS
  • 3. TOPICS FOR TODAY ‣ What is Scalability? ‣ Amazon Web Services ‣ Building a web application on AWS ‣ Tools and Best Practices
  • 4. WHO’S TALKING? Geek by nature, working on the web since 1996 PROFESSIONAL ENTREPRENEUR
  • 6. WHAT IS SCALABILITY? A desirable property of a system, which indicates its ability to... Gracefully handle increasing demand. Increase its capacity (transactions, processing, storage, throughput) proportionally with the addition of more resources (nodes, CPU, storage, bandwidth).
  • 7. SCALING UP Add resources to a single node in the system. Pros: transparent to the software, almost “linear” scale, quickly fix performance issues Cons: risky, may impact on service, can be very expensive, cannot scale “infinitely” “It's  the  Stay  Puft   Marshmallow  Man!”
  • 8. SCALING OUT Add more nodes to the system. Pros: cheap, almost no impact on service, can scale “infinitely” Cons: the system must be properly designed, could be complex to operate “The  best  thing  about   being  me  -­‐  there's  so   many  of  me.”
  • 9. SCALE FAST OR DIE! If your application is accessible from the Internet you can't decide how many people are going to use it. More time it takes for your systems to adapt to the user demand, more time in advance you have to provision your system to be able to handle the future usage (and most of the time your forecast will be wrong).
  • 10. ELASTICITY The ability to quickly and gracefully increase capacity by adding more resources and also to quickly and gracefully release resources when the required capacity decreases. In a few words: the ability to quickly scale a system capacity up and down based on the demand in an almost real-time fashion.
  • 12. INTRODUCING Amazon launched Amazon Web Services in 2001 Currently the most mature, feature rich and flexible IaaS platform In a few words: AWS is the Data Center in the Cloud (and much more)
  • 13. 5 REASONS TO USE AWS 1. It’s cheap: pay per use, simple cost model. 2. It’s efficient: VMs, DBs, NAS, storage, messaging, CDNs, LBs, etc... 3. It’s safe: proven infrastructure, Amazon itself builds it's services on the same technologies. 4. It’s flexible: everything can be managed with an API call, you can build your own tools or use one of the many available. 5. It’s unlimited: virtually no limit on VM instances or storage you can use.
  • 14. WEB APPS COMPONENTS Web/Application servers: to serve dynamic pages Databases: to store user data File Storage: to store images, videos, documents Computing nodes: to execute background tasks like image conversion, video transcoding, email delivery Messaging infrastructure: asynchronous and reliable communication between nodes Load balancers: distribute requests Monitoring infrastructure: to check that everything is working well and track the system usage
  • 16. EXAMPLE: CODERLOOP Coderloop is a community where programmers can practice their skills and Load balancers: distribute requests against each other to solve complex programming problems. Users send computer programs to solve certain puzzles, Coderloop execute the programs, verifies the correctness and gives a rating. Serve Web Application Store User Data Process Submissions
  • 17. FIRST A WEB SERVER EC2 is the Elastic Compute Cloud. Users can launch virtual machines (called instances) with a CLI tool or an API. They have dynamic IPs but you can reserve fixed IPs and associate them to an instance. Instances are created from customizable “images” and they come in many sizes (memory and CPU). You pay for the CPU time and the bandwidth. When an instance is turned off, you lose the data in it (volatile storage).
  • 18. PERSISTENT USERS’ DATA RDS is the Relational Database Service. It’s a fully managed MySQL database. You can scale it as needed (CPU and available storage). It’s automatically patched when needed. Supports multi-master and replication. You can create backups periodically or with a single API call. You pay for CPU usage, dedicated primary storage, backup storage (optional) and bandwidth used.
  • 19. THE NOSQL ALTERNATIVE SimpleDB is the non relational data store. It’s a fully managed, scalable “data store”. Simple web service API no SQL No need to define schema in advance. Scales automatically, you just keep adding data. You pay for CPU time, used storage and bandwidth. 25 hours of CPU and 1GB of storage for free each month.
  • 20. STORING FILES AND IMAGES S3 is the Simple Storage Service. Simple API (REST and SOAP) to write objects (files) in buckets (similar to directories). Objects can be from 1 byte to 5GB in size Standard (99.999999999%) or reduced (99.99%) availability options. You pay for the storage used and the bandwidth.
  • 21. PROCESSING SUBMISSIONS We use EC2 with SQS (Simple Queue Service) Reliable, highly scalable message queue. Web servers queue “job requests” that are picked by EC2 instances and processed. EC2 instances can be added or removed based on the amount of requests to be processed. You pay for the amount of requests made to the service and the amount of data transferred. The first 100K requests are free each month.
  • 22. SCALING OUT THE APP We can distribute the requests with the Elastic Load Balancing service Monitors the available instances and routes incoming requests to “healthy” instances Supports sticky sessions and SSL termination. You pay for the time and the bandwidth transferred. With RDS we can easily setup read replicas for our database to scale the read capacity.
  • 23. ENABLING ELASTICITY With Cloud Watch we can monitor our servers’ usage in real time: CPU, Disk and Network for EC2 instances and databases. This information can be used to enable Auto Scaling: automatically scale your Amazon EC2 capacity up or down according to conditions you define (based on average CPU utilization, network activity or disk utilization). New EC2 instances get automatically added to or removed from the Elastic Load Balancer
  • 24. INCREASING AVAILABILITY AWS is deployed on multiple Regions and Availability Zones. AZs are distinct locations, insulated from failures in other AZs and provide inexpensive, low latency network connectivity to other AZ in the same Region. Regions consist of one or more AZs, are geographically dispersed, and will be in separate geographic areas or countries: currently Northern Virginia, Northern California, Ireland, and Singapore.
  • 27. PUPPET Centralized configuration management Rapid creation of an instance of a pre-defined type: web server, email server, etc... Ensuring uniform configuration of the entire set of instances of the same type at all times. A Puppet Master, guardian of configurations. Multiple Puppet clients installed on EC2 instances.
  • 28. CAPISTRANO Application deployment and parallel execution of automated tasks Scripting a certain number of tasks, whether complex or not (deliveries, backups, site publication/maintenance, etc.) executing them rapidly in parallel on X instances with a single command. Webistrano (web interface) for 1-click deployments
  • 29. MONITORING AND LOGS Supervision verifies the state of a host or a service and sends out an alarm upon detecting any abnormal behavior: Nagios Metrology enables instrumentation data to be archived, and if necessary, processed or filtered, before it is presented in the form of graphs or reports: Cacti The more instances you have, the more scattered logs there’ll be on the various instances, implement centralized log collection: Syslog-NG
  • 30. TIPS & BEST PRACTICES
  • 31. 6 TIPS TO REDUCE COSTS Keep machines in the same availability zone Use spot instances (can cost up to 3 time less) Choose your instance types wisely (c1.medium cost 2x m1.small by offers 5x computing power) Choose the smallest possible storage (it’s very easy to expand the capacity of an RDS instance) Use Autoscaling (have always the least needed amount of instances to handle the traffic) Reserve your instances (you can reduce your costs significantly by reserving number of instances for a year or for three years).
  • 33. Amazon Web Services is an excellent platform to build your first prototype or even run your production service. It has a very flexible and proven API that let you manage your infrastructure in ways you never though were possible before. It provides you with a lot of building blocks that scale well and that you can trust, so you don’t have to waste time building your infrastructure and you can focus on making your service the best in the world. And when the day comes that you hit the Techcrunch homepage, you infrastructure is ready to scale in minutes.
  • 34. THANK YOU federico@cloudify.me twitter.com/cloudify CODERLOOP IS HIRING! Check out http://www.coderloop.com/jobs