The document discusses how to build a scalable mobile app. It explains that as an app grows in users it needs to scale to continue performing well. There are two approaches to scaling - scaling out by adding more servers or scaling up by improving existing servers. The document recommends designing for scalability from the start by using a multi-server architecture with load balancing, developing in the cloud, and following a microservices approach. It also stresses the importance of database architecture and optimization to ensure scalability.
2. AT First what is the problem
● Guess your app currently serves about
10000 users and is running smoothly. But
what happened when so many users
accessing the app all at once !
● It starts to stall and becomes
unresponsive.running out of memory,
computing power and network bandwidth.
4. 1. index
➔ What is scalability
➔ Scaling mobile app Main concerns
➔ Two approach to scale a mobile app requirements
➔ Scale out VS Scale up
➔ Single Server VS Multi-Server architecture
➔ Develop in cloud
➔ Microservices Architecture
➔ DataBase Architecture
➔ Server Architecture
5. “Scaling an app is like replacing all
components of a car while driving it at
100mph”Mike Krieger, Instagram
But adding resources on the go
is easier if the app is built to
scale from the beginning
6. Comparison between mobile app development and web app development
● Operating Systems (OSes)
● hardware and software capabilities
● User Experience(UX)
● Mobile app Code !
○ the code must be re-written for every new device type and OS (And there
are so many of them! – Android, iOS, Blackberry and the list goes on).
○ coding for minimal network usage to optimize app performance.
SCALING MOBILE APPS: MAIN
CONCERNS
7. Comparison between mobile app development and web app development
● Mobile app Code !
○ Graphics tend to slow down the app and should be minimized or
removed for better performance
○ The amount of data that needs to move back and forth on a page needs
to be minimized.
○ Designing to reduce network requirements and lower number of
roundtrips between server and device will optimize app performance and
help in easy scalability.
SCALING MOBILE APPS: MAIN
CONCERNS
8. Comparison between mobile app development and web app development
● Mobile app Code !
○ Graphics tend to slow down the app and should be minimized or
removed for better performance
○ the amount of data that needs to move back and forth on a page needs
to be minimized.
○ Designing to reduce network requirements and lower number of
roundtrips between server and device will optimize app performance and
help in easy scalability.
SCALING MOBILE APPS: MAIN
CONCERNS
9. Mobile app requirements Scalability
● Case 1 : Develop for one platform , then extend to another platforms
(Native Development )
➔ Knows as phased development model
➔ For example, retailers usually develop for Android first to tap
into a much larger customer pool.
➔ Likewise, publishing companies may opt only for iPad or
android tablet apps as a larger screen lends a better UX
➔ As the app gains popularity it may be extended across other
device classes.
10. Mobile app requirements Scalability
● Case 2 : Use cross platforms ( Code base, Cross platform )
➔ Cross platforms : The hybrid apps developed using
cross-platform tools provide native-like experience to the end
user though they are not pure native apps. Developers build
apps quickly using a single development environment.
➔ The overall code is a collection of reusable units. Such
modular development allows easy portability of the app to
other OS and device types.
➔ Like titanium , cordova , React native or etc
11. The first Step to build a scalable mobile app
➔ is to define your scaling requirements correctly.
➔ The volume of information to be handled, concurrent access
and session lengths need to be considered.
➔ For instance, displaying static information is vastly different
from connecting a million people to exchange information in
real-time.
12. Scale out Vs Scale up
Scale up ( Vertical Scale )
● Fixed resource controller for all
processing.
● To add capacity, you attach
disk-shelves up to the maximum
for which the controller is rated.
● you will hit the upper limit on
computing and memory power
available on a single PC.
Scale out ( Horizontal scale )
● scale performance and capacity
separately or in lockstep by not
relying on a single controller
● If designed properly it can
provide infinite scalability at a low
cost.
● But design and development is
slightly complicated.
13. Single server Vs Multi-server architecture
Single Server
● use single server architecture
for their minimum viable
product (MVP)
● In single server architecture, one
server is hosting all of your
code, database and files
● Having a single point of failure is
risky as you may lose some data
● more cores and greater RAM
capacity are costlier
Multi-Server
● Use multi-server architecture
● separate servers for database,
code and content files right from
beginning and is easier to scale
● load balancer to distribute
requests between the servers
15. Load balancer
● A load balancer is a device that distributes network or application traffic
across a cluster of servers. Load balancing improves responsiveness and
increases availability of applications.
● When one application server becomes unavailable, the load balancer
directs all new application requests to other available servers in the pool.
Load balancing algorithms and methods
● The Least Connection Method
● The Round Robin Method
● The Least Response Time Method
● The Least Bandwidth Method
● The Least Packets Method
● The Custom Load Method
18. Develop in cloud
● Pay-as-you-go model to keep
costs low .
● Cloud architecture ensures
scalability and brings down
expenditure on IT provisioning.
● Small developer teams in
startups can benefit from the
managed services provided by
cloud vendors.
19. Microservices architecture
● A collection of small, autonomous services. Each service is
self-contained and should implement a single business capability.
● Each service is a separate codebase, which can be managed by a
small development team.
● Services can be deployed independently. A team can update an
existing service without rebuilding and redeploying the entire
application.
● Services communicate with each other by using well-defined APIs.
Internal implementation details of each service are hidden from other
services.
● Services don't need to share the same technology stack, libraries, or
frameworks.
20. Database architecture
● A scalable application has good database architecture. Few things to
keep in mind while designing your database for scaling:
● Query Optimization: Check index usage and add new indexes to get
better response time on slow-running queries. But maintaining
balance is crucial as too many indexes can hurt performance. Look
out for queries that place read/write locks on a table in your
database. Such queries can slowdown performance.
21. Database architecture
● Caching Servers: If you have queries returning the same data
repeatedly then instead of accessing the database each time, it can
be programmed to return the cached version from caching server.
● Optimizing your database to keep query response time low and
capacity building for higher traffic will ensure database scalability
when needed.
22. Thanks & Good luck!
Contact me
/moh.aboelfetouh
/aboelfetouh_
/in/mohamedaboelfetoh