Skip to content
zig 0.16 · v0.5.2

Build microservices
in Zig.
One binary. No GC.

Zero is a batteries-included web framework for Zig. Wire REST, SQL, NoSQL, cache, pub/sub, auth, GraphQL and observability into a single static binary — configured almost entirely through .env.

runs in ~15 lines ↗
~/my-app — zero
installzig fetch --save https://github.com/im-ng/zero/archive/refs/heads/main.zip
  • 0requests / sec
  • 0typical RSS (16–65)
  • 0lines to first API
  • 0integrations built-in
why zero

The microservice building blocks,
wired for you.

Zero boilerplate

Databases, queues, auth and observability plug in with no glue code. Everything is wired through .env.

no glue code, really

Single static binary

Compile to one dependency-free binary. Tiny RSS (~16–65 MiB), no managed runtime, ships anywhere, including Kubernetes.

ships anywhere ↘

Observable by default

Structured JSON logs, Prometheus metrics, distributed tracing and health endpoints are wired in from the first request.

from req #1

Fast and small

Tens of thousands of requests/sec at ~50 MiB RSS. No GC pauses, no JIT warm-up, explicit memory control.

no GC pauses!
hello, json

That's the whole app.

  • Drop it in src/main.zig
  • Add a configs/.env
  • zig build run gives you a JSON API with structured logs
  • /metrics already live.

Everything else (Postgres, Redis, Kafka, auth, GraphQL and metrics) is opt-in through configuration. Nothing to wire by hand.

Full walkthrough ~15 lines → running API
src/main.zig
const std = @import("std");
const zero = @import("zero");
const App = zero.App;

pub const std_options: std.Options = .{ .logFn = zero.logger.custom };

pub fn main(init: std.process.Init) !void {
    var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
    defer arena.deinit();

    const app = try App.new(arena.allocator(), init.io, init.environ_map);
    try app.get("/json", jsonResponse);
    try app.run();
}

fn jsonResponse(ctx: *zero.Context) !void {
    try ctx.json(.{ .msg = "hello zero!" });
}
the constellation

30+ integrations, one App.new.

Every piece is opt-in through configuration. Hover or focus a node to see what it does.

Web & APIData storesMessagingCross-cuttingREST / CRUDAutoCRUDGraphQLProtobufWebSocketSwagger UIPostgreSQLSQLiteDuckDBRedisCassandraInfluxDBSolrS3 / FileKafkaNATSMQTTPub/SubAuthCORSMetricsTracingHealthLoggingMigrationsCronCLIRate LimiterResilienceHTTP Clientzero.
integrationPick a node

Hover or focus any node in the map to reveal what Zero wires in for you.

the difference

One binary. Nothing else to ship.

Drag the divider to compare a Zero service with a typical Go / Node setup.

Typical Go / Node
  • Outputruntime + deps
  • Memory (RSS)200–500+ MiB
  • Boilerplatescaffolding + DI
  • GC / JITyes
  • Deployruntime + PM
Zero zig 0.16
  • Output1 static binary
  • Memory (RSS)~50 MiB
  • Boilerplate~15 lines
  • GC / JITnone
  • Deploycopy & run

← drag →

observability & benchmarks

Numbers you can reproduce.

The bundled benchmark harness drives a concurrency ramp and reports throughput, latency percentiles and per-level RSS. CI runs it for regression.

  • 0requests / secsingle binary
  • 0p99 latencyunder load
  • 0RSS at speed16–65 MiB range
  • 0framework testswith coverage
RSS under load
Zero
~50 MiB
Typical Go
~300 MiB
Typical Node
~400 MiB
See the methodology →
ready when you are

Start building in Zig.

One dependency-free binary. No GC. Everything else is configuration.

zig fetch --save https://github.com/im-ng/zero/archive/refs/heads/main.zip