Spring Cloud Alibaba and Nacos Service Governance: Architecture Evolution, Microservice Introduction, and Practical Setup

This article walks through the evolution of system architecture from monolithic to microservices, explains Spring Cloud Alibaba components, introduces Nacos for service registration and discovery, provides step‑by‑step installation and integration instructions, and includes code snippets for a Spring Boot project.

Top Architect
Top Architect
Top Architect
Spring Cloud Alibaba and Nacos Service Governance: Architecture Evolution, Microservice Introduction, and Practical Setup

The author, a senior architect, introduces the evolution of system architecture from monolithic to microservices.

Spring Cloud Alibaba

Explains monolithic, distributed, and cluster concepts with illustrative images.

Architecture Evolution

Monolithic → Vertical Application → Distributed → SOA → Microservices.

Monolithic Application

Simple and low cost for small projects.

All functions in one project, making large‑scale development and maintenance difficult.

Vertical Application

Splits the system into independent applications (e.g., e‑commerce, backend, CMS) to balance load.

Improves fault tolerance and scalability.

Layered Architecture

Separates presentation and service layers to extract common functionality and increase code reuse.

SOA Architecture

Introduces a registration center for managing service relationships and reducing coupling.

Microservice Architecture

Describes independent services that can be packaged, deployed, and upgraded separately, communicating via lightweight RESTful APIs, while noting challenges such as distributed transactions and fault isolation.

Spring Cloud Overview

Spring Cloud is a collection of frameworks that simplify distributed system development, offering service discovery, configuration management, load balancing, circuit breaking, and monitoring on top of Spring Boot.

Service Governance with Nacos

Defines service governance as the core module for automatic service registration and discovery, explains service registration, discovery, and health checking mechanisms.

Common Registries

Zookeeper

Eureka

Consul

Nacos

Nacos Introduction

Highlights core functions: service registration, heartbeat, synchronization, discovery, and health checks.

Nacos Practical Guide

Installation steps: download the zip package from the GitHub releases page, unzip, and run cd bin then startup.cmd -m standalone. Access the console at http://localhost:8848/nacos with default credentials nacos/nacos.

Integrating Nacos into a Spring Boot Project

Add the Nacos client dependency in pom.xml:

<!--nacos client-->
<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 the Nacos server address in application.yml:

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

The article also briefly mentions client‑side load balancing with Ribbon and includes promotional content for a ChatGPT community, interview material, and related resources.

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.

Javaservice 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.