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.
# 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"}]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.
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
Single binary compiled with cargo-lambda, ~50ms cold start
LTO-optimized release build with admin UI, no runtime dependencies (~3 MB without)
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.
| Feature | Postrust | PostgREST | Hasura |
|---|---|---|---|
| Cold Start (Lambda) | ~50ms | N/A* | N/A* |
| Binary Size | ~5 MB | ~20 MB | Container |
| Serverless | Native | Via containers | Cloud / containers |
| GraphQL | Built-in | Not supported | Built-in |
| Admin UI | Built-in | Not included | Cloud only |
| License | MIT | MIT | Apache 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.
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
vs PostgREST
The project that established the idea. Haskell, REST only.
Read the comparison →vs Hasura
A GraphQL platform. Permissions as metadata, not database roles.
Read the comparison →vs PostGraphile
GraphQL built to be reshaped. V5 plans with Gra*fast*.
Read the comparison →vs Supabase
A whole backend platform. Its REST layer is PostgREST.
Read the comparison →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.
# 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"}
]# 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}}]
}]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.
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
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/postrustAWS Lambda
Serverless deployment with native adapter
$ cargo lambda build --release -p postrust-lambdaKubernetes
Production-ready with health checks and scaling
$ helm install postrust ./charts/postrustFly.io
Global edge deployment in minutes
$ fly launchRailway
Git-based deployment, builds the Dockerfile
$ railway init && railway upBinary
Single binary for bare metal servers
$ cargo build --release -p postrust-serverReady to build faster APIs?
Get started with Postrust in minutes. Join developers building high-performance PostgreSQL APIs with Rust.