SlideShare une entreprise Scribd logo
1  sur  44
Télécharger pour lire hors ligne
Scalable Web Design – Principles and
Patterns
Speaker : Sachin Prakash Sancheti
Principal Architect – Cloud (Windows Azure)
1
Context
2
3
Server
Busy!!
Your Request can
not be processed,
please try after
some time
I am trying
to book a
ticket for 1
hour now 
Please
wait!
Any Real life Examples?
4
Survey
What is Scalability?
• It is NOT
– Only Performance
– High Availability
– Business Continuity Planning
• It Is
– Traffic, User Growth
– Dataset, Database Size Growth
5
What is Scalability?
• Scalability
– “The Scalability is measure of number of users it can effectively
support at the same time without degrading the defined
performance”
– Has limits – E.g. “With two load balanced capacity it should support
1000 concurrent users with average response time of 3 seconds”
• “Performance is what an individual user experiences;
Scalability is how many users get to experience it TOGETHER”
6
What is the Concern?
• Scalability is a business concern
– Google observed 500-milisecond delay to page response caused 20%
decrease in traffic
– Amazon.com observed 100-milisecond delay caused a 1% decrease in
retail revenue
– Remember “Performance is what an individual user experiences;
Scalability is how many users get to experience it TOGETHER”
7
Handling Scalability – Degraded Application
• Degraded Application
– Doing nothing  and loosing business
8
Handling Scalability - Throttling
• Throttling
– Throttling the requests to temporarily stop accepting new requests
and serve better to existing or important users
9
Handling Scalability – Adding Resources
• Adding Resources
– Scaling up – Vertical Scaling
• Get Bigger
• Widening the roads
– Scaling out – Horizontal Scaling
• Get More
• Routing the traffic (Partitioning)
10
Typical Web Application Resources
• Web Server, Application Server (Middle Tier) and Database
Tier
11
Web
Server
Database
Server
Application
Server
Scaling Solutions
• Vertical Scaling OR Scaling Up
– Increasing resource power
– Remember widening the roads!!
• Horizontal Scaling OR Scaling Out
– Adding additional machines/nodes
– Remember routing the traffic
12
Vertical Vs. Horizontal Scaling
13
Vertical Scaling Horizontal Scaling
Higher Capital Investment On Demand Investment
Utilization concerns Utilization can be optimized
Relatively Quicker and works with the
current design
Relatively more time consuming and
needs redesigning
Limiting Scale Internet Scale
Not Cloud Native Design Cloud Native Design
Web/Application Server Scalability
14
Scaling Out Web Server – Load Balancing
15
Web
Server
Web
Server
Web
Server
• Design for Fault Tolerance
– Intent : Enables system to continue its
intended operation, possibly at a
reduced level, rather than failing
completely, when some part of the
system fails
– Drivers: Degraded services are better
than no service at all. Compare cost
effectiveness
– Solution:
• Load Balancing
• Monitoring, Self Healing, Restart
Pattern - Bi-directional Scaling
• Design for Scaling Out (Bidirectional)
– Intent: Deployment built using commodity of hardware working
together for economies of scale. Optimization is easier with scaling out
and in, rather than scaling up and down. Driven for Elasticity
– Driver: Optimized utilization, cost saving
– Solution:
• Stateless Application Design
• Nothing is shared except Database
• Scaling every tier is possible – Web/Service/Database etc.
16
Scaling Out / Horizontally: Adding Removing Boxes
Design Principle - Stateless Design
• Stateless designs increases scalability
– Don’t store anything locally on Web Server
• Session State
– Local Sessions – Avoid – Not Scalable
• Load Balancer Sticky sessions can create hot spot load
– Central Session – Good – Distributed Cache, Database
– Client Session – Better – Client Cookie
– No Session – Awesome
18
Design Principle – Loosely Coupled
• Components and layers should be loosely coupled to be able to scale each
layer separately
19
Database
Server
Web Servers
Application
Servers
Caching in Scalability
• Caching helps in avoiding scale
• In-memory distributed cache offers an excellent solution to
data storage bottlenecks
• Distributed caching clusters can keep growing horizontally,
just like the application servers. This reduces pressure on data
storage so that it is no longer a scalability bottleneck.
20
Design Pattern - Cache Aside Pattern
• Prefer Cache to Database for
Reading
– Intent : Increase read throughput and
reduce database bottleneck
– Drivers: Distributed cache are faster and
shared across web/application servers
– Solution:
• Update cache and database both for
synchronization
• Read from Cache
• Decorator Design Pattern
21
Distributed Cache
Write
Read
Design Pattern - Cache Read-through/Write-through (RT/WT)
• Prefer Cache to Database
– Intent: Increase read throughput and reduce database bottleneck. Use
Cache for read write both
– Drivers: Distributed cache are faster and shared across
web/application servers
– Solution:
• Application treats cache as the main data store and reads data from it and
writes data to it.
• The cache is responsible for reading and writing this data to the database,
thereby relieving the application of this responsibility, asynchronously
22
23
Design Pattern - Cache Read-through/Write-through (RT/WT)
Database Scalability
24
CAP Theorem
• CAP theorem, also known as Brewer's theorem, states that
it is impossible for a distributed computer system to
simultaneously provide all three of the following
guarantees: Consistency, Availability and Partition
tolerance.
• Consistency: All clients always have the same view of the
data
• Availability: Each client can always read and write
• Partition Tolerance: The system works well despite physical
network partition
25
CAP Theorem – Database Placements
26
Database Scaling – Replication - Read Mostly Pattern
• Intent: Increase database scalability by separating write and
read operations
– Generally most of the applications have around 80% read and 20%
write
• Drivers: Separate read write responsibilities, High availability
benefits
• Solution:
– Read Write Separation
– Master Slave Pattern
27
Database Scaling – Read Write Separation
28
Reads
and
Writes
Reads
Design Pattern – Partitioning / Sharding
• Design for Database Sharding
– Intent: Increasing data size might rise throttling. Database scale and
performance is more important than reliability. CAP Theorem
– Drivers: Scaling database layer, increasing database throughput
– Solution:
• Database Sharding / Horizontal Partitioning
• Database Federation
29
Shard Resolver
Shard = User ID % 4
Database Sharding Example
30
Shard 0
25%
Shard 1
25%
Shard 2
25%
User ID=3
Shard 3
25%
Design Principles – Eventually Consistent
• BASE Opposite to ACID
– Intent: Real internet scale model. Postpone the consistency.
• Basically Available, Soft state, Eventual consistency
– Solution:
• Queue Based processing Model
• Change in behavior
– Order Placed successfully TO Order Received Successfully
31
Design Principles – Asynchronous Processing
• Blocking is bane for Scalability
– Intent:
• Avoid blocking calls, reduce contention
– Solution:
• Queue Based processing Model
• Fire and Forget Calls
• 1000 users blocked for 5 seconds = 5000 users per second
32
Design Principles – Parallel Design
• Design for Parallel and Reliable Work
– Intent: Increasing resources should results in a proportional increase
in performance. Dependent services might not be available. Blocking
is bane of scalability
– Drivers: Higher reliability, Proportional distribution
– Solution:
• Concern Independent Scaling
• Reliability through Queue
• Queue driven worker tasks - more messages more workers faster work
33
Queue Based Pattern
34
Queue - Load Leveling, Load Balancing, Loose Coupling
35
Design Principles – Queue Based Pattern
• Idempotent
– Design the operation to be idempotent; that is, if it's carried out more
than once, it's as if it was carried out just once
– Implement the receiver in such a way that it can receive a message
multiple times safely, either through a filter that removes already
received messages or by adjustment of message semantics
36
Design Principles – Capacity Planning
• Everything has a limit: Compose a Scale
– Intent: Design Around Provider SLAs and Capacity
– Solution:
• Know the limits, measure the scalability and increase the scale
• E.g. Storage supports up to 10000 transactions/sec
– Add storage for higher scale
• E.g. Queue supports 5000 messages per seconds
– Add additional Queues (Partitioning) for additional scale
37
Design Pattern – Multi Site Deployment Pattern
38
Database
Server
Web Servers
Application
Servers
Database
Server
Web Servers
Application
Servers
Sync
Routing
• Performance Based
• Round Robin
• Failover
Asia United States
Summary
39
Scalability Principles
40
Scalability
Stateless
Parallelization
Asynchronous
Partitioning
Idempotent
Fault Tolerance
Vertical Vs. Horizontal Scaling
41
Vertical Scaling Horizontal Scaling
ACID BASE
Availability First Focus on Commit
Pessimistic Locking Optimistic Locking
Transactional Shared nothing
Favor Consistency Maximum Scalability
Most Distributed Systems Realize Both
Thank You !
42
43
44
Some of the images are taken by utilizing Google
search and due credit to the source.
Author do not claim any creation or originality of the contents. It is used only for
learning purposes

