5 Best Practices for Different Web Application Hosting Scenarios

Traditional Solution for Common Web Application Hosting

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.

Simple Web Application Hosting Architecture on Alibaba Cloud

The diagram below shows how the traditional web hosting architecture looks like when deployed using various Alibaba Cloud products and services:

  1. Elastic Compute Service (ECS): Built on Alibaba Cloud’s own large-scale distributed computing system, Elastic Compute Service or ECS is a scalable and highly-efficient cloud computing service. Alibaba Cloud ECS helps you to quickly build more stable and secure web applications to adapt to your business’ real-time needs.
  2. Object Storage Service (OSS): Alibaba Cloud offers various options to store, access, and backup your data on the cloud. For static storage, it provides Object Storage Service (OSS) to facilitate automatic data replication and failure recovery.
  3. ApsaraDB for RDS: Relational Database Service or RDS is a stable, reliable, elastic and high-performance online database service based on Alibaba Cloud’s own distributed system. It supports MySQL, SQL Server, PostgreSQL, and PPAS. Furthermore, it provides a comprehensive set of features including disaster recovery, data backup, monitoring, and migration.
  4. DNS: Alibaba Cloud DNS service provides a highly available and scalable DNS service for your domain management needs. It automatically reroutes requests for your domain to the nearest DNS server.
  5. Server Load Balancer (SLB): Server Load Balancer is a web traffic distribution service that maximizes and extends the external service capabilities of your web applications. By seamlessly distributing traffic across multiple cloud servers and eliminating single points of failure, SLB enhances the reliability, usability, and availability of your applications.

Leveraging the Cloud for Web Application Hosting

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.

Multiple Data Centers in a Region

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.

High Security for Web Applications and Servers

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.

  1. For the web server cluster, a firewall security group allows access only on ports 80 and 443 (HTTP and HTTPS).
  2. To protect the application server cluster, the security group allows access only from the web servers.
  3. For the DB server, its security group permits access to app data requests from the application servers. Additionally, the security group for DB servers permits access only from the application layer. To ensure complete security, access to port 22 (SSH) for direct host management is allowed only from the whitelisted IPs configured in the security group’s firewall rules.

Treating ECS as Dynamic Resources

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.

Best Practice #1: Application Hosting with Content Delivery

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.

Reference Architecture

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.

Best Practice #2: Web Application Hosting with Auto Scaling

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:

Reference Architecture

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:

Best Practice #3: Web Application Hosting with Higher IO Performance

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.

  1. ApsaraDB for Memcache: It is an online open caching service that provides high-speed access to queries and data while accessing hotspot data. Additionally, it supports key-value databases and is compatible with ECS service. You can retain hotspot data and reduce the stress on the database to shorten read response time.
  2. ApsaraDB for Read-only RDS: In case the read requests exceed the write requests, a single instance will fail to handle them, impacting the performance of the application. To achieve a smoother reading and writing ability, ApsaraDB can create replicas of master instances with read-only accounts for RDS in a particular region. This offers faster response to read/write requests. Additionally, the replicas handle the read requests while the master instance only caters to write requests.

Best Practice #4: Web Application Hosting with Multi-DC Disaster Recovery

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.

Reference Architecture

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.

Best Practice #5: Web Application Hosting with Multi-Region Deployment

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.

Reference Architecture

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.


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.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com