DEV Community

Cover image for The Dragon’s Code: Is Java Spring the Same in China?
Yaroslav Ivanovskyi
Yaroslav Ivanovskyi

Posted on

The Dragon’s Code: Is Java Spring the Same in China?

When I first started looking into how backend development works in China, I thought it would be the same as what I already knew: Java + Spring, with some Node.js, Python, and Go here and there. Turns out, that’s only half the story. Spring is still everywhere, but the ecosystem around it feels different — almost like a parallel universe. Same framework, but it grew up under different rules.

Why Java Rules Enterprise in China

Java isn’t just popular in China — it’s basically the enterprise language. And from what I’ve seen, there are a few clear reasons:

  • Stability at massive scale: Companies like Alibaba and Tencent deal with insane traffic (think billions of transactions in one day, like during Singles’ Day). The JVM handles this really well, especially with low-pause garbage collectors like ZGC (Z Garbage Collector) or Shenandoah that are tuned for huge heaps and minimal latency, which is critical for responsive, high-throughput services.

  • Legacy and investment: Back in the early 2000s, banks, telecoms, and e-commerce platforms picked Java. They’ve been building on it ever since. Once you’ve got millions of lines of working Java code and teams trained for it, switching to something else is almost impossible.

  • Talent pipeline: Universities in China teach Java as their main backend language. Bootcamps too. So when companies need to hire hundreds (or thousands) of devs, Java is the safest bet — they know the skills are out there.

  • The JVM everywhere: It’s not just backend. Android (without Google services in China) is huge, and that means tons of Java/Kotlin devs. Plus, a lot of big data tools — Kafka, Hadoop, Spark, Flink — run on the JVM. So sticking with Java ties everything together.

The Alibaba-Influenced Spring Stack

Here’s where things get interesting. While the core of Spring Boot and Spring Cloud is the same everywhere, in China a lot of teams use tools that came out of Alibaba’s open-source projects. They solve the same problems as Western tools, but with some twists.

1. Service Discovery & Configuration → Nacos

In the West, people often use Netflix Eureka for service discovery and Spring Cloud Config for configs. Two separate tools.

In China, it’s usually Nacos. It combines both into one.

What makes it different?

Nacos uses a hybrid model:

  • For service discovery it’s more like Eureka (an AP system from the CAP theorem, prioritizing availability).
  • For configuration management it switches to a CP system (prioritizing consistency) using the Raft consensus algorithm for distributed coordination.

That means you can tune it depending on what you need more: consistency or availability. It also integrates with Kubernetes and supports DNS-based service discovery out of the box, making it a truly cloud-native control plane.

Configuring a Spring Boot application to use Nacos is straightforward. You just point your bootstrap.yml to the Nacos server:

spring:
  application:
    name: user-service
  cloud:
    nacos:
      config:
        server-addr: localhost:8848
        file-extension: yaml
      discovery:
        server-addr: localhost:8848
Enter fullscreen mode Exit fullscreen mode

2. API Gateway → Performance Matters

Western stacks often stick with Spring Cloud Gateway (which is reactive and efficient) or the older Netflix Zuul.

In China, Spring Cloud Gateway is still common, but you’ll also see Apache ShenYu a lot.

ShenYu is cool because it has a powerful plugin architecture. You can extend it for stuff like native gRPC proxying, API aggregation, fine-grained metrics, and blue-green deployment routing. That’s super handy when you’re dealing with crazy traffic spikes and need more operational control than a standard gateway offers.

3. Circuit Breaking & Flow Control → Sentinel

In the West: Resilience4j is the go-to library after Hystrix was deprecated. It’s a solid, embeddable library for your code.

In China: Sentinel rules the space.

The big difference?
Resilience4j is something you configure as a library within your application. Sentinel is more like a centralized traffic management platform. It comes with a real-time dashboard where you can dynamically update *flow control rules *(like QPS limits, concurrency threads, or degradation rules) without restarting your services.

That’s super useful when a shopping event like Singles’ Day hits and traffic jumps 10x in a matter of seconds. You don’t want to redeploy code to adjust rules — you just update them in Sentinel’s dashboard and they are pushed immediately to the clients.

4. RPC Layer → Dubbo

In the West: REST APIs over HTTP/JSON are everywhere, usually with OpenAPI docs.

