Operations

Cross-Border E-commerce Infrastructure Vietnam and China Strategies

Building cross-border e-commerce infrastructure that connects Vietnam and China is rarely a single-server problem. You are juggling two different regulatory regimes, two very different network realities, and a payment landscape that changes fast. The business case is solid, Vietnam imports billions in goods from China each year and sells agriculture and tech back the other way, but the technical stack often breaks down at the seams. This guide walks through the architecture decisions that matter in 2026: where to put your origin servers, how to route traffic between the two countries, and how to handle data residency without destroying performance. It applies to a Linux VPS running your application, a reverse proxy in front of it, and the DNS logic that ties it together.

  • Host the origin in Vietnam for Vietnamese users, place edge nodes or use a CDN for China-facing traffic.
  • Never depend on a single international link for the Vietnam-China leg. Routing matters more than raw bandwidth.
  • Treat Decree 53 as a data residency constraint for Vietnamese user data, not as a ban on using Chinese services.
  • Separate payment flows from the main web tier so regional gateway failures do not take down the storefront.

Prerequisites

  • A server running Ubuntu 24.04 LTS or Debian 12, with root or sudo access.
  • A registered domain and the ability to edit DNS records at your registrar.
  • Basic familiarity with SSH, Nginx, and firewall rules.
  • A clear idea of which side of the border your customers sit on, because that decides the architecture.

Why Cross-Border E-commerce Infrastructure Breaks Down

Most cross-border e-commerce failures are not application bugs. They are network and regulatory problems wearing an application costume. The classic symptom: a customer in China loads your site slowly or not at all, while a customer in Hanoi gets a fast response. The cause is usually that your cross-border e-commerce infrastructure was built with a single origin location and no thought given to how traffic actually travels.

The Vietnam-China internet path is congested at peak hours. Traffic leaving Vietnam for China often transits through Hong Kong or Singapore, adding 50 to 100 milliseconds of latency even when the geographic distance is short. If your origin sits in the United States or Europe, the problem compounds. The fix is rarely to buy a faster server. It is to shorten the network path and cache aggressively at the edge.

越南 VPS 提供本地 IPv4,适合面向越南用户的业务。

A Vietnam VPS gives you a local IPv4, which suits services aimed at users inside Vietnam.

Where Should the Origin Server Live?

For a storefront serving Vietnamese customers, the origin belongs in Vietnam. A Vietnam VPS with dedicated IPv4 gives you a local IP that keeps the connection short, avoids international transit for domestic users, and simplifies compliance with local data rules. This is not about nationalism in infrastructure. It is about physics: a packet from Ho Chi Minh City to a Hanoi server stays inside the country, while a packet to Singapore crosses at least one international link.

For the China side of the business, do not put your main origin inside mainland China unless you are prepared for ICP licensing and the Great Firewall's filtering behavior. Instead, run a lightweight edge or use a CDN with points of presence in Hong Kong or other regions that serve mainland traffic well. The origin in Vietnam holds the source of truth, and the edge caches product pages, images, and static assets closer to the Chinese customer.

This split also protects you from a single point of failure. If the China-facing edge gets blocked or throttled, your Vietnamese storefront keeps working. If the Vietnam origin has network trouble, you can fail over to a read-only replica in Singapore or Hong Kong while you fix it. The architecture assumes failure and isolates it.

Network Path Optimization Between Vietnam and China

Optimizing the cross-border link requires thinking about routing, not just bandwidth. The direct Vietnam-China route is often slower than the indirect one through Hong Kong, because of how international carriers exchange traffic. You need to detect this before you can fix it.

Run a simple traceroute test from your Vietnam server to a target in China. This is the single most useful diagnostic for cross-border e-commerce infrastructure:

mtr --report --report-cycles 10 223.5.5.5

This checks the path to Alibaba's public DNS, a good proxy for general China reachability. Look at the loss percentage and latency at each hop. If you see packet loss in the middle of the path, that is the congested international exchange point. Changing your upstream provider or using a relay in Hong Kong sometimes fixes it, because the relay takes a different route.

Do not get distracted by raw ping time. A 60 ms ping with zero packet loss is better than a 30 ms ping with 5 percent loss. Loss causes retransmission, and retransmission kills web performance. The mtr output tells you which one you actually have. In my experience, teams spend hours tuning Nginx worker processes when the real problem is a congested hop in Hong Kong that a different route would have avoided.

Handling Data Residency With Decree 53

Vietnam's Decree 53, in force since late 2025, requires that certain categories of data about Vietnamese users be stored within Vietnam. For cross-border e-commerce infrastructure, this creates a hard architectural constraint. You cannot simply run everything in Hong Kong and call it done.

The pragmatic reading for a technical team: Vietnamese customer data, order records, and payment logs belong on infrastructure inside Vietnam. The China side of the business, such as supplier catalogs or internal logistics tracking, can be elsewhere. This does not require you to run parallel stacks from day one. It does require you to separate the data plane from the application logic.

For example, an order placed by a Vietnamese customer should hit the Vietnam origin, write to a database on that same VPS or in the same datacenter, and only then sync anonymized or aggregated data to a central system abroad. This keeps the regulated data local while still giving you a global view. A related concern is the practical side of choosing where to host, which is why VPS for internal company data storage is a useful read on sizing and placement.

Payment Routing for Two Markets

Payment infrastructure is where most cross-border e-commerce projects lose money through failed transactions and long settlement cycles. Vietnam and China have separate payment ecosystems. Vietnam runs on local bank transfers, MoMo, and ZaloPay alongside international cards. China runs on WeChat Pay and Alipay, both of which are notoriously hard for foreign merchants to integrate directly.

