By Anthony Merrington, Technical Support Engineer at Alibaba Cloud
For many small and medium-sized enterprises, it can be tempting to take the easy way out when it comes to choosing which server setup to use for application deployments.
The fastest and simplest way, without doubt, is to deploy the entire environment on a single server. For example, a business can deploy both the application server and database server on a single Elastic Compute Service (ECS) instance. This deployment setup is straightforward to implement, but comes with drawbacks such as possible resource competition between the database and the application, as well as being not horizontally scalable.
To work around these issues and take advantage of the benefits offered by the cloud, you may need to slightly complicate the setup in exchange for a more secure, reliable, and horizontally-scalable system, which can serve your business better in the long term.
The following diagram shows the conversion of a single-server deployment to a more scalable cloud architecture that can serve a business as it expands.
You can transform your architecture by following these higher level steps:
Step 1: Set up a separate database server
To avoid contention between the application and database, separating the database server from the rest of the environment is a no-brainer. In Alibaba Cloud, you can set up an ApsaraDB RDS for MySQL instance to host databases in a few clicks. Moreover, you can use Data Transmission Service to migrate existing data from user-created databases on ECS instances to ApsaraDB for RDS instances.
Step 2: Set up load balancing
Now that the application is deployed on a dedicated ECS instance, you can easily scale out the deployment by adding new ECS instances in case your business expands. To make life easier, Alibaba Cloud allows you to create images from existing ECS instances and use the images to replicate your deployment on new ECS instances.
After multiple ECS instances are provisioned, it makes sense to set up a Server Load Balancer (SLB) instance across the ECS instances to improve application availability. This way, if one of the ECS instances fails, the others can continue to handle the incoming traffic until you restore the failed ECS instance.
Step 3: Update DNS settings
After you set up an SLB instance to distribute the workload among ECS instances, don’t forget to map your website domain to the public endpoint of the SLB instance at your DNS hosting provider. This directs the incoming traffic to the SLB instance so that load balancing actually takes effect.
The preceding steps are essential in transforming a single-server deployment into a more reliable and scalable deployment without creating too much complexity. However, if you are willing to make more changes, you can achieve better user experience with the following upgrades:
- Setting up Content Delivery Network to speed up static content delivery and enhance website loading speed.
- Leveraging ApsaraDB for Redis to handle high-concurrency workloads and improve application response time.
- Creating Object Storage Service (OSS) buckets to store, back up, and archive data securely and cost-effectively.
To learn more about transforming a single-server deployment into a more reliable, scalable, and responsive system, check out the following materials for free:
Best Practice tutorials:
- Transforming a Single-server Deployment for SMEs on Alibaba Cloud (explains how to perform the architecture upgrade detailed in this blog)
- Setting up a Typical Application Deployment for New Businesses on Alibaba Cloud (explains how to set up an architecture that is suitable for new business ventures due to its flexibility and cost effectiveness)