Why r-nacos Could Replace Nacos: A Low‑Memory Rust Service Registry for Microservices
r-nacos, a lightweight Rust‑based implementation of Nacos, offers identical registration and configuration features with dramatically lower memory usage, and this guide shows how to install it via Docker, integrate it into the mall‑swarm microservice e‑commerce project, and leverage its admin, data migration, and monitoring tools.
r-nacos Introduction
r-nacos is a Rust‑based Nacos service that provides the same registration and configuration center functions as Alibaba's Nacos, but with lower memory consumption and excellent performance.
mall-swarm Project Overview
mall-swarm is a microservice e‑commerce system (11k+ stars) built with the 2024 latest microservice stack, including Spring Cloud Alibaba, Spring Boot 3.2, JDK 17, Kubernetes, etc., and integrates core components such as registry, config, monitoring, and gateway.
GitHub: https://github.com/macrozheng/mall-swarm
Gitee: https://gitee.com/macrozheng/mall-swarm
Video tutorials: https://cloud.macrozheng.com/video/
Installation
r-nacos supports Windows exe installation and Docker installation; the example uses Docker.
Pull the Docker image:
<code>docker pull qingpan/rnacos:stable</code>Run the container:
<code>docker run --name rnacos -p 8848:8848 -p 9848:9848 -p 10848:10848 -d qingpan/rnacos:stable</code>Access the console at http://192.168.3.101:10848/rnacos/ with default credentials
admin:admin.
Project Practice
Using the mall‑swarm e‑commerce project as an example, the following steps integrate r‑nacos.
Clone the mall‑swarm code and modify
bootstrap-dev.ymlto point the Nacos address to r‑nacos.
<code>spring:
cloud:
nacos:
discovery:
server-addr: http://192.168.3.101:8848
config:
server-addr: http://192.168.3.101:8848
file-extension: yaml</code>Add
mall-admin-dev.yamlto r‑nacos configuration list.
Start the mall‑admin module; the service appears in r‑nacos service list.
Repeat for other modules; all services become visible.
Access the online API documentation via the gateway at http://localhost:8201/doc.html.
Start the front‑end projects
mall-admin-weband
mall-app-web; they can call APIs through the gateway.
Additional Features
r‑nacos also provides user management, data migration, and system monitoring functions.
User Management – add or modify users.
Data Migration – import/export configuration data.
System Monitoring – comprehensive runtime status monitoring.
Performance Benchmark
Official benchmark results show r‑nacos has excellent performance with very low memory usage.
Comparison with Nacos
Compared with Alibaba's Nacos, r‑nacos reduces memory consumption from about 900 MB to less than 10 MB, making it suitable for resource‑constrained servers.
Conclusion
Using the mall‑swarm project, we demonstrated that r‑nacos can fully replace Nacos while offering much lower memory usage and strong performance.
Project Repository
https://github.com/nacos-group/r-nacos
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.