Now with GraphQL & Real-time Subscriptions

PostgreSQL API
in Milliseconds

One Rust binary that serves a PostgreSQL schema over REST and GraphQL, with a native AWS Lambda adapter. It answers PostgREST’s dialect and Hasura’s, and how closely is not a matter of opinion: each is measured by replaying that server’s own test suite against both.

Terminal
# Postgres and the server, from a clone
$ git clone https://github.com/postrust/postrust
$ cd postrust && docker compose up -d

# Your API is ready!
$ curl localhost:3000/api/users
[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]
MIT Licensed
95% of PostgREST’s test suite
REST + GraphQL

Everything you need to build APIs

Postrust provides a complete solution for exposing your PostgreSQL database as a secure, high-performance API. No boilerplate, no ORM, just your schema.

Fast, and Measured

44,324 requests/second on a point lookup at 1.1 ms median, on a host held still and gated for self-consistency. The method and the caveats are published with the figures.

Runs on Lambda

A native AWS Lambda adapter with connection pooling, from the same binary that runs standalone. Cloudflare Workers is a stub pending Hyperdrive.

GraphQL Built-in

Full GraphQL API alongside REST. Queries, mutations, filtering, and nested relationships out of the box.

Realtime Subscriptions

Live updates via GraphQL subscriptions. Subscribe to any query or view changes with PostgreSQL LISTEN/NOTIFY.

pgvector Integration

Native vector similarity search. Build AI-powered apps with embeddings, semantic search, and RAG pipelines.

Custom Routes in Rust

Define custom endpoints in pure Rust. Full access to Axum handlers, middleware, and the database pool.

Secure by Design

PostgreSQL Row-Level Security (RLS) enforcement. JWT authentication with customizable role claims.

PostgREST Compatible

Same query syntax and filtering operators. An opt-in compatibility mode serves canonical PostgREST paths and response shapes, and matches on 1,424 of PostgREST's own 1,499 test cases.

Admin UI Included

Built-in Swagger UI, Scalar API docs, and GraphQL Playground. OpenAPI 3.0 spec auto-generated.

Single Binary

4.98 MiB with the admin UI, 2.93 MiB without, and no runtime dependencies. Deploy anywhere - Docker, Lambda, bare metal.

Measured, on a machine that held still

Every server runs as a container against the same PostgreSQL instance and the same dataset, each pinned to its own CPU cores. These are the numbers the harness produced, not a summary of them.

REST

requests/second

Postrust against PostgREST, same request in each server's own dialect.

point lookup
Postrust
44,324
PostgREST
10,958
25-row page
Postrust
34,633
PostgREST
10,488
filtered + ordered page
Postrust
32,701
PostgREST
6,306
range filter on numeric
Postrust
30,837
PostgREST
7,099
25-row page + embed
Postrust
20,093
PostgREST
2,152

GraphQL

requests/second

Postrust and Hasura are sent the same query text, byte for byte.

single row by primary key
Postrust
32,146
Hasura
9,650
PostGraphile
14,127
25-row page
Postrust
17,411
Hasura
10,379
PostGraphile
9,003
25-row page + embed
Postrust
10,092
Hasura
8,024
PostGraphile
4,498

AMD EPYC 9255 24-Core Processor · governor=performance boost_sysfs=0 smt=off online=0-23 · PostgreSQL postgres:16 · 30,000 requests at concurrency 50, median of 3. The first measurement, repeated as the last action of the run, differed by 0.1%.

Read these as ratios rather than as capacity, and as a comparison of whole designs rather than of HTTP layers — much of the REST gap is that Postrust renders JSON itself where PostgREST builds it inside PostgreSQL on every request. Everything shares one host, so absolute throughput depends on that machine — and running in a container costs about 8.6% against the same binary run natively, charged to every server equally. PostgREST's own run-to-run spread is wider than the others' at up to 19.6%, so its multiples carry roughly ±10%. Full method

Developer Experience

Intuitive API, powerful results

Whether you prefer REST or GraphQL, Postrust provides a clean, consistent API that's easy to use and powerful enough for production.

Query with Filters
# Get active users with pagination
curl "localhost:3000/users?status=eq.active&limit=10&offset=0"

# Response
[
  {"id": 1, "name": "Alice", "email": "alice@example.com"},
  {"id": 2, "name": "Bob", "email": "bob@example.com"}
]
Nested Resources
# Get orders with customer and items
curl "localhost:3000/orders?select=*,customer(name,email),items(product(name,price))"

# Response
[{
  "id": 1,
  "total": 99.99,
  "customer": {"name": "Alice", "email": "alice@example.com"},
  "items": [{"product": {"name": "Widget", "price": 49.99}}]
}]
SaaS Starter Kit

Launch your SaaS in days, not months

A production-ready starter kit built on Postrust with authentication, team management, billing, and everything you need to ship fast.

Built with:Next.jsPostrustPostgreSQLTailwind CSS

Authentication

Magic link and OAuth with Google & GitHub

Team Management

Create teams, invite members, manage roles

Billing

Stripe & LemonSqueezy subscription management

API Keys

Generate and manage programmatic access

Row Level Security

PostgreSQL RLS policies built-in

Audit Logs

Track all team actions for compliance

Deployment

Deploy anywhere in minutes

From Docker to serverless, Postrust runs wherever you need it. Single binary with zero runtime dependencies.

Docker

Container-based deployment for any environment

$ docker run -p 3000:3000 -e DATABASE_URL=... postrust/postrust

AWS Lambda

Serverless deployment with native adapter

$ cargo lambda build --release -p postrust-lambda

Kubernetes

Production-ready with health checks and scaling

$ helm install postrust ./charts/postrust

Fly.io

Global edge deployment in minutes

$ fly launch

Railway

Git-based deployment, builds the Dockerfile

$ railway init && railway up

Binary

Single binary for bare metal servers

$ cargo build --release -p postrust-server
Open Source & MIT Licensed

Ready to build faster APIs?

Get started with Postrust in minutes. Join developers building high-performance PostgreSQL APIs with Rust.