By Derek Wang, Senior Staff Engineer
Deploying a highly available and scalable web application on a traditional data center is a complex and expensive undertaking. One must invest a lot of effort and resources into capacity management. But more often than not, it ends up in over or under-provisioning of resources, further resulting in inefficient investment in underutilized hardware. To tackle this challenge, Alibaba Cloud offers a reliable, scalable, and high-performing cloud infrastructure for most demanding web application deployment scenarios. This document intends to provide practical solutions and best practices when it comes to scaling your web application on Alibaba Cloud.
In a traditional web hosting space, designing a scalable architecture is always a challenge. The below diagram depicts a traditional web hosting model. The purpose of this diagram is to help you compare it with a similar architecture hosted on the cloud.
Traditional web hosting usually follows a three-tier design that divides the architecture into presentation, application, and persistence layers. The design achieves scalability through the inclusion of additional servers at each of these layers. The architecture also has built-in high availability features. The section below examines the means of deploying this traditional web hosting in Alibaba Cloud.
The diagram below shows how the traditional web hosting architecture looks like when deployed using various Alibaba Cloud products and services:
The key components of this architecture include:
When deploying a web application on Alibaba Cloud, you should consider making modifications in your deployment to fully utilize the advantages of the cloud. Below are some key considerations of when hosting an application on Alibaba Cloud.
Within a certain region, Alibaba Cloud usually operates at least two data centers called Availability Zones (AZs). Elastic Compute Service (ECS) in different AZs are both logically and physically separated. Alibaba Cloud provides an easy-to-use model for deploying your applications across AZs for higher availability and reliability.
Web application security is one of the primary concerns for organizations today, with more than 90% of the applications being vulnerable to security attacks. These attacks can exploit websites and inherent servers, which puts businesses at the risk of financial loss. To protect your web applications from such attacks, Alibaba Cloud provides a suite of network and application security services, such as Anti-DDoS (Basic and Pro), Web Application Firewall (WAF), and Server Guard.
In addition to these services, users can proactively limit external traffic by defining firewalls and permissions. The diagram below depicts the Alibaba Cloud web application hosting architecture that comes with a group firewall to secure the entire infrastructure.
To build and host a fault-tolerant and a scalable application on Alibaba Cloud, you will need a flexible system that takes the dynamic nature of ECS into account. It is essential to understand that cloud resources may become unavailable or lost in case of a failure. Moreover, once a new virtual server is provisioned, you cannot assume anything about the IP address allocated to it. To handle such scenarios, Alibaba Cloud allows you to select the location of resources and provides Elastic IPs. They are procured for keeping the IP address of a resource as static. In case you provision a new ECS instance, you can map the same EIP to the new instance.
With all these factors in mind, let's look at some of the best practices for deploying your web applications based on specific scenarios.
Up until this point, the above web application architecture was best suited to serve all the user requests from a single central location. However, in case of high traffic volume, Content Delivery Network (CDN) helps to optimize the performance of your web application ensuring a latency-free experience.
With Alibaba Cloud CDN, a growing network of global edge locations is responsible for caching static and streaming content. CDN fetches original content from OSS and caches the content at edge nodes. Once cached, future requests are automatically routed to the nearest edge location to ensure content delivery with the best possible performance. This process, in turn, frees up extra load from servers due to the traffic hitting servers directly, allowing an efficient consumption of compute resources.
The following architecture diagram illustrates a typical web application hosting with CDN.
Alibaba Cloud CDN can also work seamlessly with any non-Alibaba Cloud origin server. There are also no financial commitments for using Alibaba Cloud CDN – you pay only for as much or as little content that actually gets delivered through the service.
In a traditional infrastructure hosting model where you require to provision a fixed number of servers, you are forced to stand up servers based on demand spikes. This method relies on accurate capacity planning, or else would lead to considerable expenditure on unused server capacity. In the real world, a typical traffic experienced on a website looks like this:
On Alibaba Cloud, a web application can leverage on-demand provisioning of additional servers, or downward adjustment during less traffic period to minimize utility cost. All of these are performed automatically by Alibaba Cloud Auto Scaling service. Instead of a traffic forecasting model to provision servers ahead, Alibaba Cloud Elastic Compute Service (ECS instances are provisioned on the fly according to a set of triggers for scaling the fleet out and back in. Addition or removal of servers managed by Auto Scaling from Server Load Balancer occurs automatically, making this deployment option a genuinely robust setup. The diagram below illustrates a typical web application hosting along with auto-scaling:
Let us now briefly discuss the key component of this architecture, Auto Scaling. You can set up Auto Scaling triggers depending on metrics data obtained directly from Alibaba Cloud Monitor. For example – you can set Auto-scaling to trigger if the CPU utilization has been at 75% or above for the past five minutes or in case your current application uses up to 35% of the memory. Moreover, you can also provision a set number of instances at a particular time according to the expected load and your organization's requirements.
In the face of growing business demands, the need to maintain your application's high performance is crucial. Even the minutest of failures can lead to extreme response time and hamper user experience. The traditional single instance database design may not be sufficient enough to meet a large volume of I/O requests.
To reduce the burden from the database, you should separate write and read requests into different database instances. While you carry out the separation, don't forget to include a memcached layer between the web hosting servers and the database.
There are two key components in this architecture:
For businesses with large-scale, mission-critical web applications, the need to maintain high availability for a seamless user experience is crucial. In spite of the fact that cloud infrastructure ensures protection through security services you still need cross-data center deployments to provide additional security. This becomes even more imperative in case of data center downtime.
The key feature of this cloud architecture design is to distribute all the servers and database services across multiple DCs or Available Zones. This distribution is done as long as the servers are among the same region and can serve as one single web application system.
Let us look at the key considerations of Alibaba Cloud Web Application Hosting with Multi-DC Disaster Recovery.
Complete Automation: This architecture detects server-related problems and ensures recovery by switching the production environment with the disaster recovery environment. ApsaraDB for RDS maintains a data backup but and also turns databases endpoints automatically in case the master database machine fails to function, ensuring excellent availability.
Full Resource Utilization: In the suggested cloud architecture, there are no resources dedicated to the DR environment. As soon as any problem occurs, the system uses resources from the production environment to ensure disaster recovery. This facilitates the full utilization of resources, which makes it a cost-effective solution for businesses.
For businesses operating in multiple countries or planning to expand globally, having a flexible IT architecture is essential for business growth. Such companies need highly stable and superior quality networks to keep up with technology and changing demands. For such firms, the primary concern relates to the critical need for an efficient and secure network through which they can connect their global businesses. Leasing lines from telecom service providers can be a costly option for small or mid-sized enterprise companies. To address this, Alibaba Cloud offers an easy and cost-effective way to connect with different regions of the world through dedicated lines. It also provides several other solutions to address data replication/synchronization across regions.
The architecture below matches the need of multi-node deployments across different regions. An application that is deployed in China can also be deployed in the U.S. region simultaneously. The two applications interact with each other at the service and data layers. Using Alibaba Cloud Express Connect, the two VPCs in multiple regions are connected through a dedicated line. This allows a secure connection via the internet between ECS instances located in the China region and those located in the U.S. region. Despite being in different locations, the two RDS instances can also synchronize data in real time. Alibaba Cloud OSS allows cross-region data replication to meet the demands of a large volume of data replication through the Internet.
A multi-region deployment based on this architecture is simple and cost effective. Users can quickly build their multi-region application and maintain all the cloud resources around the world with a single Alibaba Cloud account. Alibaba Cloud also offers multiple data transmission solutions to address most users' business scenarios requirement.
On comparing the traditional and cloud web hosting methods, as an organization, it is imperative for you to look beyond hardware and price to leverage the true inherent value of the hosting solution and the associated business benefits. A traditional web hosting system requires you to purchase, install, manage, and maintain the hardware setup and infrastructure to host your site; a task that can take an extremely long duration. Such necessities make the traditional hosting solution cumbersome, time-consuming, and extortionate.
Moreover, most of the large-scale enterprises have a presence in multiple locations, each needing a dedicated vendor/staff. Managing these vendors from a remote location further adds up to the organizational cost. Also, there are other hidden costs such as extra taxations to procure hardware, delivery charges, and along with operational overheads.
In contrast, cloud web hosting offers multiple advantages with a potential to yield significant business benefits. Also, cloud web hosting ensures SLAs that promise high availability for your website. Besides, it lets you pay as you consume the resources with no hidden costs enabling you to plan your IT budget efficiently.
Alibaba Clouder - August 25, 2020
Alibaba Clouder - August 25, 2020
Alibaba Clouder - August 26, 2020
Alibaba Clouder - July 24, 2018
Alibaba Clouder - October 20, 2020
Alibaba Clouder - August 15, 2019
Explore Web Hosting solutions that can power your personal website or empower your online business.Learn More
Explore how our Web Hosting solutions help small and medium sized companies power their websites and online businesses.Learn More
Deploy custom Alibaba Cloud solutions for business-critical scenarios with Quick Start templates.Learn More
Web App Service allows you to deploy, scale, adjust, and monitor applications in an easy, efficient, secure, and flexible manner.Learn More
More Posts by Alibaba Clouder