Contenu connexe

Tendances

Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
 
Virtualization and cloud Computing
Virtualization and cloud ComputingVirtualization and cloud Computing
Virtualization and cloud ComputingRishikese MR
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introductionShirish Bari
 
Apache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelApache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelOmi Om
 
Introduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQIntroduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQDmitriy Samovskiy
 
Spring Boot—Production Boost
Spring Boot—Production BoostSpring Boot—Production Boost
Spring Boot—Production BoostVMware Tanzu
 
From Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsFrom Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsTyler Treat
 
Distributed Computing system
Distributed Computing system Distributed Computing system
Distributed Computing system Sarvesh Meena
 
Distributed computing
Distributed computingDistributed computing
Distributed computingshivli0769
 
How to build microservices with node.js
How to build microservices with node.jsHow to build microservices with node.js
How to build microservices with node.jsKaty Slemon
 
쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기Brian Hong
 
Improving HDFS Availability with IPC Quality of Service
Improving HDFS Availability with IPC Quality of ServiceImproving HDFS Availability with IPC Quality of Service
Improving HDFS Availability with IPC Quality of ServiceDataWorks Summit
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure CallAbdelrahman Al-Ogail
 
Building Bizweb Microservices with Docker
Building Bizweb Microservices with DockerBuilding Bizweb Microservices with Docker
Building Bizweb Microservices with DockerKhôi Nguyễn Minh
 
