This is part of an ongoing series. Based on Renfei’s Blog 2020 Major Update, I’m covering each area separately: region selection, cloud server configuration, environment setup (JVM), caching strategy, Spring Boot configuration, and front-end page optimization.
Note: this is my personal experience, not a professional benchmark. Some of it isn’t rigorous — please bear with me.
In this year’s update, the very first thing I considered was where to deploy the program, which data center to pick, and which network to use. So part one shares my reasoning and experience.
Choosing a Network
For network, BGP is the obvious choice. Younger readers might think everything is BGP these days, but back when I started building sites there were single-line, dual-line, and multi-line data centers. Each line gave you an IP address, and DNS had to resolve China Telecom visitors to the Telecom IP and China Unicom visitors to the Unicom IP — a real hassle. BGP lines existed then too; they just cost more than single-line.
What is BGP, and is it a rip-off? BGP is a network protocol, and explaining it needs the term AS (autonomous system). I’m not a networking professional, so here’s the simple version: an AS is roughly each carrier’s own local network. Telecom has its own AS, Unicom has its own. To reduce the latency of crossing between autonomous systems, people came up with single-line, dual-line, and multi-line connectivity — plug in more cables to reach more ASes. BGP, on the other hand, announces your IP address to multiple other ASes at once, so one IP effectively joins several networks and you no longer need multiple IPs for dual-line or multi-line access.
If you use cloud servers this may all sound obvious, but if you colocate your own server, you need to pick a BGP data center.
Choosing a Region
In this update I moved the program from a Beijing data center to Hangzhou. Here’s why.
First, per the network choice above, I went with Alibaba Cloud for its better network quality, and Alibaba Cloud’s home base is Hangzhou — its very first data center. So it has natural advantages in physical resources, personnel, and so on.
Second, even with direct access to the backbone, the physical distance of hundreds to thousands of kilometers means packets will take a few extra hops. My target is the whole country, so I picked the middle of China: Hangzhou sits between North and South China and radiates in both directions.
Finally, Hangzhou is next to Shanghai, which matters for international traffic: your data must first reach one of China’s international internet gateway exchanges for inspection. China has three, in Beijing, Shanghai, and Guangzhou. All outbound international traffic must reach one of them first, and then it’s decided which submarine cable exit node to send it to. Inbound traffic from abroad works the same way.
Choosing a Provider
I said above that I chose Alibaba Cloud. There are plenty of other large domestic cloud providers that are just as good — Tencent Cloud, Huawei Cloud. I picked Alibaba Cloud because long before cloud providers existed, I registered domains and bought virtual hosting at HiChina (Wanwang). Later Alibaba Cloud was among the first to do cloud computing, so I got on board, and after becoming familiar with their products and rules I didn’t want to switch. An account manager calling now and then to check in is reassuring, too.
