SlideShare a Scribd company logo
1 of 28
Scaling your Web
Application
Scaling your Web App
Topics to be covered :
1. What is Scaling ?
2. Why do we need to scale ?
3. How do we scale ?
- Scaling up Vs. Scaling out
4. What is Sharding ?
5. RDBMS vs NoSQL (Perspective : Scalibility)
Web is Data

Username

Birthday

Blog Post

Images

Vidoes
Desirable Properties of a Web App

Scalability

High Availability

Performance

Manageability

Low Cost

Feature Rich

Generates $$$ :D
What is Scaling ?

Scalability
It is the property of your system to handle
growing amount of work in a graceful manner
or to be readily enlarged as demand
increases.

Scaling and performance are different.
So What is Performance ?

Performance :
The amount of useful work accomplished by a
computer system compared to the time and
resources used.
Better Performance means more work
accomplished in shorter time and/or using less
resources
Ok. Now What ?

I have an application up and running on
servers and Its doing pretty well.
Why should I think about scaling it ?
Will it really require scaling ?
Why do I need scaling ?

Who knows your app might be the next FB or
Twitter...

How will you handle so many Users doing so many
things over network ??? It might go up to processing
millions of request / second. So,
Scale it !!!!!! :)
OK. Cool.
I really need to think about scaling my
application now.
Wait a minute !!!!!
How should I do it ??
How Should I Scale ??
Well there are a couple of ways to
scale your application
1. Scaling Up
2. Scaling Out
Scaling Up vs. Scaling Out

Scaling Up :
− More CPU, Bigger HD, More RAM, etc.
− Biggest , fastest single computer that exists is still
not as fastest as two of such computers together.
− i.e. Diminishing returns => Not a good solution
Nah!! Not Efficient !!!!
Scaling Up Vs. Scaling Out

Scaling Out :
− Add more nodes

Master / Slave architecture

Sharding
Master / Slave Architecture
Master / Slave Architecture

Pros :
− Increased READ speed
− Takes READ load off of master
− Allows us to join across all tables

Cons:
− Doesn't buy increased write throughput
− Single point failure
What is Sharding ?

Sharding is the method of splitting your database
across several servers (called a Cluster).

Each shard can consist of one or multiple machines.
No machine has all your data on it.

More machines =>
More RAM.CPU =>
More operations/sec =>
Improved Throughput.
Yeyyy !!!!
What is Sharding ?
Sharding

Pros :
− Increased READ and WRITE throughput
− No Single Point Failure

Individual features can fail But Whole system won't go
down at a time.

Cons :
− Can't join queries between shards
RDBMS vs NoSQL
(Perspective : Scalibility)
Scaling : RDBMS

RDBMS guarantee ACID operationsACID operations but when a
relational database grows out of one server, it is no
longer that easy to use. In other words, they don't scale
out very well in a distributed system.

The CAP theoremCAP theorem states that a distributed (i.e. scalable)
system cannot guarantee all of the following properties at
the same time:
Consistency Availability Partition tolerance

Most NoSQL Databases drop Consistency in favour of
availability. Thats why they are better scalable.
Why NoSQL Databases Scale &
RDBMS does not (?)

Data Sharding would require distinct data entities that can be
distributed and processed independently.

RDBMS can't do that because of its table based nature

NoSQL do not distribute a logical entity across multiple tables,
it’s always stored in one place.

NoSQL only enforce consistency inside a single entity and
sometimes not even that.
Example
Does it mean that my app gives a
better performance now ?

No It doesn't. Performance depends on how correctly you
implement (scalable solution) for your case.

Besides there are several factors affecting like
− Disk I/O
− Network
− Caching
So What Should I Choose ?
MySQL
OR
MongoDB
MySQL OR MongoDB
“The real thing to point out is that if you are
being held back from making something super
awesome because you can’t choose a
database, you are doing it wrong.
If you know mysql, just use it. Optimize when
you actually need to.
Use it like a k/v store, use it like a rdbms, but for
god sake, build your killer app! None of this
will matter to most apps.
Facebook still uses MySQL, a lot. Wikipedia
uses MySQL, a lot. FriendFeed uses MySQL,
MySQL OR MongoDB
“What am I going to build my next app on?
Probably Postgres.
Will I use NoSQL? Maybe. I might also use
Hadoop and Hive. I might keep everything in
flat files.
Maybe I’ll start hacking on Maglev. I’ll use
whatever is best for the job.
If I need reporting or ACIDIty, I won’t be using
any NoSQL.
If I need caching, I’ll probably use Tokyo Tyrant.
Conclusion of the Debate
If there’s anything to take away from the
RDBMS vs NoSQL debate,
it’s just to be happy there are more tools, because
more cool tools means more win win situation for
everyone.
Summary
We covered following topics :
1. What is Scaling ?
2. Why do we need to scale ?
3. How to do we scale ?
- Scaling up Vs. Scaling out
4. What is Sharding ?
5. RDBMS vs NoSQL (Perspective : Scalibility)
Thank You
&
Questions
------------------------------------------------
Ketan Deshmukh.

