SlideShare a Scribd company logo
1 of 33
Download to read offline
!
"
#
$
%
&
'
$./run
{
Created by
Fabrício Epaminondas ©2015-2020
Designing
SCALABLE
APPLICATIONS
Short Talk
WHAT IS
SCALABILITY?
The concept
“Scalability is the capability of a system, network,
or process to handle a growing amount of work, or
its potential to be enlarged in order to
accommodate that growth.”
Bondi, André B. (2000). Characteristics of scalability and their
impact on performance.
3
Let's go deeper…
4
5Scalability for sandwiches
How hungry are you?
A bigger sandwich may fit your need
(vertical scaling)
6
7
How many people are hungry?
Think about it…
8
Fast-food restaurant CHAINS
You need to scale the entire solution
(horizontal scaling)
Scaling Computing Resources 9
• Processing (CPU)
• Memory
• Storage
• Network
Scale-up vs Scale-out
Vertical Scaling (Scale-up) 10
Generally refers to adding more processors and RAM,
buying a more expensive and robust server.
• Pros
•Generally less challenging to implement
•Less power consumption than running multiple servers
•Less licensing costs
• Less network hardware than scaling horizontally.
• Cons
• Hardware costs
•Greater risk of hardware failure causing bigger
outages
•Generally severe vendor lock-in and limited
upgradeability in the future
Horizontal Scaling (Scale-out): 11
• Generally refers to adding more servers with less
processors and RAM. This is usually cheaper overall and
can possibly scale infinitely.
• Pros
•Much cheaper than scaling vertically
•Easier to run fault-tolerance
•Easy to upgrade
• Cons
•More licensing fees
•Bigger footprint in the Data Center
•Higher utility cost (Electricity and cooling)
•Possible need for more networking equipment
(switches/routers)
Related concepts 12
• Performance
•Average Response Time (ART)
•Latency (usually network and disk I/O)
•Resource consumption
• High Availability
•Single Point of Failure (SPOF)
•Fault tolerance
USE CASE
Weather Forecast
Designing the software
14
• Mobile App to show world-
wide weather forecasts
• You planned to reach 1k users
at first week.
• Important notes:
•How many users will access
the system at same time?
•How to model workload?
•How to predict the future?
Weather Forecast App
15
• Use performance tests based on scenarios.
•Test types:
• Performance
•Validates the ART on a scenario (e.g.: systems
response takes 3secs with 100k users)
• Load
• Aims to understand required resources for running
the system (planning infrastructure).
• Stress
•Look for system failures under stress conditions (DoS,
outages, etc.)
Notes
16Solution #1: Two Tier Architecture
(O )
Client Server
Internet
4Gb Mem
1 vCPU*
* This virtual CPU unit represents the processing power of a CPU with 2 cores
17Solution #1: Two Tier Architecture
• Pros
• Easy setup
• Cons
•Single point of failure (1 SPOF)
• Vertical scaling costs (buy better hardware,
CPU, etc.)
18
• Your app is growing fast and
now it reached 10k users
after one month.
Weather Forecast App
19Solution #2: Three Tier Architecture
O )
Client
Web
Server
Data
Server
( 
4Gb Mem
1 vCPU
4Gb Mem
1 vCPU
Network Latency
Internet
Local/Private Network
20
• Pros
• Doubled the computing power
• Dedicated and optimized infrastructure (disk,
memory, etc.)
• IT operations specialists (database, server
management).
• Cons
• More points of failure on server side (2 SPOFs)
•Vertical scaling costs
• More network latency
Solution #2: Three Tier Architecture
21
• Forecast app is being used
in most important country
cities and it has at about 500k
users after two months.
•Some users are noticing
failures and outages while
trying to get the latest weather
information.
Weather Forecast App
22Solution #3: Clustering
O )Client
Web
Cluster
Data
Server
( 
4Gb Mem
1 vCPU
4Gb Mem
1 vCPU
Internet
Local/Private Network
(
Load
Balancer
+
23
• Pros
•High availability and fault tolerance
•Grid computing
•Out-of-box setup scaling for stateless applications
• Cons
•IT management more complex, e.g.: Deployment and
rollback procedures.
•Need to use a data sharing service for stateful
applications or use sticky sessions which may not
scale properly
•If Data Server is the bottleneck, you may also need a
cluster for it.
•More network latency
Solution #3: Clustering
24Solution #3: Stateful vs Stateless
O
)
User2
Web
Cluster
Data
Server
( Internet
Local/Private Network
(
Load
Balancer
A
B
OUser1
Session 1
Session 2
Web session stickiness example
+
25
• After a global market
campaign, some users
started to complain about a
slow UI loading in mobile
application, when opening
the latest weather
information from the internet.
Weather Forecast App
26
• Example of browser caching
Solution #4: Caching
[1] Reference: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#cache-control
27Solution #4: Caching
O
)
User2
Web
Cluster
Data
Server
(

Internet +
(
Load
Balancer
OUser1
(
Cache
Server
In Memory
Caching
Local
Caching
Local
Caching
Client
Caching
Client
Caching
Proxy
Caching
In Memory
Caching
Example: CDN for Static Web Content: html,
css, images, etc.
28Solution #4: Caching
Content Delivery Network(CDN)
29
• Pros
•Reduce wait time caused by latency problems
•Avoid waste of computing resources by caching long-
running operations like remote calls, disk I/O, etc.
•Cons
• Need to define metadata for control the cache storage.
•May require to minimal hardware for getting better
results (SSD, RAM, etc.), some devices such as mobile
have critical limitations.
• You may see out-of-date results while the old cache
was not invalidated yet.
Solution #4: Caching
30
• Your app is growing too fast,
it is known throughout the
world with more than 1
million users in two month
only.
•It is time to have your product
running in a cloud solution.
Weather Forecast App
31Solution #5: Full Distributed Cloud Service
Comments 32
,
!
"
#
$
%
&
'
$./run
{
Created by
Fabrício Epaminondas ©2015-2020
Contact
FABRICIO EPAMINONDAS
- linkedin.com/in/fabricioepa
. fabricioepa.wordpress.com
/ fabricioepa
0 @fabricioepa

More Related Content

What's hot

Distributed computing
Distributed computingDistributed computing
Distributed computing
Keshab Nath
 
System models for distributed and cloud computing
System models for distributed and cloud computingSystem models for distributed and cloud computing
System models for distributed and cloud computing
purplesea
 
mobile infrastructure management
mobile infrastructure managementmobile infrastructure management
mobile infrastructure management
Akhil Kumar
 

What's hot (20)

REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
Big Data Analytics with Hadoop
Big Data Analytics with HadoopBig Data Analytics with Hadoop
Big Data Analytics with Hadoop
 
Hive(ppt)
Hive(ppt)Hive(ppt)
Hive(ppt)
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
Social Impacts & Trends of Data Mining
Social Impacts & Trends of Data MiningSocial Impacts & Trends of Data Mining
Social Impacts & Trends of Data Mining
 
Cloud Computing Using OpenStack
Cloud Computing Using OpenStack Cloud Computing Using OpenStack
Cloud Computing Using OpenStack
 
SOAP-based Web Services
SOAP-based Web ServicesSOAP-based Web Services
SOAP-based Web Services
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systems
 
Next Generation Enterprise Architecture
Next Generation Enterprise ArchitectureNext Generation Enterprise Architecture
Next Generation Enterprise Architecture
 
System models for distributed and cloud computing
System models for distributed and cloud computingSystem models for distributed and cloud computing
System models for distributed and cloud computing
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Fundamentals of Servers, server storage and server security.
Fundamentals of Servers, server storage and server security.Fundamentals of Servers, server storage and server security.
Fundamentals of Servers, server storage and server security.
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
Network monitoring tools
Network monitoring toolsNetwork monitoring tools
Network monitoring tools
 
Public Cloud vs Private Cloud
Public Cloud vs Private CloudPublic Cloud vs Private Cloud
Public Cloud vs Private Cloud
 
Data streaming fundamentals
Data streaming fundamentalsData streaming fundamentals
Data streaming fundamentals
 
virtual hosting and configuration
virtual hosting and configurationvirtual hosting and configuration
virtual hosting and configuration
 
mobile infrastructure management
mobile infrastructure managementmobile infrastructure management
mobile infrastructure management
 

Viewers also liked

Info Card - Techical Debt Management
Info Card  - Techical Debt ManagementInfo Card  - Techical Debt Management
Info Card - Techical Debt Management
Fabricio Epaminondas
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
SFI
 
JPQL/ JPA Activity 3
JPQL/ JPA  Activity 3JPQL/ JPA  Activity 3
JPQL/ JPA Activity 3
SFI
 
Patni Hibernate
Patni   HibernatePatni   Hibernate
Patni Hibernate
patinijava
 
Web Services Part 2
Web Services Part 2Web Services Part 2
Web Services Part 2
patinijava
 

Viewers also liked (20)

Hexagonal architecture for java applications
Hexagonal architecture for java applicationsHexagonal architecture for java applications
Hexagonal architecture for java applications
 
Continuous testing in agile projects 2015
Continuous testing in agile projects 2015Continuous testing in agile projects 2015
Continuous testing in agile projects 2015
 
Understanding Web services
Understanding Web servicesUnderstanding Web services
Understanding Web services
 
Workshop Guide: RESTful Java Web Application with Spring Boot
Workshop Guide: RESTful Java Web Application with Spring BootWorkshop Guide: RESTful Java Web Application with Spring Boot
Workshop Guide: RESTful Java Web Application with Spring Boot
 
Introduction to developing modern web apps
Introduction to developing modern web appsIntroduction to developing modern web apps
Introduction to developing modern web apps
 
Continuous integration practices to improve the software quality
Continuous integration practices to improve the software qualityContinuous integration practices to improve the software quality
Continuous integration practices to improve the software quality
 
Quickstart for continuous integration
Quickstart for continuous integrationQuickstart for continuous integration
Quickstart for continuous integration
 
Info Card - Techical Debt Management
Info Card  - Techical Debt ManagementInfo Card  - Techical Debt Management
Info Card - Techical Debt Management
 
CQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersCQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java Developers
 
Hexagonal architecture - message-oriented software design
Hexagonal architecture  - message-oriented software designHexagonal architecture  - message-oriented software design
Hexagonal architecture - message-oriented software design
 
Hexagonal Architecture
Hexagonal ArchitectureHexagonal Architecture
Hexagonal Architecture
 
Protocol buffers
Protocol buffersProtocol buffers
Protocol buffers
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
 
15 jpa
15 jpa15 jpa
15 jpa
 
JPQL/ JPA Activity 3
JPQL/ JPA  Activity 3JPQL/ JPA  Activity 3
JPQL/ JPA Activity 3
 
Ejb5
Ejb5Ejb5
Ejb5
 
Patni Hibernate
Patni   HibernatePatni   Hibernate
Patni Hibernate
 
15 jpaql
15 jpaql15 jpaql
15 jpaql
 
Web Services Part 2
Web Services Part 2Web Services Part 2
Web Services Part 2
 
Working with jpa
Working with jpaWorking with jpa
Working with jpa
 

Similar to Designing Scalable Applications

Lessons from Large-Scale Cloud Software at Databricks
Lessons from Large-Scale Cloud Software at DatabricksLessons from Large-Scale Cloud Software at Databricks
Lessons from Large-Scale Cloud Software at Databricks
Matei Zaharia
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6
Sravanthi N
 
NetBackup Appliance Family presentation
NetBackup Appliance Family presentationNetBackup Appliance Family presentation
NetBackup Appliance Family presentation
Symantec
 
“Parallelizing Machine Learning Applications in the Cloud with Kubernetes: A ...
“Parallelizing Machine Learning Applications in the Cloud with Kubernetes: A ...“Parallelizing Machine Learning Applications in the Cloud with Kubernetes: A ...
“Parallelizing Machine Learning Applications in the Cloud with Kubernetes: A ...
Edge AI and Vision Alliance
 

Similar to Designing Scalable Applications (20)

Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
 
Lessons from Large-Scale Cloud Software at Databricks
Lessons from Large-Scale Cloud Software at DatabricksLessons from Large-Scale Cloud Software at Databricks
Lessons from Large-Scale Cloud Software at Databricks
 
Adding Value in the Cloud with Performance Test
Adding Value in the Cloud with Performance TestAdding Value in the Cloud with Performance Test
Adding Value in the Cloud with Performance Test
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6
 
Distributed Computing ppt
Distributed Computing pptDistributed Computing ppt
Distributed Computing ppt
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Scaling Databricks to Run Data and ML Workloads on Millions of VMs
Scaling Databricks to Run Data and ML Workloads on Millions of VMsScaling Databricks to Run Data and ML Workloads on Millions of VMs
Scaling Databricks to Run Data and ML Workloads on Millions of VMs
 
Database Virtualization: The Next Wave of Big Data
Database Virtualization: The Next Wave of Big DataDatabase Virtualization: The Next Wave of Big Data
Database Virtualization: The Next Wave of Big Data
 
NetBackup Appliance Family presentation
NetBackup Appliance Family presentationNetBackup Appliance Family presentation
NetBackup Appliance Family presentation
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
FInal Project - USMx CC605x Cloud Computing for Enterprises - Hugo Aquino
FInal Project - USMx CC605x Cloud Computing for Enterprises - Hugo AquinoFInal Project - USMx CC605x Cloud Computing for Enterprises - Hugo Aquino
FInal Project - USMx CC605x Cloud Computing for Enterprises - Hugo Aquino
 
Data stream processing and micro service architecture
Data stream processing and micro service architectureData stream processing and micro service architecture
Data stream processing and micro service architecture
 
Supporting operations personnel a software engineers perspective
Supporting operations personnel a software engineers perspectiveSupporting operations personnel a software engineers perspective
Supporting operations personnel a software engineers perspective
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDB
 
A Year of “Testing” the Cloud for Development and Test
A Year of “Testing” the Cloud for Development and TestA Year of “Testing” the Cloud for Development and Test
A Year of “Testing” the Cloud for Development and Test
 
“Parallelizing Machine Learning Applications in the Cloud with Kubernetes: A ...
“Parallelizing Machine Learning Applications in the Cloud with Kubernetes: A ...“Parallelizing Machine Learning Applications in the Cloud with Kubernetes: A ...
“Parallelizing Machine Learning Applications in the Cloud with Kubernetes: A ...
 
Brad stack - Digital Health and Well-Being Festival
Brad stack - Digital Health and Well-Being Festival Brad stack - Digital Health and Well-Being Festival
Brad stack - Digital Health and Well-Being Festival
 
Virtualization Uses - Server Consolidation
Virtualization Uses - Server Consolidation Virtualization Uses - Server Consolidation
Virtualization Uses - Server Consolidation
 
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Designing Scalable Applications

  • 1. ! " # $ % & ' $./run { Created by Fabrício Epaminondas ©2015-2020 Designing SCALABLE APPLICATIONS Short Talk
  • 3. “Scalability is the capability of a system, network, or process to handle a growing amount of work, or its potential to be enlarged in order to accommodate that growth.” Bondi, André B. (2000). Characteristics of scalability and their impact on performance. 3
  • 5. 5Scalability for sandwiches How hungry are you? A bigger sandwich may fit your need (vertical scaling)
  • 6. 6
  • 7. 7 How many people are hungry? Think about it…
  • 8. 8 Fast-food restaurant CHAINS You need to scale the entire solution (horizontal scaling)
  • 9. Scaling Computing Resources 9 • Processing (CPU) • Memory • Storage • Network Scale-up vs Scale-out
  • 10. Vertical Scaling (Scale-up) 10 Generally refers to adding more processors and RAM, buying a more expensive and robust server. • Pros •Generally less challenging to implement •Less power consumption than running multiple servers •Less licensing costs • Less network hardware than scaling horizontally. • Cons • Hardware costs •Greater risk of hardware failure causing bigger outages •Generally severe vendor lock-in and limited upgradeability in the future
  • 11. Horizontal Scaling (Scale-out): 11 • Generally refers to adding more servers with less processors and RAM. This is usually cheaper overall and can possibly scale infinitely. • Pros •Much cheaper than scaling vertically •Easier to run fault-tolerance •Easy to upgrade • Cons •More licensing fees •Bigger footprint in the Data Center •Higher utility cost (Electricity and cooling) •Possible need for more networking equipment (switches/routers)
  • 12. Related concepts 12 • Performance •Average Response Time (ART) •Latency (usually network and disk I/O) •Resource consumption • High Availability •Single Point of Failure (SPOF) •Fault tolerance
  • 14. 14 • Mobile App to show world- wide weather forecasts • You planned to reach 1k users at first week. • Important notes: •How many users will access the system at same time? •How to model workload? •How to predict the future? Weather Forecast App
  • 15. 15 • Use performance tests based on scenarios. •Test types: • Performance •Validates the ART on a scenario (e.g.: systems response takes 3secs with 100k users) • Load • Aims to understand required resources for running the system (planning infrastructure). • Stress •Look for system failures under stress conditions (DoS, outages, etc.) Notes
  • 16. 16Solution #1: Two Tier Architecture (O ) Client Server Internet 4Gb Mem 1 vCPU* * This virtual CPU unit represents the processing power of a CPU with 2 cores
  • 17. 17Solution #1: Two Tier Architecture • Pros • Easy setup • Cons •Single point of failure (1 SPOF) • Vertical scaling costs (buy better hardware, CPU, etc.)
  • 18. 18 • Your app is growing fast and now it reached 10k users after one month. Weather Forecast App
  • 19. 19Solution #2: Three Tier Architecture O ) Client Web Server Data Server (  4Gb Mem 1 vCPU 4Gb Mem 1 vCPU Network Latency Internet Local/Private Network
  • 20. 20 • Pros • Doubled the computing power • Dedicated and optimized infrastructure (disk, memory, etc.) • IT operations specialists (database, server management). • Cons • More points of failure on server side (2 SPOFs) •Vertical scaling costs • More network latency Solution #2: Three Tier Architecture
  • 21. 21 • Forecast app is being used in most important country cities and it has at about 500k users after two months. •Some users are noticing failures and outages while trying to get the latest weather information. Weather Forecast App
  • 22. 22Solution #3: Clustering O )Client Web Cluster Data Server (  4Gb Mem 1 vCPU 4Gb Mem 1 vCPU Internet Local/Private Network ( Load Balancer +
  • 23. 23 • Pros •High availability and fault tolerance •Grid computing •Out-of-box setup scaling for stateless applications • Cons •IT management more complex, e.g.: Deployment and rollback procedures. •Need to use a data sharing service for stateful applications or use sticky sessions which may not scale properly •If Data Server is the bottleneck, you may also need a cluster for it. •More network latency Solution #3: Clustering
  • 24. 24Solution #3: Stateful vs Stateless O ) User2 Web Cluster Data Server ( Internet Local/Private Network ( Load Balancer A B OUser1 Session 1 Session 2 Web session stickiness example +
  • 25. 25 • After a global market campaign, some users started to complain about a slow UI loading in mobile application, when opening the latest weather information from the internet. Weather Forecast App
  • 26. 26 • Example of browser caching Solution #4: Caching [1] Reference: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#cache-control
  • 27. 27Solution #4: Caching O ) User2 Web Cluster Data Server (  Internet + ( Load Balancer OUser1 ( Cache Server In Memory Caching Local Caching Local Caching Client Caching Client Caching Proxy Caching In Memory Caching Example: CDN for Static Web Content: html, css, images, etc.
  • 28. 28Solution #4: Caching Content Delivery Network(CDN)
  • 29. 29 • Pros •Reduce wait time caused by latency problems •Avoid waste of computing resources by caching long- running operations like remote calls, disk I/O, etc. •Cons • Need to define metadata for control the cache storage. •May require to minimal hardware for getting better results (SSD, RAM, etc.), some devices such as mobile have critical limitations. • You may see out-of-date results while the old cache was not invalidated yet. Solution #4: Caching
  • 30. 30 • Your app is growing too fast, it is known throughout the world with more than 1 million users in two month only. •It is time to have your product running in a cloud solution. Weather Forecast App
  • 31. 31Solution #5: Full Distributed Cloud Service
  • 33. ! " # $ % & ' $./run { Created by Fabrício Epaminondas ©2015-2020 Contact FABRICIO EPAMINONDAS - linkedin.com/in/fabricioepa . fabricioepa.wordpress.com / fabricioepa 0 @fabricioepa