Task scheduling Survey in Cloud Computing
Task scheduling Survey in Cloud ComputingTask scheduling Survey in Cloud Computing
Task scheduling Survey in Cloud ComputingRamandeep Kaur
 
How to be Successful with Scylla
How to be Successful with ScyllaHow to be Successful with Scylla
How to be Successful with ScyllaScyllaDB
 
Micro services vs Monolith Architecture
Micro services vs Monolith ArchitectureMicro services vs Monolith Architecture
Micro services vs Monolith ArchitectureMohamedElGohary71
 

Tendances (20)

Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 
Virtualization and cloud Computing
Virtualization and cloud ComputingVirtualization and cloud Computing
Virtualization and cloud Computing
 
Distributed Computing ppt
Distributed Computing pptDistributed Computing ppt
Distributed Computing ppt
 
Comet Cloud
Comet CloudComet Cloud
Comet Cloud
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introduction
 
Apache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelApache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache Camel
 
Introduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQIntroduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQ
 
Spring Boot—Production Boost
Spring Boot—Production BoostSpring Boot—Production Boost
Spring Boot—Production Boost
 
From Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsFrom Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed Systems
 
Distributed Computing system
Distributed Computing system Distributed Computing system
Distributed Computing system
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
How to build microservices with node.js
How to build microservices with node.jsHow to build microservices with node.js
How to build microservices with node.js
 
쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기
 
Improving HDFS Availability with IPC Quality of Service
Improving HDFS Availability with IPC Quality of ServiceImproving HDFS Availability with IPC Quality of Service
Improving HDFS Availability with IPC Quality of Service
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure Call
 
