moonzero · control plane GitHub

MOONBIT · SERVICE FRAMEWORK

moonzero

One config document becomes a service that is already running: an application, the middleware it asked for, and an answer on a port.

moon add moonbitstack/moonzero

runs on wasm-gc, wasm, js and native

LIVE TOPOLOGYall healthy
every instance answering
TRACE 18:02:11.412 GET /api/v1/orders 200 2.1ms · p2c chose b · cache hit · span 4bf9… demo · the numbers are this page's, not a benchmark

01 / THE PATH

One request, end to end

Every hop is a package you can open. The rail on every page is this same line.

02 / WHAT IT CARRIES

What you stop writing yourself

Six areas, one dependency, and a package behind each of them.

01

Transport

REST and zRPC on one h2c, each with the interceptor chain it was configured with.

14packages
02

Resilience

A breaker, an adaptive shedder and three limiters, all reading the clock you hand them.

5packages
03

Routing

Round robin, weighted, or power of two choices over each instance's measured load.

10packages
04

Configuration

One document, checked at load, with every default written down where you can read it.

10packages
05

Data

Cache aside with one load per key, redis behind the same contract, SQL behind another.

10packages
06

Runtime

Stop and drain on a signal, log a request, trace it, and run several services as one process.

551public items

03 / CONFIGURED, NOT CODED

The service is a document

etc/orders.yaml
Name: orders-api
Host: 0.0.0.0
Port: 12000
Middlewares:
  Breaker: true
  Shedding: true
  Gunzip: true
Breaker:
  CpuThreshold: 800

read at load · refused if wrong · defaulted if absent

Middlewares.Breaker
The chain is assembled from these flags — a flag with nothing behind it changes no layer.
Breaker.CpuThreshold
A thousandth of the CPU reading: 800 is 80%. The shedder reads the same number.
Port
One number for the listener. The host that runs the application owns the socket.