Introducing Nacos: Config Server for a Microservices Environment
We take a look at the open source microservices platform, Nacos, and how it fits into the landscape of open source microservices tooling/platforms.
Join the DZone community and get the full member experience.Join For Free
What Is Nacos?
Nacos is an open source project by Alibaba for service discovery and service configuration. It’s designed for cloud native development and deployment.
There are similar open source projects today. For example, Consul and Eureka both are very popular. So why is Alibaba re-inventing the wheel?
Today’s microservices architectures are really evolving around the core concept of services. It is easy to understand the concept of a service: anything that can be consumed by others. However, how to describe a service is a big challenge. For example, in Kubernetes, a service is a REST object, an endpoint that can be reached via HTTP. But what about a gRPC service? That’s a protocol buffer IDL definition. And gRPC is already using HTTP, which means there are ways to work around it. Then how about a Java RPC interface that’s not based on HTTP? How do we register and expose those services?
The difficulty lies not in how you register these services, but how to discover and route traffic to the services.
Nacos is designed to mend that gap. It will accommodate different types of service definitions and provide routing and load balancing for others to reach them.
Another challenge developers face in cloud native development is where to store application configurations. In Kubernetes, there is ConfigMap. Or you may have another KV store set up in the cluster. However, imagine you have thousands of applications that need to be configured, and a lot of the applications are agonistic of this information. For example, which availability zone or data center is the application deployed at? Which public IP is allocated for the application? And so on. These configurations often require interaction with other components of the cloud infrastructure. Nacos is the right tool for that. It has APIs that will interact with your cloud infrastructure to retrieve that information and provide it to the applications.
Here is a high level architecture diagram of Nacos:
Here we can see that two logical pieces of Nacos: the config service and the naming service.
Nacos provides a unified Open API to both modules.
Below is another diagram showing how Nacos fits into the cloud ecosystem:
As mentioned, Nacos may interact with different third parties via APIs to store and retrieve information about services. And it can be integrated with Spring Cloud, Dubbo, or Kubernetes.
Nacos has just released version 1.0! This is the GA release, meaning it is ready for production use. It is now able to serve one million entries for both naming services and configuration services.
Going forward, Nacos will better integrate with other CNCF projects, providing tighter integration with Kubernetes API servers, and support multi-cluster use cases.
Opinions expressed by DZone contributors are their own.