Building Bizweb Microservices with Docker
Building Bizweb Microservices with DockerBuilding Bizweb Microservices with Docker
Building Bizweb Microservices with Docker
 
Task scheduling Survey in Cloud Computing
Task scheduling Survey in Cloud ComputingTask scheduling Survey in Cloud Computing
Task scheduling Survey in Cloud Computing
 
How to be Successful with Scylla
How to be Successful with ScyllaHow to be Successful with Scylla
How to be Successful with Scylla
 
Micro services vs Monolith Architecture
Micro services vs Monolith ArchitectureMicro services vs Monolith Architecture
Micro services vs Monolith Architecture
 

Similaire à Scalability Design Principles - Internal Session

A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...Qian Lin
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systemselliando dias
 
Designing, Building, and Maintaining Large Cubes using Lessons Learned
Designing, Building, and Maintaining Large Cubes using Lessons LearnedDesigning, Building, and Maintaining Large Cubes using Lessons Learned
Designing, Building, and Maintaining Large Cubes using Lessons LearnedDenny Lee
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephenSteve Feldman
 
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & TableauBig Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & TableauSam Palani
 
Continuous Availability and Scale-out for MySQL with ScaleBase Lite & Enterpr...
Continuous Availability and Scale-out for MySQL with ScaleBase Lite & Enterpr...Continuous Availability and Scale-out for MySQL with ScaleBase Lite & Enterpr...
Continuous Availability and Scale-out for MySQL with ScaleBase Lite & Enterpr...Vladi Vexler
 
Intro to MySQL Master Slave Replication
Intro to MySQL Master Slave ReplicationIntro to MySQL Master Slave Replication
Intro to MySQL Master Slave Replicationsatejsahu
 
Microservices - Is it time to breakup?
Microservices - Is it time to breakup? Microservices - Is it time to breakup?
Microservices - Is it time to breakup? Dave Nielsen
 
Building a highly scalable and available cloud application
Building a highly scalable and available cloud applicationBuilding a highly scalable and available cloud application
Building a highly scalable and available cloud applicationNoam Sheffer
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability ConsiderationsNavid Malek
 
TechTarget Event - Storage Architectures for the Modern Data Center - Howard ...
TechTarget Event - Storage Architectures for the Modern Data Center - Howard ...TechTarget Event - Storage Architectures for the Modern Data Center - Howard ...
TechTarget Event - Storage Architectures for the Modern Data Center - Howard ...NetApp
 
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your MindDeliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your MindAvere Systems
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive WritesLiran Zelkha
 
high performance databases
high performance databaseshigh performance databases
high performance databasesmahdi_92
 
Cloud Ready Apps
Cloud Ready AppsCloud Ready Apps
Cloud Ready AppsDotitude
 
Self-Tuning MySQL - a Hosting Provider's Unfair Advantage
Self-Tuning MySQL - a Hosting Provider's Unfair AdvantageSelf-Tuning MySQL - a Hosting Provider's Unfair Advantage
Self-Tuning MySQL - a Hosting Provider's Unfair AdvantageDeep Information Sciences
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabasesAdi Challa
 
MySQL Visual Analysis and Scale-out Strategy definition - Webinar deck
MySQL Visual Analysis and Scale-out Strategy definition - Webinar deckMySQL Visual Analysis and Scale-out Strategy definition - Webinar deck
MySQL Visual Analysis and Scale-out Strategy definition - Webinar deckVladi Vexler
 
MonogDB Admin 101 - MonogDBDays Munich
MonogDB Admin 101 - MonogDBDays MunichMonogDB Admin 101 - MonogDBDays Munich
MonogDB Admin 101 - MonogDBDays MunichMarc Schwering
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101MongoDB
 

Similaire à Scalability Design Principles - Internal Session (20)

A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systems
 
