Lower the latency of your application in China with BGP Pro

- 9 mins read

The usual problem for companies with some sort of presence in China is the platform speed for their end users located in the Mainland, this stems from the complexities deriving out the views on how the Internet should work according the Chinese authorities. Why is this? For a big part, China’s view of the internet is as “Internet sovereignty”: the notion that the Internet inside the country is part of the country’s sovereignty and should be governed by the country. This means there are “border controls” regarding telecommunications. This, frequently called “The Great Firewall”, is what legally is actually called “Cyber-security Law of the People’s Republic of China”, or CSL for short. Think of Europe’s GDPR, CSL is China’s own set of regulations.

Ok, our problem

Back to the beginning, we spent a zillion dollars on our shiny web platform and the business idea is great, but our end users in China Mainland are reporting snail speeds on their devices.

Lower the latency of your application in China with BGP Pro

When you send/receive cross-region data between China mainland and the outside, your traffic is routed in a way that helps the Ministry of Industry and Information Technology (MIIT) to check that everything looks alright. This, itself, slows down cross-region Internet traffic. Now, take the Security Law in mind and add the fact that many parts of China are still developing. We are talking about a country with a very limited bandwidth available relative to its population of 1.4 billion. Of course the network is slow on the border.

I’m going to need you to give me a solution

Ok, fine! I guess that is why I’m writing this today… There is a handful of solutions for this problem, each of them more suited to different scenarios.

Option 1: CDN

This is the most common amongst the common solutions, and it’s cheap as chips. This is great when your users are only expected to browse static content and not interacting with it, but this is not a good solution for platforms where users actually generate content or wander around “liking” things.

Option 2: VPN

This is the natural next step, as your platform will remain in the same place as with a CDN. The difference here will be on how the users connect to the platform, as you’ll create some rules around routing and special GeoDNS records.

Option 3: Full Deployment in the Mainland

Here we are talking about extreme sports! This is the BEST solution which offers 0 latency. But means having 2 separated production environments inside and outside China Mainland. Not for the faint-hearted and definitely not for the ones with limited budget. For most platforms this is overkill and over-engineered.

Option 4 (My favourite): EIP with BGP Pro

Now we are talking! Alibaba Cloud (More Than just Cloud – for a reason) offers a big range of solutions tailored for the Chinese market and for use-cases where companies of all sizes want to offer their services.

Lower the latency of your application in China with BGP Pro

This solution has a gotcha, and this is the need of deploying in the Hong Kong region. But this means our application will still have a good speed overall, and we won’t need an ICP license.

The idea behind this is to use an Elastic IP with a BGP Pro connection inside China, meaning it won’t use any external ISP connection on the open Internet and the connections will go through Alibaba’s own backbone.

The best part of this is the fact that it won’t use a point-to-point connection, it will use a CN2 gateway routed to anywhere in China, giving your users located in the Mainland a good speed.

How to achieve the proposed solution?

Luckily for us, the process of purchasing a BGP Pro EIP is the same as with any other EIP.

1. Purchase an elastic IP address of BGP (Multi-ISP) Pro

As mentioned, this is the same as with any other EIP in any other region. The difference here resides when you choose the options, as when you purchase an EIP in Hong Kong a new variable will be available, called “BGP (Multi-ISP)_Pro” as an addition to the standard “BGP”. Given the discounts here, I recommend you to use the Subscription type.

Lower the latency of your application in China with BGP Pro

2. Associate an elastic IP address with a resource

You can associate the purchased Elastic IP address with a range of VPC-connected resources, such as ECS, SLB, NAT Gateway or a secondary ENI. After the binding these resources can communicate with the Internet.

Lower the latency of your application in China with BGP Pro

3. Test the network latency

That’s it! Now you just need to test the difference in response times by using ping before and after binding the EIP with the BGP Pro connection.

Conclusion

Not because is not a common solution means is not the best-fitted. In this case we explored the use of an Elastic IP attached to a Multi-ISP Border Gateway Protocol Pro in Alibaba Cloud to give our end users the experience they want and deserve.


Share: Link copied to clipboard

Tags:

Previous: How A Single Character Broke Alibaba Cloud’s Container Registry
Next: Dealing With Large Docker Images in Alibaba Cloud Kubernetes

Where: Home > Technical > Lower the latency of your application in China with BGP Pro