This is the 16th day of my participation in Gwen Challenge

June has already been half, today is the latest day since more articles, no more gossip, directly open today’s knowledge point Nacos.

Nacos data model

Nacos’s data model seems complex, so we’ll ignore these data attributes for now

The use of Nacos

As a registry, Nacos plays a similar role to Eureka, mainly including:

  • Service providers register their protocol addresses with Nacos Server
  • The service consumer needs to query the address of the service provider (by service name) from Nacos Server
  • Nacos Server needs to be aware of the up-down changes of the service provider
  • Service consumers need to be dynamically aware of changes in service addresses on the Nacos Server side

Nacos features

Of course, Nacos features are also something we need to know:

Service discovery and service health monitoring

Service discovery: Nacos supports DNS – and RPC-based service discovery. Health checks: Nacos provides real-time health checks on services to prevent requests from being sent to unhealthy hosts or service instances.

Dynamically configured service

(More on this in the Microservice configuration Center)

The advantages of Nacos

Nacos implements the AP+CP principle

Nacos AP implementation:

AP:

The Distro protocol is used in the Nacos service management framework. Distro is positioned as a consistency protocol for temporary data: this type of protocol does not require data to be stored to disk or database because temporary data usually maintains a session with the server and data will not be lost as long as that session exists. Therefore, Nacos implements data consistency

Implementation of Nacos CP

Spring Cloud Alibaba Nacos officially supports AP and CP consistency protocols in 1.0.0. CP consistency protocol implementation is based on simplified Raft CP consistency.

Registry, configuration center two-in-one, provide console management

Today’s summary

Today we have a general understanding of part of the principle of Nacos, and then we need to conduct actual combat to really see the advantages of Nacos