More Related Content

What's hot

Architecture business cycle
Architecture business cycleArchitecture business cycle
Architecture business cycle
Himanshu
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
 

What's hot (20)

PHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP ServerPHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP Server
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Web Fundamentals
Web FundamentalsWeb Fundamentals
Web Fundamentals
 
.Net Core
.Net Core.Net Core
.Net Core
 
Javascript essentials
Javascript essentialsJavascript essentials
Javascript essentials
 
"CERT Secure Coding Standards" by Dr. Mark Sherman
"CERT Secure Coding Standards" by Dr. Mark Sherman"CERT Secure Coding Standards" by Dr. Mark Sherman
"CERT Secure Coding Standards" by Dr. Mark Sherman
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION
 
Web application architecture
Web application architectureWeb application architecture
Web application architecture
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Architecture business cycle
Architecture business cycleArchitecture business cycle
Architecture business cycle
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 

Viewers also liked

Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINX
NGINX, Inc.
 

Viewers also liked (7)

Scaling a Mobile Web App to 100 Million Clients and Beyond (MBL302) | AWS re:...
Scaling a Mobile Web App to 100 Million Clients and Beyond (MBL302) | AWS re:...Scaling a Mobile Web App to 100 Million Clients and Beyond (MBL302) | AWS re:...
Scaling a Mobile Web App to 100 Million Clients and Beyond (MBL302) | AWS re:...
 
Scaling your web app with MySQL replication
Scaling your web app with MySQL replicationScaling your web app with MySQL replication
Scaling your web app with MySQL replication
 
10 Pro Tips for scaling your startup from 0-10M users
10 Pro Tips for scaling your startup from 0-10M users10 Pro Tips for scaling your startup from 0-10M users
10 Pro Tips for scaling your startup from 0-10M users
 
XenApp Load Balancing
XenApp Load BalancingXenApp Load Balancing
XenApp Load Balancing
 
Load Balancing with Apache
Load Balancing with ApacheLoad Balancing with Apache
Load Balancing with Apache
 
(CMP401) Elastic Load Balancing Deep Dive and Best Practices
(CMP401) Elastic Load Balancing Deep Dive and Best Practices(CMP401) Elastic Load Balancing Deep Dive and Best Practices
(CMP401) Elastic Load Balancing Deep Dive and Best Practices
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINX
 

Similar to Scaling Your Web Application

Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
guest18a0f1
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
Adi Challa
 
Web scale architecture design
Web scale architecture designWeb scale architecture design
Web scale architecture design
NepalAdz
 
http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151
xlight
 
Databases benoitg 2009-03-10
Databases benoitg 2009-03-10Databases benoitg 2009-03-10
Databases benoitg 2009-03-10
benoitg
 

Similar to Scaling Your Web Application (20)

Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
Improving Drupal Performances
Improving Drupal PerformancesImproving Drupal Performances
Improving Drupal Performances
 
Drupal Performance : DrupalCamp North
Drupal Performance : DrupalCamp NorthDrupal Performance : DrupalCamp North
Drupal Performance : DrupalCamp North
 
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress PerformanceLevel Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress Performance
 
Web scale architecture design
Web scale architecture designWeb scale architecture design
Web scale architecture design
 
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
 
Stacktrace Berlin RC.2
Stacktrace Berlin RC.2Stacktrace Berlin RC.2
Stacktrace Berlin RC.2
 
MySQL HA Presentation
MySQL HA PresentationMySQL HA Presentation
MySQL HA Presentation
 
Klmug presentation - Simple Analytics with MongoDB
Klmug presentation - Simple Analytics with MongoDBKlmug presentation - Simple Analytics with MongoDB
Klmug presentation - Simple Analytics with MongoDB
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
 
http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151
 
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with AzureAzure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure
 
Databases benoitg 2009-03-10
Databases benoitg 2009-03-10Databases benoitg 2009-03-10
Databases benoitg 2009-03-10
 
Tech Talk Series, Part 3: Why is your CFO right to demand you scale down MySQL?
Tech Talk Series, Part 3: Why is your CFO right to demand you scale down MySQL?Tech Talk Series, Part 3: Why is your CFO right to demand you scale down MySQL?
Tech Talk Series, Part 3: Why is your CFO right to demand you scale down MySQL?
 
2019 StartIT - Boosting your performance with Blackfire
2019 StartIT - Boosting your performance with Blackfire2019 StartIT - Boosting your performance with Blackfire
2019 StartIT - Boosting your performance with Blackfire
 

Recently uploaded

+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)

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...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
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...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+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...
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 

