2.4x faster nested queries than Prisma

Serverless Postgres
with the Fastest ORM

BataDB combines a Neon-compatible storage engine with Turbine — a TypeScript ORM that resolves nested queries in a single SQL statement.

app.ts
const user = await db.users.findUnique({
where: { id: 1 },
with: {
posts: {
with: { comments: true }
}
}
})
// 1 SQL query. 3 levels deep. 2.4ms.

Why BataDB

A vertically integrated Postgres platform — storage engine + ORM designed to work together.

Scale-to-Zero Compute

Compute suspends automatically after inactivity. Sub-second cold starts. You pay only when queries are running.

Database Branching

Fork any database in milliseconds with copy-on-write. Create dev branches from prod, test against real data, merge or discard.

Turbine ORM

Nested queries resolve in a single SQL statement using json_agg. 2.4x faster than Prisma on L3 nested queries. Full TypeScript types.

One Query vs Three

Prisma sends separate queries for each relation level. Turbine resolves the entire tree in a single SQL statement.

Prisma
3 queries · 5.6ms
// Query 1: Get user
SELECT * FROM users
WHERE id = 1
// Query 2: Get posts
SELECT * FROM posts
WHERE user_id IN (1)
// Query 3: Get comments
SELECT * FROM comments
WHERE post_id IN (1, 2, 3)
Turbine
1 query · 2.4ms
SELECT
u.*,
(SELECT json_agg(json_build_object(
'id', p.id, 'title', p.title,
'comments', (SELECT json_agg(...)
FROM comments c
WHERE c.post_id = p.id)
)) FROM posts p
WHERE p.user_id = u.id) AS "posts"
FROM users u
WHERE u.id = 1
L3 Nested Query Benchmark (lower is better)
Turbine
2.4ms
Prisma
5.6ms

Everything You Need

A complete platform for building, debugging, and scaling Postgres applications.

DB Studio

Browse and edit your tables directly in the browser. Filter, sort, and export data without writing SQL.

CLI

Manage projects, branches, and deployments from your terminal with the bata CLI. Script everything.

TypeScript Types

Auto-generated types from your database schema. Full IntelliSense for every table, column, and relation.

Connection Pooling

Built-in PgBouncer with transaction-mode pooling. Ready for serverless functions out of the box.

Query Insights

Built on pg_stat_statements. Per-query latency, QPS, rows scanned, and slow query detection.

Pipeline Batching

Send multiple queries in a single round-trip using the extended query protocol. Reduce network overhead.

Up and Running in 60 Seconds

Install the ORM, point it at your database, and start querying with full type safety.

1
Install
npm install @batadata/turbine
2
Generate
npx turbine generate --url $DATABASE_URL
3
Query
const user = await db.users.findUnique({
  where: { id: 1 },
  with: { posts: true }
})

Simple, Transparent Pricing

Start free. Scale as you grow. No surprises.

Free

$0/month

For hobby projects and experimentation

1 project
1 GB storage
100 compute hours
Community support
Get Started Free
Most Popular

Pro

$20/month

For production applications

10 projects
50 GB storage
Unlimited compute
Database branching
Query insights
Email support
Start Pro Trial

Team

$50/month

For teams building at scale

Unlimited projects
200 GB storage
Unlimited compute
Database branching
Team management & RBAC
Priority support
Start Team Trial