Service discovery, self-registration and name-based routing across every Eru microservice. In-memory for dev, Redis for HA, etcd for Kubernetes — switch the backing store with one environment variable.
A microservice fleet needs a registry, a router and a health story. eru-gateway gives you all three out of the box — no service mesh to install, no Consul to operate.
Services register themselves with a heartbeat, the gateway routes by name, and the backend store is whatever you point at: memory, Redis or etcd. Same code path, swap with one env var.
In-memory for dev, Redis for HA, etcd for Kubernetes — pick with one REGISTRY_TYPE value.
Services re-register on a configurable TTL (90s default). Dead instances auto-deregister — no stale routes.
Route by service name, not a hardcoded URL. Eru services discover each other through the gateway.
Scale up or down — new instances appear in the registry automatically, no redeploy needed.
Services deregister cleanly on shutdown — no zombie endpoints left behind in the registry.
12-factor by default: port, registry type, TTL and trace URL all come from the environment.
Distributed tracing wired through every request — point at any OTLP collector you already run.
The in-memory registry means no Redis or etcd on your laptop. Same code path, lighter stack.
The etcd backend slots naturally into Kubernetes — services find each other inside the cluster.
A request hits the gateway, which consults the service registry, discovers a live route by name, and forwards to the target instance — backed by whichever store one env var selects.
No router files to maintain. Pick a backend, point at a store, and the registry handles the rest.
# Dev: zero dependencies, in-memory ERUGATEWAYPORT=8080 REGISTRY_TYPE=INMEMORY REGISTRY_TTL=90s # Production HA: Redis-backed ERUGATEWAYPORT=8080 REGISTRY_TYPE=REDIS REGISTRY_REDIS_ADDR=redis://redis-primary:6379 REGISTRY_TTL=90s TRACE_URL=tempo:4317 # Kubernetes: etcd-backed ERUGATEWAYPORT=8080 REGISTRY_TYPE=ETCD REGISTRY_ETCD_ENDPOINTS=etcd-0:2379,etcd-1:2379,etcd-2:2379