Batata


Batata is a high-performance service discovery, configuration management and
service management platform written in Rust. It is a drop-in replacement for
Nacos (V2/V3), with additional compatibility for
Consul and Apollo.
One console, three protocol surfaces: Nacos V2/V3 (config/service/AI registry),
Consul (KV/Catalog/Health/ACL), and Apollo (Apps/Items/Releases).
Watch the MP4 · Compatibility matrix
中文文档
Why Batata
- Rust-native — starts in ~1-2s and runs in ~50-100MB, versus 30-60s and 1-2GB for Java Nacos
- Drop-in compatible — Nacos V2/V3 APIs, plus Consul and Apollo compatibility layers
- Zero-dependency start — embedded RocksDB mode needs no external database
- Production ready — implements ~98% of Nacos features; Raft-based clustering, RBAC, rate limiting
Features
Core
- Configuration management with real-time updates, history/rollback, gray release
- Service discovery with registration, health checks, subscribe/push
- Namespace isolation for multi-tenancy
- Cluster mode with Raft consensus (CP) and distro protocol (AP)
Protocol compatibility
- Nacos — full V2 and V3 API compatibility (V1 intentionally unsupported)
- Consul — Agent, Health, Catalog, KV, ACL APIs
- Apollo — Config Service (
/configs, /configfiles, /notifications/v2, /releaseMessage), Admin Service and OpenAPI; existing Apollo SDKs work unchanged, and writes are Raft-replicated in cluster mode. See docs/compat/apollo/
- gRPC — bidirectional streaming for SDK clients
Operations
- JWT authentication with RBAC, LDAP and OAuth2/OIDC
- Rate limiting, circuit breaker, audit logs, distributed locking
- Config import/export (Nacos ZIP, Consul JSON)
- Service mesh xDS (EDS/CDS/LDS/RDS/ADS), multi-datacenter replication, DNS discovery
- Prometheus metrics and OpenTelemetry tracing
Full comparison: docs/compat/nacos/feature-comparison.md
Web Console (batata-ui)
The web console is a separate frontend project:
easynet-cn/batata-ui
-
Build the UI and place its output in console-ui/; the console server serves it
(controlled by batata.console.ui.enabled, enabled by default)
-
Console UI is available in merged (default) and console deployment modes
-
Access it at http://localhost:8081/ after startup. On a fresh instance you
will be asked to initialize an admin user first, then sign in on the login page:

-
The top provider switcher exposes BATATA (the Nacos V2/V3-compatible surface),
CONSUL, and APOLLO. Consul and Apollo appear only when enabled, e.g.:
BATATA_PLUGIN_CONSUL_ENABLED=true BATATA_PLUGIN_APOLLO_ENABLED=true \
./scripts/startup.sh -m standalone -p embedded
Ports are separated by role — the console port serves the UI only and does not
expose the Nacos-compatible data APIs:
| Port |
Role |
Serves |
8081 |
Console |
Web console UI + console APIs |
8848 |
SDK HTTP |
Nacos-compatible REST API |
9848 |
SDK gRPC |
Client SDK communication |
9849 |
Cluster gRPC |
Inter-node / Raft communication |
Rust SDK
The client SDKs are published on crates.io from this
workspace:
| Crate |
Purpose |
batata-client |
Config, service discovery, gRPC with TLS/mTLS, auth and failover |
batata-maintainer-client |
Admin APIs over HTTP/HTTPS: cluster, namespace, config, naming, AI, plugins |
batata-api |
Shared Nacos-compatible wire models (transitive dependency) |
batata-consul-client |
Consul-compatible HTTP API client: KV, catalog, health, ACL, sessions, blocking queries |
cargo add batata-client
cargo add batata-maintainer-client
cargo add batata-consul-client
The four crates were first released at 1.0.0; the current patch release is
1.0.1. The first three follow the workspace version; batata-consul-client
maintains its own version so it can publish patch releases independently. See
each crate’s README for quick-start examples. batata-client and
batata-consul-client 1.0.0 are rewrites of the earlier standalone 0.0.x
releases; their READMEs and CHANGELOGs contain migration notes.
Quick Start
Embedded RocksDB mode — no database required:
git clone https://github.com/easynet-cn/batata.git
cd batata
cargo build --release -p batata-server
./target/release/batata-server --batata.sql.init.platform=embedded
# Or use the convenience script
./scripts/startup.sh -m standalone -p embedded
Initialize the admin user on first startup:
curl -X POST http://localhost:8848/nacos/v3/auth/user/admin \
-d "username=nacos&password=nacos"
Then open the console at http://localhost:8081/.
MySQL / PostgreSQL setups: docs/database.md
Default Ports
| Port |
Service |
Description |
| 8848 |
Main HTTP API |
Nacos-compatible SDK/Admin API (no UI) |
| 8081 |
Console HTTP API |
Web console, only browser-facing entry (also serves /consul-api and /apollo-api, see docs/deployment.md) |
| 8080 |
Apollo HTTP API |
Apollo Config/Admin/OpenAPI (use per-node ports in cluster) |
| 9848 |
SDK gRPC |
Client SDK communication |
| 9849 |
Cluster gRPC |
Inter-node communication |
| 15010 |
xDS gRPC |
Service mesh xDS/ADS protocol |
Consul/Apollo adapters are off by default. The console advertises their
effective state through /v3/console/server/state, and the UI only shows a
provider entry when the matching flag is "true". Enable them per run with
--batata.plugin.*.enabled=true or BATATA_PLUGIN_* overrides — no config
file change. See docs/deployment.md.
Compatibility
| Protocol |
Support |
Details |
| Nacos V2 / V3 |
Full |
V1 intentionally unsupported |
| Nacos gRPC |
Full |
Bidirectional streaming |
| Nacos AI / MCP Registry |
~91% |
MCP, Skill, AgentSpec, A2A, Prompt — docs/compat/nacos/ai/ |
| Consul |
Full |
Agent, Health, Catalog, KV, ACL |
| Apollo |
Supported |
Config/Admin/OpenAPI ported — docs/compat/apollo/ |
Console evidence: Nacos config ·
Consul catalog ·
Apollo items
Client SDK examples: docs/api.md
Configuration
Main file: conf/application.yml (fully commented — single source of truth).
Keys use the flat batata.* prefix and can be overridden by
BATATA_* environment variables or --batata.<key>=<value> CLI flags.
Most-used keys:
| Key |
Default |
Description |
batata.server.main.port |
8848 |
SDK HTTP port |
batata.console.port |
8081 |
Console port |
batata.deployment.type |
merged |
merged / server / console / serverWithMcp |
batata.sql.init.platform |
(empty) |
mysql, postgresql, or empty (= embedded) |
batata.core.auth.enabled |
true |
Enable authentication |
Complete reference: docs/configuration.md
Deployment
| Mode |
Flag |
Description |
merged (default) |
-d merged |
Console (8081) + Main Server (8848) in one process |
server |
-d server |
Main Server only, no console |
console |
-d console |
Console only, connects to a remote server |
serverWithMcp |
-d serverWithMcp |
Main Server + MCP Registry (9080) |
Container, Compose and Kubernetes instructions: docs/deployment.md
Documentation
Security
Please do not open public issues for security vulnerabilities.
Reporting instructions and response timelines are in SECURITY.md.
Contributing
See CONTRIBUTING.md.
License
Licensed under the Apache-2.0 License — see LICENSE.
Acknowledgments
- Nacos - Original design and API specification
- Consul - KV store and service discovery API design
- Apollo - Config Service / Admin Service / OpenAPI design
- batata-ui - Web console frontend
- OpenRaft - Raft consensus (0.10)
- SeaORM - Async ORM
- Actix-web - Web framework
- Tonic - gRPC implementation
评论