Boost Your E-Commerce Business in China Using Global Acceleration

By Rohit Gupta, Solutions Architect

For many international businesses with a presence in China, network stability issues are often the biggest concern when their users or employees in China try to access services based in other countries and regions. In the past, resolving these issues required a lot of technical expertise and expensive leased network capacity. Thanks to Alibaba Cloud’s network products, this is no longer the case. It is now a relatively simple and straightforward task to get your mission critical applications running smoothly for your Chinese user base! Read on.

Alibaba Cloud has several market-leading network products and services which help to resolve networking issues for customers in and outside of China, including Global Acceleration (GA for short). GA is a network acceleration product that provides a dedicated network connection between two Alibaba Cloud regions. One region is designated as the “service area” and one is the “accelerated area”. The “service area” is the region which hosts the service or application your users need access to, while the “accelerated area” is an Alibaba Cloud region closest to your users (say, in China). The accelerated area will usually expose a public IP (a fundamental concept of GA) to users which they can use to access whatever service is hosted in the “service area”.

Problem Statement

The organization is a typical e-commerce business that sells fashion brands online to their wide customer base in and outside China. Their customers outside China are satisfied with the website access but the users in China don’t get a consistent and/or good performance. For users in China, the access is usually slow and unstable, discouraging the shoppers and leading to a considerable fall in sales. To add to the misery, in a week’s time, there is a huge global online sales event where they are expecting a substantial increase in website visits.

Hence, the organization needs a quick and definite solution to achieve following:

  1. Improved shopping experience for users in China in general to boost the sales.

Technical Overview

In some cases, the service your users want to access may not actually be hosted on Alibaba Cloud. In this case, you need to establish a proxy in the Alibaba Cloud “service area” region which can accept requests from the “accelerated area” and forward them on. The following is the typical architecture for a scenario where user access in China is accelerated for a website hosted in Sydney. Global Acceleration (GA) is used to send traffic from China to a proxy server located in Alibaba Cloud’s Sydney region, which then forwards user traffic on to the correct address (website).

How does traffic flow in this solution? Let’s take a look:

  1. User in China tries to access the Australian website via their web browser: a DNS request is made.

Key Architecture Components

S.NoComponentDescription1Accelerated areaAn accelerated area is the area where you want to improve the user experience. China is the accelerated area for our setup2Service areaService area is the area/region where the service that needs to be accelerated is hosted. Australia is the service area in our example3GA instanceAn Alibaba Cloud GA instance must be created in the accelerated area/region. The GA instance can only bind to an Alibaba Cloud ECS instance or an Alibaba Cloud SLB4Reverse ProxyIf the origin server (where the service is hosted) is not an Alibaba Cloud ECS instance or SLB, you need to use a reverse proxy to route the traffic to Alibaba Cloud resources (SLB or ECS) You don’t need a reverse proxy to bind to the GA instance if the service is hosted on an Alibaba Cloud ECS instance and/or a CDN is not being used to serve the website requests5CDNThis is an optional component. But if this is in place, you need to use a reverse proxy with GA to route the traffic because GA can’t bind to a CDN domain at the backend6Origin serverThis is the server that hosts the service to be accelerated. It could be an Alibaba Cloud ECS instance or a server outside Alibaba Cloud. As mentioned earlier, if it is non-Alibaba Cloud server, you must use a reverse proxy solution with the GA to route the traffic

Deploy the Solution

Proxy Setup

The proxy setup consists of a Server Load Balancer (SLB) and an ECS instance sitting behind it. The high level steps are:

  1. Login to Alibaba Cloud ECS console and create an ECS instance. You don’t need a heavy server here, so a 4 core 8G instance should be good. You could choose your own OS but usually a CentOS or Ubuntu server is preferred
  • # sudo apt-get update # sudo apt-get install nginx
  1. Configure the proxy to route the incoming traffic to the actual server hosting the website
  • # cd /etc/nginx/sites-enabled
  1. Edit the proxy file
  • # ls –lrt # vi myproxy
  1. The proxy file should look like this (sample only)
  • ===================================================================== server { # listen 80; # listen [::]:80; listen 443 ssl; listen [::]:443; server_name xxxx.com; ssl_certificate /etc/ssl/xxxx.crt; ssl_certificate_key /etc/ssl/xxxx.key; # ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; # ssl_ciphers RC4:HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # keepalive_timeout 60; # ssl_session_cache shared:SSL:10m; # ssl_session_timeout 10m; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header Host $http_host; proxy_set_header Host fashionbunker.com.cn; proxy_set_header X-Forwarded-Proto $scheme; add_header Front-End-Https on; location / { proxy_pass https://xxxx.com; } } ======================================================================
  1. For each domain that you want to redirect the traffic to, there should be a similar block entry in the proxy file
  1. Now create a TCP listener listening on port 443 and having your proxy server as the backend default server
  1. You could also create an https listener and upload the SSL certificate if you want the traffic from SLB to the proxy to be encrypted as well. However, since between SLB and proxy it is the Alibaba Cloud internal network, I chose to create a TCP listener on port 443

Global Acceleration (GA) Setup

Now we need to create a Global Acceleration (GA) instance in China. Global Acceleration is available under the VPC console

  1. Login to the VPC console and go the ‘Global Acceleration’ link
  1. On the screen, provide the necessary details and click on ‘Buy now’ (the details shown in the screenshot are just a sample and may not necessarily align to your requirements)
  1. Once successfully purchased, the GA instance will appear in the console and you can see the public IP. Also at this point you should bind your SLB (created in the service area) to the GA instance

CDN Setup

Next is to create CDN domain for accelerating your website. Note that to be able to create the CDN domain, you need to have an ICP licence

  1. In the CDN console, click on ‘Add Domain Name’

NOTE:

  1. For origin site, mention the IP of the GA instance that was created earlier

DNS Geo Routing

The last step in this setup would be to setup DNS geo routing. This has to be done with your DNS provider so that when a website access request is made, the DNS configuration is able to route the traffic via the closest CDN node and Global Acceleration’s (GA’s) public IP in case the request has originated from China.

Solution Outcomes

The aforementioned solution was deployed and tested in a timely manner by Alibaba Cloud’s architects and hence the customer was able to realize the gains during the online shopping event. Though the initial goal was to survive the shopping event, the performance in general was so much better that the customer decided to go ahead with the solution and subscribe to the Alibaba Cloud services as a long term arrangement.

Reference:https://www.alibabacloud.com/blog/boost-your-e-commerce-business-in-china-using-global-acceleration_594431?spm=a2c41.12548518.0.0

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.