Cloud Native 12 min read

Spring Cloud Alibaba Architecture Overview and Nacos Service Discovery Guide

This article provides a comprehensive overview of Spring Cloud Alibaba architecture, detailing monolithic, distributed, and microservice patterns, explains the evolution of system designs, introduces Nacos service discovery and registration, and includes practical code examples for installing, configuring, and using Nacos with Spring Boot.

Top Architect
Top Architect
Top Architect
Spring Cloud Alibaba Architecture Overview and Nacos Service Discovery Guide

Spring Cloud Alibaba

Introduces three deployment models: monolithic (single‑server deployment), distributed (multiple servers for services and databases), and cluster (multiple nodes with load balancing to avoid single‑point failures).

Evolution of System Architecture

Shows the progression from monolithic → vertical application → distributed → SOA → microservices, describing each style’s advantages and drawbacks.

Monolithic Application

Simple architecture, low development cost for small projects.

All services run on one node, easy maintenance.

Drawbacks: poor scalability, tight coupling, difficult optimization.

Vertical Application

Splits a large monolith into independent applications (e.g., e‑commerce system, backend system, CMS) to balance traffic and improve fault tolerance.

Advantages: traffic isolation, independent optimization, higher fault tolerance.

Disadvantages: independent systems cannot call each other directly, duplicate development effort.

Layered Architecture

Extracts common functionality into a service layer, separating presentation from business logic.

Advantage: improves code reuse.

Disadvantage: increased coupling between layers.

SOA Architecture

Introduces a registration center to manage service relationships and enable automatic adjustment.

Advantage: solves service dependency issues.

Disadvantages: potential service cascade failures, complex operations.

Microservice Architecture

Further decomposes applications into independent, deployable services that communicate via lightweight protocols such as REST.

Advantages: clear service boundaries, easy scaling, independent deployment.

Disadvantage: higher technical cost for distributed systems (fault tolerance, distributed transactions, etc.).

Service Governance – Nacos Discovery

Explains the core concepts of service governance: registration, heartbeat, synchronization, discovery, and health checks.

Common Service Registries

Zookeeper – distributed coordination.

Eureka – service registration and discovery.

Consul – service registration, discovery, and configuration.

Nacos – dynamic service discovery, configuration, and management for cloud‑native applications.

Nacos Overview

Details Nacos features such as service registration, heartbeat (default every 5 seconds), service synchronization across clusters, discovery with local caching, and health‑check mechanisms.

Getting Started with Nacos

Installation

Download the zip package from the official GitHub releases page.

Start Nacos

# 进入bin目录
cd bin
#在cmd中启动
startup.cmd -m standalone

Access Nacos

Open http://localhost:8848/nacos (default credentials: nacos/nacos).

Integrate Nacos into a Spring Boot Project

Add the dependency to pom.xml:

<!--nacos客户端-->
<dependency>
  <groupId>com.alibaba.cloud</groupId>
  <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>

Annotate the main class with @EnableDiscoveryClient:

@SpringBootApplication
@EnableDiscoveryClient
public class ProductServer {
    public static void main(String[] args) {
        SpringApplication.run(ProductServer.class, args);
    }
}

Configure Nacos address in application.yml:

spring:
  cloud:
    nacos:
      discovery:
        server-addr: localhost:8848

Remote Call Load Balancing – Ribbon

Describes client‑side load balancing, where the caller decides which service instance to use.

Overall, the article offers a step‑by‑step guide to understanding microservice architecture evolution, using Nacos for service governance, and practical code snippets for setup and integration.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cloud Nativeservice discoveryNacos
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

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.