Designing, Building, and Maintaining Large Cubes using Lessons Learned
Designing, Building, and Maintaining Large Cubes using Lessons LearnedDesigning, Building, and Maintaining Large Cubes using Lessons Learned
Designing, Building, and Maintaining Large Cubes using Lessons Learned
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen
 
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & TableauBig Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
Big Data Analytics on the Cloud Oracle Applications AWS Redshift & Tableau
 
Continuous Availability and Scale-out for MySQL with ScaleBase Lite & Enterpr...
Continuous Availability and Scale-out for MySQL with ScaleBase Lite & Enterpr...Continuous Availability and Scale-out for MySQL with ScaleBase Lite & Enterpr...
Continuous Availability and Scale-out for MySQL with ScaleBase Lite & Enterpr...
 
Intro to MySQL Master Slave Replication
Intro to MySQL Master Slave ReplicationIntro to MySQL Master Slave Replication
Intro to MySQL Master Slave Replication
 
Microservices - Is it time to breakup?
Microservices - Is it time to breakup? Microservices - Is it time to breakup?
Microservices - Is it time to breakup?
 
Building a highly scalable and available cloud application
Building a highly scalable and available cloud applicationBuilding a highly scalable and available cloud application
Building a highly scalable and available cloud application
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
 
TechTarget Event - Storage Architectures for the Modern Data Center - Howard ...
TechTarget Event - Storage Architectures for the Modern Data Center - Howard ...TechTarget Event - Storage Architectures for the Modern Data Center - Howard ...
TechTarget Event - Storage Architectures for the Modern Data Center - Howard ...
 
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your MindDeliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
 
high performance databases
high performance databaseshigh performance databases
high performance databases
 
Cloud Ready Apps
Cloud Ready AppsCloud Ready Apps
Cloud Ready Apps
 
Self-Tuning MySQL - a Hosting Provider's Unfair Advantage
Self-Tuning MySQL - a Hosting Provider's Unfair AdvantageSelf-Tuning MySQL - a Hosting Provider's Unfair Advantage
Self-Tuning MySQL - a Hosting Provider's Unfair Advantage
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
MySQL Visual Analysis and Scale-out Strategy definition - Webinar deck
MySQL Visual Analysis and Scale-out Strategy definition - Webinar deckMySQL Visual Analysis and Scale-out Strategy definition - Webinar deck
MySQL Visual Analysis and Scale-out Strategy definition - Webinar deck
 
MonogDB Admin 101 - MonogDBDays Munich
MonogDB Admin 101 - MonogDBDays MunichMonogDB Admin 101 - MonogDBDays Munich
MonogDB Admin 101 - MonogDBDays Munich
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101
 

Dernier

VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiVIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️soniya singh
 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...Amil baba
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130Suhani Kapoor
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation decktbatkhuu1
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Yantram Animation Studio Corporation
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentationamedia6
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxjeswinjees
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Douxkojalkojal131
 
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...Pooja Nehwal
 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...Suhani Kapoor
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CANestorGamez6
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
Petrosains Drama Competition (PSDC).pptx
Petrosains Drama Competition (PSDC).pptxPetrosains Drama Competition (PSDC).pptx
Petrosains Drama Competition (PSDC).pptxIgnatiusAbrahamBalin
 
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiVIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiSuhani Kapoor
 

Dernier (20)

VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiVIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
 
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
 
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentation
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptx
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
 
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
Petrosains Drama Competition (PSDC).pptx
Petrosains Drama Competition (PSDC).pptxPetrosains Drama Competition (PSDC).pptx
Petrosains Drama Competition (PSDC).pptx
 
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiVIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
 

