Introduction:
Before discussing about a scalable app, let’s first understand what exactly is the meaning of scalability. Scalability refers to the capacity of a system with which it can give a consistent performance even under increasing load such as higher request rates, larger data, velocity, audience, etc.
The performance of an app remains equally smooth irrespective of 1 user or 1 million users if the app is scalable. Scalable apps work intelligently by removing irrelevant resources and capturing only the required important resources.
Now that the term scalability and its relevance with an app are clear, let’s proceed with discussing the two major ways of scaling which are horizontal and vertical scaling.
Horizontal Scaling (Scaling Out):
Horizontal scaling refers to growth of resources by addition of more units in cloud architecture of an app. To put it in simple words, it means addition of a greater number of small quantity units rather than adding one large capacity unit.
Vertical Scaling (Scaling Up):
Vertical scaling refers to single-unit resource maximization for increasing its capacity to gain control of increasing load. In terms of hardware, this consists of extra processing power and memory in the machine operating the server. In terms of software, scaling up refers to rearrangement of application code and algorithms.
Characteristics determining the scalability of an app:
- Availability
A company’s reputation relies a lot on its website/app opening time. Therefore, constant availability of website/application is extremely important without which a huge loss can be expected. - Performance
It is extremely imperative for an app/website to have speedy response and high recovery rate. A scaled app, having bad performance, can directly affect the SEO rankings. - Manageability
The system must be considerably easy to sustain, control and also updated. Any arising problem must be easy to spot and rectify. There must not be any break or failure in its functioning ever. - Cost
Along with hardware and software expenses, there are many other aspects involving cost as well. In order to hold and operate the website/app, total cost must be considered in advance.
Cloud Computing Vendors:
In order to develop a high-performance web application, the cloud provider must be chosen wisely. AWS, Microsoft Azure and Google Cloud are leading cloud computing vendors having their own pros and cons making them perfect for different situations and systems.
AWS occupies 33% market share of cloud computing which is the highest. It offers multiple services which are cloud-centred for different needs.
Developing A Scalable App on AWS Which Can Handle A Million Users
SINGLE USER
If you are the only person operating the app, initial progress initial progress can rather be very easy by utilizing the following AWS services:
Amazon Machine Images (AMI):
AMI provides the data required for instance to launch. AMI can be identified while the instance gets launched. An AMI also consists of templates for root volume of instance and gives approval to AWS accounts for using a specific AMI to launch instances.
Amazon Elastic Compute Cloud (Amazon EC2):
EC2 provides the facility of scalable computing in AWS cloud. In order to develop and install the apps easily, EC2 removes the hardware upfront.
Amazon Virtual Private Cloud (Amazon VPC):
Amazon VPC helps in launching AWS resources in virtual network. Full control on virtual network atmosphere can be gained with Amazon VPC such as choosing the IP address range, network gateways, arrangement of route tables and subnet design.
Amazon Route 53:
It is a cloud DNS web service which is highly scalable and accessible. It is very quick in combining the user requests to the infrastructure in AWS such as Amazon EC2 instances or the Elastic Load Balancing balancers.
Over here, vertical scaling can be simply picked and made use of. However, vertical scaling can just be considered for the initial phase but not forever. Ultimately, you are going to hit the wall.
USERS GREATER THAN 10 (Build multiple hosts & select database)
The first requirement is to choose the database as the users start to increase and generate data. It is advised to initiate with SQL Database as it is a recognized technology and has a huge community support with trending tools. Also, it is not going to break down SQL DBs in the initial 10 million consumers.
Till this stage, everything is in a single bucket and hence hard to scale and also touch to deal with in longer duration. Hence, this is the right time when you should go for multi-tier architecture in order to split the database from app.
USERS GREATER THAN 100 (Save database on Amazon RDS)
When the number of users reaches above 100, there are generally two options to install database on AWS. The first alternative is to take support of guided database service like Amazon RDS or Amazon Dynamo DB while the second option is hosting your own database on Amazon EC2.
Amazon RDS:
Amazon Relational Database Service allows easy management, arrangement and scaling of relevant database in cloud. There are six generally used database engines in Amazon RDS which are Oracle, MySQL, MariaDB, Amazon Aurora, Microsoft SQL Server and PostgreSQL.
USERS GREATER THAN 1000 (Creating Availability Zones)
Accessibility issues can occur according to the current architecture. Therefore, one more web instance must be available with you in another Availability Zone where the slave database can be placed to RDS.
Elastic Load Balancer (ELB):
The expansion of incoming application traffic is expanded to EC2 instances by ELB. ELB is horizontally scaled and provides SSL termination. It doesn’t need bandwidth limit and also executes health checks to make sure that the traffic is received by the health instances only.
At this moment, multiple EC2 instances are available with you which can provide service to more than 1000 users and this leads to increase in cloud cost as well. In order to reduce this cost, the usage of instances has to be optimized according to the changing load.
USERS FROM 10,000 TO 100,000 (Shifting of static content to object-based storage):
For better performance and to reduce the load from web servers, static content can be shifted to Amazon CloudFront or Amazon S3.
Amazon S3:
It is an object-based storage space which is not connected to EC2 instance thus making it the right choice for storing static content such as CSS, images, videos and JavaScript.
Amazon CloudFront:
It is also known as Content Delivery Network or CDN. It works by recovering Amazon S3 bucket data and spreading it further to multiple data centre locations. The content is stored at boundary locations to be further provided to users with lowest possible latency rates.
Amazon DynamoDB:
This is a convenient and faster method to utilize NoSQL database service for those apps which require reliable and single-digit millisecond latency.
Amazon ElastiCache:
This is a Caching-as-a-service which gets rid of the difficulties related to arrangement and management of distributed cache surrounding.
USERS GREATER THAN 1 MILLION (Using Service Oriented Architecture):
Service Oriented Architecture, also called SOA, is used to handle more than a million users while developing a large-scale web app. In SOA, each component is split from respective tiers to create separate services.
A host of generic services is provided by AWS to help in developing SOA infrastructure quickly. These are:
Amazon Simple Queue Service (SQS):
SQS is a service used for decoupling and coordinating the cloud app components thus making the tasks of sending, receiving or storing messages between software components very easy and quick.
Amazon Simple Notification Service (SNS):
SNS helps to send messages to a large number of users and it is very easy to install as well. Its smooth functioning and higher reliability help to forward notifications to everyone easily.
AWS Lambda:
This service helps you to run the codes with no botheration of managing or maintaining the servers. It goes for code-processing only when needed and then scales automatically as well within a second. Moreover, if the code is not working, it incurs no charge at all. Hence, the charges are taken only for the time you consumed.
Conclusion:
It is definitely not easy to learn development of scalable websites as it takes a lot of time and practice and investment but once you become an expert in it, your worth will increase manifold very quickly. Also, a website with slower working pages has a very negative impact on consumers not attracting them to return back thus affecting your profits directly. Therefore, it is recommended to develop an app which is scalable and can handle millions of users easily.