The secure approach is to decouple payment processing from your main application. Run a dedicated payment service, a small Node.js or Python API that talks to the payment gateways, on a separate port behind the same Nginx instance. If the gateway for one market has an outage, the rest of your storefront keeps running and the checkout flow just shows a temporary "payment unavailable" message for that region.

The China payment side usually requires a licensed intermediary, not a direct WeChat Pay integration. These intermediaries provide an API that mirrors the Chinese payment experience while handling the regulatory complexity themselves. Budget extra time for onboarding, per intermediary, often takes two to four weeks of document review. Do not start this process a week before launch.

Is a Single VPS Enough to Start?

Yes, for the early stage. A single Linux VPS with 4 GB of RAM running Nginx, PHP-FPM or Node.js, and PostgreSQL or MariaDB is enough to validate a cross-border e-commerce storefront that serves hundreds of orders a day. The key is that this single server must run the right software architecture, not that it must be a big server.

The minimum viable cross-border stack looks like this:

# Install Nginx and PHP on Ubuntu 24.04
sudo apt update
sudo apt install -y nginx php-fpm php-mysql php-redis php-curl

# Install MariaDB
sudo apt install -y mariadb-server

# Secure the database
sudo mysql_secure_installation

With this base, you run the storefront application, point a domain at it with an SSL certificate, and handle Vietnamese traffic directly. For China traffic, you put a CDN or a lightweight reverse proxy in Hong Kong in front. If you have never locked down a public-facing server, read hardening SSH on a new VPS before you expose it to the internet, this is a mandatory first step.

You do not need a Kubernetes cluster or a microservices fleet to start. You need a reliable origin, a sensible edge strategy, and clean separation between the parts that handle regulated data and the parts that serve static content. It is cheaper and faster to fix architectural mistakes on one server than on ten.

Measuring and Verifying Your Setup

After you configure the stack, verify that both sides of the architecture work. The verification has two parts: domestic performance in Vietnam and reachability from China.

For Vietnam, measure from a local monitoring point:

# From a separate machine, test response time from inside Vietnam
curl -o /dev/null -s -w "Connect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n" https://your-store.vn

A time to first byte under 300 ms from a Vietnam client on a domestic connection is reasonable for a dynamic page. Static assets should be far faster because your edge cache or CDN handles them.

For China reachability, run a check from a Hong Kong relay or a mainland monitoring service:

# From the Hong Kong edge node
curl -I https://your-store.vn

The status code should be 200 OK or a redirect to the HTTPS version. A timeouts or connection reset indicates that your edge node or CDN is not properly forwarding to the origin. Fix the origin's firewall rules or the reverse proxy configuration first, then re-test.

Common Cross-Border Failure Modes

The first failure mode is treating international bandwidth as unlimited. It is not. If your origin handles all China traffic directly, expect slow loads during peak hours. The fix is caching at the edge, not buying a bigger pipe.

The second failure mode is blocking China traffic with overzealous security tools. Fail2ban and similar tools look at login failures, not at normal web traffic. But if you also use geo-IP blocking to stop spam, you might accidentally block mainland China entirely. Whitelist the regions where you actually do business before enabling geo-fencing.

The third failure mode is neglecting the database replica. If your single server handles all reads and writes, a heavy promotional campaign in one market slows down the other. Run a read replica or move reporting queries to a separate analytics database so the transactional path stays fast.

The fourth, and possibly the most damaging, failure mode is ignoring backup automation on the origin server. A failed deployment or a ransomware attack on the Vietnam origin wipes out the only copy of regulated customer data. Regular snapshots are your last line of defense. Most providers, including thueVPS Linux VPS plans, offer snapshots and backups as a control-panel toggle; turn them on and test a restore before you need it.

FAQ

Do I need a server in mainland China for cross-border e-commerce?

Most foreign businesses do not. An edge node in Hong Kong or a CDN with China POPs serves mainland traffic well without requiring an ICP license for your own server. Keeping the origin in Vietnam also helps you comply with Decree 53 for Vietnamese user data.

Why is my website slow from China even with a fast server?

The bottleneck is rarely the server. It is the international route from China to your origin. Run an mtr test to diagnose congestion and packet loss. Using a CDN or a Hong Kong edge node shortens the path and fixes most latency problems.

Can I host customer data for Vietnamese users on a Hong Kong server?

Under Decree 53, certain data about users in Vietnam must be stored inside Vietnam. For cross-border e-commerce infrastructure, keeping Vietnamese customer and order data on a Vietnam VPS is the safe approach. Non-regulated data such as supplier catalogs can stay abroad.

Which payment gateway should I use for Chinese customers?

Use a licensed intermediary that provides WeChat Pay and Alipay integration. Direct integration is usually not available to foreign merchants. Factor in several weeks of onboarding time and keep this payment service separate from your main storefront code.

What is the minimum VPS configuration for this workload?

For a small storefront, a VPS with 2 to 4 GB of RAM and 2 vCPUs is enough to start. Choose an NVMe disk for database performance. As you grow, scale the origin vertically first and move static assets to a CDN before you split the application into multiple servers.

Related articles

跨境电商越南中国基础设施要点

本文为跨境电子商务构建越南与中国之间的技术架构。越南用户数据应存储于越南境内的VPS,中国方向流量建议通过香港边缘节点或CDN接入。付款系统需要分离,以免单区域故障影响整个商店。网络优化应先用mtr检测丢包,再决定是否调整路由。合规方面需遵守越南第53号法令的数据本地化要求。

Note: This guide is for general reference. Every system and infrastructure has its own specifics, so test each step in a safe environment and consult a qualified engineer before applying it in production.