In China: Apache Dubbo has been around forever and is deeply entrenched.

Dubbo is a high-performance RPC (Remote Procedure Call) framework that uses custom binary protocols (like Dubbo Protocol) over TCP with Netty for non-blocking I/O. This means it’s significantly faster and has lower overhead than HTTP/JSON for internal service-to-service communication.

What’s nice now is that with Spring Cloud Alibaba, you can mix them seamlessly. You define your service with a Java interface and use the @DubboService annotation. Then, in another service, you inject it with @DubboReference, and it feels like any other Spring bean, but it's making a high-performance RPC call under the hood.

// 1. Define the service interface (shared module)
public interface UserService {
    User getUser(Long id);
}

// 2. Implement the service in the provider
@DubboService
public class UserServiceImpl implements UserService {
    @Override
    public User getUser(Long id) {
        // ... fetch user logic
    }
}

// 3. Inject and use it in a consumer (e.g., a REST controller)
@RestController
public class OrderController {

    @DubboReference
    private UserService userService; // Injected via Dubbo RPC

    @GetMapping("/order/{orderId}")
    public Order getOrder(@PathVariable Long orderId) {
        Order order = // ... get order logic
        // This is a remote call, not HTTP!
        order.setUser(userService.getUser(order.getUserId()));
        return order;
    }
}
Enter fullscreen mode Exit fullscreen mode

Huawei’s Part in the Story

Alibaba gets a lot of attention, but Huawei is also a big player — especially in telecom and enterprise systems.

  • Apache ServiceComb: Huawei donated this to Apache. It’s a microservices framework that pushes contract-first development (OpenAPI-driven), which makes sense for huge distributed teams that need strict API governance and clear service contracts.
  • Cloud services: Huawei Cloud has optimized Maven mirrors and managed Spring Boot/Kubernetes environments. This helps devs avoid network latency and focus on code.
  • Telecom systems: Huawei’s OSS/BSS platforms (the stuff that keeps 5G networks running) are mostly Java. They need insane reliability (like 99.999% uptime) and multi-decade support. Java is perfect for that kind of long-term, stable workload.

The Great Firewall and Mirrors

One thing that changes everything is the network. Downloading dependencies from Maven Central or GitHub from inside China can be slow or unreliable due to international bandwidth constraints.

The solution? Mirrors. Both Alibaba Cloud and Huawei Cloud run their own high-speed, synchronized Maven and GitHub mirrors (e.g., maven.aliyun.com). Devs just point their build tools to those URLs, and everything feels local. No forks—just faster access to the same global open-source ecosystem.

Your Next Step: From Theory to Practice

So why should you care if you’re coding in the US or Europe? This isn’t just academic; it’s a treasure trove of proven tools.

  • Hiring & Skills: A developer proficient in Nacos or Sentinel understands core distributed systems concepts at an extreme scale.
  • Architectural Innovation: These Apache-backed tools are built for challenges you might be starting to face.

The best way to understand the pragmatic elegance of this ecosystem is to get your hands dirty. Here’s how:

  1. Spin up Nacos in 5 minutes: Their website has a clean quick start guide. Download it, run startup.cmd -m standalone, and open localhost:8848/nacos (username/password: nacos). Play with adding a config and seeing your Spring app pick it up dynamically. It’s the easiest way to feel the power of a unified config/discovery server.

  2. Explore the Dubbo Docs: The Apache Dubbo documentation is excellent. Skip the theory and head straight to the Spring Boot Quick Start. In less than 15 minutes, you can have two small applications talking to each other via high-performance RPC, feeling just like a native Spring bean.

  3. See Sentinel in Action: Download the dashboard JAR and the sample applications. Create a simple flow rule and watch it instantly block traffic in your sample app. It’s incredibly intuitive.

Final Thoughts

Spring in China isn’t a different framework. It’s the same Spring Boot, same Spring Cloud — but surrounded by tools built for extreme conditions and operational excellence.

Don’t think of this ecosystem as “foreign.” Think of it as an advanced proving ground. The next time you’re designing a new system and need rock-solid service discovery, dynamic configuration, or robust flow control, remember: the solutions they built for Singles’ Day are just a docker pull away. Your next architectural inspiration might not come from Silicon Valley, but from Shanghai.

Top comments (0)