Scaling Your Web Application

  • 2. Scaling your Web App Topics to be covered : 1. What is Scaling ? 2. Why do we need to scale ? 3. How do we scale ? - Scaling up Vs. Scaling out 4. What is Sharding ? 5. RDBMS vs NoSQL (Perspective : Scalibility)
  • 4. Desirable Properties of a Web App  Scalability  High Availability  Performance  Manageability  Low Cost  Feature Rich  Generates $$$ :D
  • 5. What is Scaling ?  Scalability It is the property of your system to handle growing amount of work in a graceful manner or to be readily enlarged as demand increases.  Scaling and performance are different.
  • 6. So What is Performance ?  Performance : The amount of useful work accomplished by a computer system compared to the time and resources used. Better Performance means more work accomplished in shorter time and/or using less resources
  • 7. Ok. Now What ?  I have an application up and running on servers and Its doing pretty well. Why should I think about scaling it ? Will it really require scaling ?
  • 8. Why do I need scaling ?  Who knows your app might be the next FB or Twitter...  How will you handle so many Users doing so many things over network ??? It might go up to processing millions of request / second. So, Scale it !!!!!! :)
  • 9. OK. Cool. I really need to think about scaling my application now. Wait a minute !!!!! How should I do it ?? How Should I Scale ??
  • 10. Well there are a couple of ways to scale your application 1. Scaling Up 2. Scaling Out
  • 11. Scaling Up vs. Scaling Out  Scaling Up : − More CPU, Bigger HD, More RAM, etc. − Biggest , fastest single computer that exists is still not as fastest as two of such computers together. − i.e. Diminishing returns => Not a good solution Nah!! Not Efficient !!!!
  • 12. Scaling Up Vs. Scaling Out  Scaling Out : − Add more nodes  Master / Slave architecture  Sharding
  • 13. Master / Slave Architecture
  • 14. Master / Slave Architecture  Pros : − Increased READ speed − Takes READ load off of master − Allows us to join across all tables  Cons: − Doesn't buy increased write throughput − Single point failure
  • 15. What is Sharding ?  Sharding is the method of splitting your database across several servers (called a Cluster).  Each shard can consist of one or multiple machines. No machine has all your data on it.  More machines => More RAM.CPU => More operations/sec => Improved Throughput. Yeyyy !!!!
  • 17. Sharding  Pros : − Increased READ and WRITE throughput − No Single Point Failure  Individual features can fail But Whole system won't go down at a time.  Cons : − Can't join queries between shards
  • 18. RDBMS vs NoSQL (Perspective : Scalibility)
  • 19. Scaling : RDBMS  RDBMS guarantee ACID operationsACID operations but when a relational database grows out of one server, it is no longer that easy to use. In other words, they don't scale out very well in a distributed system.  The CAP theoremCAP theorem states that a distributed (i.e. scalable) system cannot guarantee all of the following properties at the same time: Consistency Availability Partition tolerance  Most NoSQL Databases drop Consistency in favour of availability. Thats why they are better scalable.
  • 20. Why NoSQL Databases Scale & RDBMS does not (?)  Data Sharding would require distinct data entities that can be distributed and processed independently.  RDBMS can't do that because of its table based nature  NoSQL do not distribute a logical entity across multiple tables, it’s always stored in one place.  NoSQL only enforce consistency inside a single entity and sometimes not even that.
  • 22. Does it mean that my app gives a better performance now ?  No It doesn't. Performance depends on how correctly you implement (scalable solution) for your case.  Besides there are several factors affecting like − Disk I/O − Network − Caching
  • 23. So What Should I Choose ? MySQL OR MongoDB
  • 24. MySQL OR MongoDB “The real thing to point out is that if you are being held back from making something super awesome because you can’t choose a database, you are doing it wrong. If you know mysql, just use it. Optimize when you actually need to. Use it like a k/v store, use it like a rdbms, but for god sake, build your killer app! None of this will matter to most apps. Facebook still uses MySQL, a lot. Wikipedia uses MySQL, a lot. FriendFeed uses MySQL,
  • 25. MySQL OR MongoDB “What am I going to build my next app on? Probably Postgres. Will I use NoSQL? Maybe. I might also use Hadoop and Hive. I might keep everything in flat files. Maybe I’ll start hacking on Maglev. I’ll use whatever is best for the job. If I need reporting or ACIDIty, I won’t be using any NoSQL. If I need caching, I’ll probably use Tokyo Tyrant.
  • 26. Conclusion of the Debate If there’s anything to take away from the RDBMS vs NoSQL debate, it’s just to be happy there are more tools, because more cool tools means more win win situation for everyone.
  • 27. Summary We covered following topics : 1. What is Scaling ? 2. Why do we need to scale ? 3. How to do we scale ? - Scaling up Vs. Scaling out 4. What is Sharding ? 5. RDBMS vs NoSQL (Perspective : Scalibility)