In today’s web-based scalable solutions, the architecture hiding behind the scenes is as crucial as the user-facing UI. Behind every smooth interaction, there is a complex system design that ensures better reliability and efficiency of the system! But just having an awesome system is not enough to handle massive traffic. So, do we have a solution? Yes of course.
Note, things we are going to discuss, is not something we will use as it is in production systems. We will use the concept but during production setup, we will fine-tune things, will use better approaches, etc. I will post a separate article discussing those fine-tunings.
Table of Contents
You can focus on things that are barriers or you can focus on scaling the wall or redefining the problem. – Tim Cook
Improve the performance using a Load Balancer
Say, Shreya is one of the frequent users of your service. Now imagine Shreya, requests a file or some data from your servers. But each time, Shreya is getting connected to a different server from a pool of servers, to get the data, Whichever server Shreya is getting connected, every time she is getting the expected data. This is nothing but the concept of a load balancer.
Load balancers can handle multiple cloned servers, and can distribute the workload evenly amongst these servers, to maintain optimal performance.
The Golden Rule of Scalability: Uniformity in Codebase
Scalability is awesome but consistency is the key. Every server in your load balancer cluster, must have the exact same codebase and every server should be capable of running independently. But how Shreya was getting the expected data everytime she hit. Do these server maintain cloned data? No.
No sessions or no profile specific info is stored in any of the servers. But they can use a shared data to maintain consistency. Like using a database or some caching system to store and retrieve data in a shared manner.
Centralized Sessions: The Backbone of Reliability
Sessions, are important considerations in user experience. It requires a centralized or in laymans term a shared data store that can be used by all the servers from the load balancer’s server pool. May it be a robust database (ex. MySQL, MongoDB etc.) or a high-speed caching system (ex. Redis) can be used. But the goal remains same, an uninterrupted data flow, regardless of server allocation.
Scaling horizontally (Wikipedia)
Scaling horizontally (out/in) means adding more nodes to (or removing nodes from) a system, such as adding a new computer to a distributed software application. An example might involve scaling out from one web server to three. High-performance computing applications, such as seismic analysis and biotechnology, scale workloads horizontally to support tasks that once would have required expensive supercomputers. Other workloads, such as large social networks, exceed the capacity of the largest supercomputer and can only be handled by scalable systems. Exploiting this scalability requires software for efficient resource management and maintenance
Optimizing Deployment with Server Automation Solutions
Deployment with such complex configurations can be realy difficult especially when you deploy 8 – 10 times a day. But deployment need not to be that hard! There are plenty of solution that helps you to automates these tasks.
- Progress Software: Leading the market share with 78.04% in the deployment category
- AWS Managed Services: Holding a significant market share of 5.38% in deployment
- Octopus Deploy: Another popular deployment tool with a market share of 4.00%
- Rundeck: A deployment tool with a market share of 3.15%
- Workday Launch: A tool capturing 1.39% of the market share in deployment
- Microsoft Azure Event Grid: Holding a market share of 1.05% in the deployment category
Is it always square one to deploy your scalable solutions?
Whenever you need to spin up a new server instance, you need to configure a lot of things right? But it would be hectic for us. What you can do is, you can create your very own custom system image, which you can use as a blueprint of the server. To achieve this we have several solutions available today.
- Amazon Machine Image (AMI): AMI is a template for launching virtual machines in Amazon EC2, containing an operating system and software configurations. AMIs are stored in Amazon S3, serve as the basis for EC2 instances, and enable quick deployment of services in the Cloud
- Google Cloud Platform (GCP) Images: GCP offers a similar service to AMIs for creating virtual machine instances within the Google Cloud environment, providing templates with pre-configured settings and software.
- Microsoft Azure Virtual Machine Images: Azure provides a comparable feature to AMIs, allowing users to create and customize virtual machines using predefined images with various operating systems and software configurations.
- DigitalOcean Droplets: Droplets on DigitalOcean are similar to AMIs, enabling users to create and deploy virtual machines quickly with pre-configured images or custom configurations based on specific needs.
- Alibaba Cloud Custom Images: Alibaba Cloud offers the ability to create custom images for virtual servers, allowing users to save configurations, applications, and settings for easy deployment of instances within the Alibaba Cloud platform.
With these tools, deployment of new instances will be a lot easier and it will be always ready at your fingertips.
Let’s explore further parts of this series to delve deeper into advanced scalability techniques leveraging load balancers, uniform codebases, centralized data stores, automation tools, custom server images, caching, aync processing and many more. Stay tuned! 😇