Distributed cache synchronization service with automatic peer discovery and multi-region support.
CacheSync provides a lightweight HTTP API for registering cache nodes, monitoring cluster health, and synchronizing state across distributed deployments. It is designed for microservice architectures where multiple cache instances need to stay coordinated without a central message broker.
To integrate your cache node with the cluster:
POST /v1/sync request with your node configuration.POST /v1/heartbeat.GET /v1/health and cache statistics with GET /v1/stats.| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/health |
Cluster health and node status |
| GET | /v1/stats |
Cache statistics (hit rate, memory, per-node keys) |
| GET | /v1/docs |
API documentation (JSON) |
| POST | /v1/sync |
Register or update a node in the cluster |
| POST | /v1/heartbeat |
Send periodic health updates from a registered node |
Send a POST request to /v1/sync with your node configuration. This registers your node in the cluster and enables peer discovery.
curl -X POST https://cache.ergasterion.io/v1/sync \
-H "Content-Type: application/json" \
-d '{
"node_id": "my-cache-node",
"region": "eu-central-1",
"capabilities": ["get", "set", "delete", "flush"],
"context": {
"hostname": "cache.example.com",
"version": "2.4.1",
"runtime": "python3.11"
}
}'
Registered nodes should send periodic health updates every 30 seconds. Include your node ID, current status, load factor, and runtime context.
curl -X POST https://cache.ergasterion.io/v1/heartbeat \
-H "Content-Type: application/json" \
-d '{
"node_id": "my-cache-node",
"status": "active",
"load": 0.34,
"context": {
"connections": 42,
"memory_pressure": "low",
"hostname": "cache.example.com",
"version": "2.4.1"
}
}'
curl https://cache.ergasterion.io/v1/health
Response:
{
"status": "ok",
"cluster": "cachesync-eu-central",
"version": "2.4.1",
"uptime": "72h14m",
"nodes": 3,
"healthy_nodes": 3
}
curl https://cache.ergasterion.io/v1/stats
Returns cache hit/miss rates, memory usage, eviction counts, and per-node key distribution across the cluster.
CacheSync uses a gossip-based peer discovery model. Each node registers itself with the cluster coordinator, then sends periodic heartbeats with its current state. The coordinator maintains a registry of all active nodes and their capabilities, enabling automatic failover and load balancing across regions.
Nodes are identified by their node_id (typically a hostname or UUID) and grouped by region. The capabilities field declares which cache operations the node supports, allowing clients to select appropriate nodes for specific operations.