Scalability Design Principles - Internal Session

  • 1. Scalable Web Design – Principles and Patterns Speaker : Sachin Prakash Sancheti Principal Architect – Cloud (Windows Azure) 1
  • 3. 3 Server Busy!! Your Request can not be processed, please try after some time I am trying to book a ticket for 1 hour now  Please wait!
  • 4. Any Real life Examples? 4 Survey
  • 5. What is Scalability? • It is NOT – Only Performance – High Availability – Business Continuity Planning • It Is – Traffic, User Growth – Dataset, Database Size Growth 5
  • 6. What is Scalability? • Scalability – “The Scalability is measure of number of users it can effectively support at the same time without degrading the defined performance” – Has limits – E.g. “With two load balanced capacity it should support 1000 concurrent users with average response time of 3 seconds” • “Performance is what an individual user experiences; Scalability is how many users get to experience it TOGETHER” 6
  • 7. What is the Concern? • Scalability is a business concern – Google observed 500-milisecond delay to page response caused 20% decrease in traffic – Amazon.com observed 100-milisecond delay caused a 1% decrease in retail revenue – Remember “Performance is what an individual user experiences; Scalability is how many users get to experience it TOGETHER” 7
  • 8. Handling Scalability – Degraded Application • Degraded Application – Doing nothing  and loosing business 8
  • 9. Handling Scalability - Throttling • Throttling – Throttling the requests to temporarily stop accepting new requests and serve better to existing or important users 9
  • 10. Handling Scalability – Adding Resources • Adding Resources – Scaling up – Vertical Scaling • Get Bigger • Widening the roads – Scaling out – Horizontal Scaling • Get More • Routing the traffic (Partitioning) 10
  • 11. Typical Web Application Resources • Web Server, Application Server (Middle Tier) and Database Tier 11 Web Server Database Server Application Server
  • 12. Scaling Solutions • Vertical Scaling OR Scaling Up – Increasing resource power – Remember widening the roads!! • Horizontal Scaling OR Scaling Out – Adding additional machines/nodes – Remember routing the traffic 12
  • 13. Vertical Vs. Horizontal Scaling 13 Vertical Scaling Horizontal Scaling Higher Capital Investment On Demand Investment Utilization concerns Utilization can be optimized Relatively Quicker and works with the current design Relatively more time consuming and needs redesigning Limiting Scale Internet Scale Not Cloud Native Design Cloud Native Design
  • 15. Scaling Out Web Server – Load Balancing 15 Web Server Web Server Web Server • Design for Fault Tolerance – Intent : Enables system to continue its intended operation, possibly at a reduced level, rather than failing completely, when some part of the system fails – Drivers: Degraded services are better than no service at all. Compare cost effectiveness – Solution: • Load Balancing • Monitoring, Self Healing, Restart
  • 16. Pattern - Bi-directional Scaling • Design for Scaling Out (Bidirectional) – Intent: Deployment built using commodity of hardware working together for economies of scale. Optimization is easier with scaling out and in, rather than scaling up and down. Driven for Elasticity – Driver: Optimized utilization, cost saving – Solution: • Stateless Application Design • Nothing is shared except Database • Scaling every tier is possible – Web/Service/Database etc. 16
  • 17. Scaling Out / Horizontally: Adding Removing Boxes
  • 18. Design Principle - Stateless Design • Stateless designs increases scalability – Don’t store anything locally on Web Server • Session State – Local Sessions – Avoid – Not Scalable • Load Balancer Sticky sessions can create hot spot load – Central Session – Good – Distributed Cache, Database – Client Session – Better – Client Cookie – No Session – Awesome 18
  • 19. Design Principle – Loosely Coupled • Components and layers should be loosely coupled to be able to scale each layer separately 19 Database Server Web Servers Application Servers
  • 20. Caching in Scalability • Caching helps in avoiding scale • In-memory distributed cache offers an excellent solution to data storage bottlenecks • Distributed caching clusters can keep growing horizontally, just like the application servers. This reduces pressure on data storage so that it is no longer a scalability bottleneck. 20
  • 21. Design Pattern - Cache Aside Pattern • Prefer Cache to Database for Reading – Intent : Increase read throughput and reduce database bottleneck – Drivers: Distributed cache are faster and shared across web/application servers – Solution: • Update cache and database both for synchronization • Read from Cache • Decorator Design Pattern 21 Distributed Cache Write Read
  • 22. Design Pattern - Cache Read-through/Write-through (RT/WT) • Prefer Cache to Database – Intent: Increase read throughput and reduce database bottleneck. Use Cache for read write both – Drivers: Distributed cache are faster and shared across web/application servers – Solution: • Application treats cache as the main data store and reads data from it and writes data to it. • The cache is responsible for reading and writing this data to the database, thereby relieving the application of this responsibility, asynchronously 22
  • 23. 23 Design Pattern - Cache Read-through/Write-through (RT/WT)
  • 25. CAP Theorem • CAP theorem, also known as Brewer's theorem, states that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: Consistency, Availability and Partition tolerance. • Consistency: All clients always have the same view of the data • Availability: Each client can always read and write • Partition Tolerance: The system works well despite physical network partition 25
  • 26. CAP Theorem – Database Placements 26
  • 27. Database Scaling – Replication - Read Mostly Pattern • Intent: Increase database scalability by separating write and read operations – Generally most of the applications have around 80% read and 20% write • Drivers: Separate read write responsibilities, High availability benefits • Solution: – Read Write Separation – Master Slave Pattern 27
  • 28. Database Scaling – Read Write Separation 28 Reads and Writes Reads
  • 29. Design Pattern – Partitioning / Sharding • Design for Database Sharding – Intent: Increasing data size might rise throttling. Database scale and performance is more important than reliability. CAP Theorem – Drivers: Scaling database layer, increasing database throughput – Solution: • Database Sharding / Horizontal Partitioning • Database Federation 29
  • 30. Shard Resolver Shard = User ID % 4 Database Sharding Example 30 Shard 0 25% Shard 1 25% Shard 2 25% User ID=3 Shard 3 25%
  • 31. Design Principles – Eventually Consistent • BASE Opposite to ACID – Intent: Real internet scale model. Postpone the consistency. • Basically Available, Soft state, Eventual consistency – Solution: • Queue Based processing Model • Change in behavior – Order Placed successfully TO Order Received Successfully 31
  • 32. Design Principles – Asynchronous Processing • Blocking is bane for Scalability – Intent: • Avoid blocking calls, reduce contention – Solution: • Queue Based processing Model • Fire and Forget Calls • 1000 users blocked for 5 seconds = 5000 users per second 32
  • 33. Design Principles – Parallel Design • Design for Parallel and Reliable Work – Intent: Increasing resources should results in a proportional increase in performance. Dependent services might not be available. Blocking is bane of scalability – Drivers: Higher reliability, Proportional distribution – Solution: • Concern Independent Scaling • Reliability through Queue • Queue driven worker tasks - more messages more workers faster work 33
  • 35. Queue - Load Leveling, Load Balancing, Loose Coupling 35
  • 36. Design Principles – Queue Based Pattern • Idempotent – Design the operation to be idempotent; that is, if it's carried out more than once, it's as if it was carried out just once – Implement the receiver in such a way that it can receive a message multiple times safely, either through a filter that removes already received messages or by adjustment of message semantics 36
  • 37. Design Principles – Capacity Planning • Everything has a limit: Compose a Scale – Intent: Design Around Provider SLAs and Capacity – Solution: • Know the limits, measure the scalability and increase the scale • E.g. Storage supports up to 10000 transactions/sec – Add storage for higher scale • E.g. Queue supports 5000 messages per seconds – Add additional Queues (Partitioning) for additional scale 37
  • 38. Design Pattern – Multi Site Deployment Pattern 38 Database Server Web Servers Application Servers Database Server Web Servers Application Servers Sync Routing • Performance Based • Round Robin • Failover Asia United States
  • 41. Vertical Vs. Horizontal Scaling 41 Vertical Scaling Horizontal Scaling ACID BASE Availability First Focus on Commit Pessimistic Locking Optimistic Locking Transactional Shared nothing Favor Consistency Maximum Scalability Most Distributed Systems Realize Both
  • 43. 43
  • 44. 44 Some of the images are taken by utilizing Google search and due credit to the source. Author do not claim any creation or originality of the contents. It is used only for learning purposes