Now with GraphQL & Real-time Subscriptions

PostgreSQL API
in Milliseconds

High-performance REST & GraphQL API server for PostgreSQL, written in Rust. Native AWS Lambda support with ~50ms cold starts. Drop-in PostgREST replacement.

Terminal
# Start in seconds with Docker
$ docker run -p 3000:3000 \
    -e DATABASE_URL="postgres://..." \
    postrust/postrust

# Your API is ready!
$ curl localhost:3000/users
[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]
MIT Licensed
~50ms Lambda Cold Start
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.

Blazing Fast

Written in Rust for maximum performance. Sub-millisecond response times and minimal memory footprint.

Serverless-First

Native support for AWS Lambda. Single binary with ~50ms cold starts. No container overhead.

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 for drop-in migrations.

Admin UI Included

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

Single Binary

~5MB binary with no runtime dependencies. Deploy anywhere - Docker, Lambda, bare metal.

Performance

Built for speed and efficiency

Rust's zero-cost abstractions and efficient memory management make Postrust ideal for serverless deployments where cold start matters.

Why Serverless-First Matters

Native AWS Lambda Support

Single binary compiled with cargo-lambda, ~50ms cold start

5 MB Binary

LTO-optimized release build with admin UI, no runtime dependencies (~3 MB without)

No Container Required

Deploy as native binary, skip container overhead

Every number here is measured by scripts/bench.sh in the repository. See Benchmarks for the methodology, caveats, and how to reproduce them on your own hardware.

~50ms
Lambda cold start
5 MB
Binary size (with admin UI)
REST+
GraphQL built-in
0
Runtime dependencies
Feature
Postrust
PostgRESTHasura
Cold Start (Lambda)~50msN/A*N/A*
Binary Size~5 MB~20 MBContainer
ServerlessNativeVia containersCloud / containers
GraphQLBuilt-inNot supportedBuilt-in
Admin UIBuilt-inNot includedCloud only
LicenseMITMITApache 2.0

* PostgREST and Hasura typically run as containers, not native Lambda functions. Postrust can also run as a container if preferred.

How it compares

Postrust is not the only way to get an API out of a PostgreSQL schema, and it is not the right answer for every project. Each comparison lists measured throughput on the same database and the cases where the other tool is the better choice.

A page of 25 rows with a related collection embedded

Requests per second, higher is better. Each surface is compared only against the tools that expose it.

REST
Postrust
9,488
5.9 ms
baseline
PostgREST
6,005
12.2 ms
1.6× slower
GraphQL
Postrust
5,193
11.4 ms
baseline
Hasura
3,588
20 ms
1.4× slower
PostGraphile
3,495
16.5 ms
1.5× slower

Columns: requests per second, p95 latency, and the difference against Postrust. Same database, same dataset, every server in a container, each tool on its own defaults. Median of 5 runs on Darwin 25.2.0 arm64. Method and full results

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.