Cloud Native 9 min read

Analysis of Nacos 1.x Issues and the Improvements Introduced in Nacos 2.x Architecture

The article examines Nacos' evolution from its Alibaba origins, outlines the performance and resource problems of the 1.x architecture, and details how the 2.x version’s long‑connection gRPC model, improved reliability, and compatibility enhancements address those issues while introducing new complexities.

Architecture Digest
Architecture Digest
Architecture Digest
Analysis of Nacos 1.x Issues and the Improvements Introduced in Nacos 2.x Architecture

Nacos originated from Alibaba's internal "Wucai Stone" project in 2008 and has gained popularity alongside Eureka and Consul. It now supports major microservice frameworks such as Dubbo, Spring Cloud, and SCA, as well as cloud‑native components like CoreDNS and Sentinel, with client SDKs for Java, Go, Python, C# and C++.

1.x Architecture Problems

The 1.x version suffers from excessive heartbeat traffic, inefficient queries, slow service change detection, high connection overhead, and severe resource waste.

High heartbeat count keeps TPS constantly high.

Heartbeat renewal delays service change perception (default 15 s timeout).

Unreliable UDP push forces frequent client reconciliation, inflating QPS.

HTTP short‑connection model creates many TIME_WAIT sockets.

Configuration module’s 30‑second long polling triggers frequent GC.

Nacos 2.x Architecture Advantages and Disadvantages

The new 2.x architecture introduces a gRPC‑based long‑connection model that reduces heartbeat TPS, enables fast TCP disconnect detection, provides reliable streaming push, alleviates TIME_WAIT issues, eliminates GC caused by short‑connection polling, and allows finer‑grained synchronization.

Advantages

Clients send only keep‑alive messages, dramatically lowering TPS.

TCP disconnects are detected quickly, improving response speed.

Long‑connection streaming push is more reliable than UDP and reduces invalid QPS.

Long connections avoid frequent connection overhead, mitigating TIME_WAIT problems.

Real long‑connection eliminates the configuration module’s GC issue.

Finer‑grained sync reduces inter‑node communication pressure.

Disadvantages

Increased internal complexity for managing connection state and load balancing.

Data becomes stateful and bound to connections, lengthening processing chains.

gRPC observability is less straightforward than plain HTTP.

Performance Improvements

Benchmark tests on a three‑node cluster show that Nacos 2.x can handle millions of services and instances, with registration/unregistration TPS exceeding 26,000 (over 2× improvement) and query TPS surpassing 30,000 (about 3× improvement) compared to 1.x.

Compatibility

Configuration Center

Fully compatible with all 1.x client API methods.

Implements all 2.x client API methods.

Fully compatible with all configuration‑center related OpenAPI.

Service Discovery

Due to major data‑model changes, some discovery features are temporarily unsupported, such as viewing the current cluster leader and batch updating or deleting instance metadata.

Console

All configuration‑center pages and functions are fully compatible.

Permission control, namespace, cluster management, and service discovery pages remain compatible.

Spring Cloud Alibaba Integration

Since Spring Cloud Alibaba 2.2.5 bundles nacos‑client 1.4.1, developers can override the client version to use Nacos 2.0 long‑connection features.

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    <version>2.2.5.RELEASE</version>
    <exclusions>
        <exclusion>
            <groupId>com.alibaba.nacos</groupId>
            <artifactId>nacos-client</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
    <version>2.2.5.RELEASE</version>
    <exclusions>
        <exclusion>
            <groupId>com.alibaba.nacos</groupId>
            <artifactId>nacos-client</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.alibaba.nacos</groupId>
    <artifactId>nacos-client</artifactId>
    <version>2.0.0</version>
</dependency>

The article concludes by inviting readers to try Nacos 2.x early, report bugs, and contribute to the open‑source community.

performancecloud nativemicroservicesservice discoverygRPCNacos
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.