Branch per pull request
Every preview deploy gets an isolated copy-on-write branch of production data in under a second.
serverless database · 38 edge regions
Basalt replicates your data to 38 edge regions and gives you a typed API in every language. Single-digit millisecond reads, strongly consistent writes, nothing to provision.
$ npm i @basalt/client1import { basalt } from '@basalt/client'
2import type { Order } from './schema'
3
4const db = basalt({ region: 'auto' })
5
6export async function recentOrders(customerId: string) {
7 // Reads go to the nearest replica (p50 4 ms)
8 const orders = await db
9 .from<Order>('orders')
10 .where({ customerId, status: 'paid' })
11 .orderBy('createdAt', 'desc')
12 .limit(20)
13
14 return orders // Order[], fully typed
15}
1from basalt import Basalt
2from schema import Order
3
4db = Basalt(region="auto")
5
6async def recent_orders(customer_id: str) -> list[Order]:
7 # Reads go to the nearest replica (p50 4 ms)
8 return await (
9 db.table(Order)
10 .where(customer_id=customer_id, status="paid")
11 .order_by("-created_at")
12 .limit(20)
13 )
1package orders
2
3import "basalt.example/go/basalt"
4
5var db = basalt.New(basalt.Region("auto"))
6
7func RecentOrders(ctx Ctx, customerID string) ([]Order, error) {
8 // Reads go to the nearest replica (p50 4 ms)
9 var orders []Order
10 err := db.From("orders").
11 Where("customer_id = ? AND status = ?", customerID, "paid").
12 OrderBy("created_at DESC").
13 Limit(20).
14 Scan(ctx, &orders)
15 return orders, err
16}
1use basalt::{Client, Desc};
2use crate::schema::Order;
3
4pub async fn recent_orders(db: &Client, id: &str) -> basalt::Result<Vec<Order>> {
5 // Reads go to the nearest replica (p50 4 ms)
6 db.from::<Order>("orders")
7 .filter(("customer_id", id))
8 .filter(("status", "paid"))
9 .order_by("created_at", Desc)
10 .limit(20)
11 .fetch_all()
12 .await
13}
1# One HTTPS call from any runtime
2curl api.basalt.example/v1/db/shop/query \
3 -H "Authorization: Bearer $BASALT_KEY" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "sql": "select * from orders where customer_id = $1 limit 20",
7 "params": ["cus_8Hq2"],
8 "consistency": "nearest"
9 }'
$ basalt deploy --branch main
✓ Schema migrated (3 changes)412ms
✓ Replicated to 38 regions1.9s
✓ Edge cache warmed640ms
regionp50p99
fra13.8ms11ms
iad13.9ms11ms
sin14.6ms14ms
→ Live at orders-api.basalt.example
$
Trusted by 41,000 teams shipping at the edge
01 / Architecture
Reads stop at the closest replica. Writes go to a single primary and replicate out through a change stream that also powers webhooks and realtime subscriptions.
02 / Platform
Every preview deploy gets an isolated copy-on-write branch of production data in under a second.
Your schema compiles to types for TypeScript, Python, Go and Rust. Break a column, break the build.
Rewind any branch to any second in the last 30 days. No snapshots to schedule.
Store embeddings next to rows and query them with the same filters and permissions.
Policies written in SQL run at the edge, so tokens never reach the primary.
Subscribe to any query. Changes arrive over WebSockets within 50 ms worldwide.
03 / API reference
Every client library is a thin, typed wrapper over the same eight endpoints. Use them from anywhere that can make an HTTPS request.
POST/v1/db/{db}/query
Executes one parameterised statement. Reads are served by the nearest replica unless consistency is "strong". Writes are always routed to the primary.
| Parameter | Type | Description |
|---|---|---|
sqlrequired | string | Parameterised SQL. Up to 64 KB. |
params | array | Positional values for $1, $2 … |
consistency | "nearest" | "strong" | Read from the nearest replica or the primary. Default nearest. |
branch | string | Branch to query. Defaults to main. |
timeout_ms | integer | Abort after this many milliseconds. Max 30000. |
curl -X POST api.basalt.example/v1/db/shop/query \
-H "Authorization: Bearer $BASALT_KEY" \
-d '{ "sql": "select id, total from orders limit 2" }'
{
"rows": [
{ "id": "ord_9fK2", "total": 4200 },
{ "id": "ord_9fK3", "total": 1850 }
],
"region": "fra1",
"replica_lag_ms": 12,
"timing": { "total_ms": 4.1, "cache": "miss" }
}
04 / Edge network
RegionTraffic shareLive · updated 14:02 UTC
05 / Pricing
Start free. On Pro you pay a flat $19 plus what you use beyond the included allowance, billed per million rows.
Estimated Pro bill
Total / month$111.50
Compared with a provisioned cluster of the same peak: $1,240 / month.
$0forever
$19per month + usage
Customannual commit
06 / Reliability
All systems operational· checked 32 s ago
90 days agoToday
07 / Changelog
Preview deploys now get an isolated branch automatically. Branches are copy-on-write, so they cost nothing until they diverge.
- basalt branch create preview-482 + # nothing to do: branches follow your git provider
HNSW indexes with filtered search, up to 4,096 dimensions.
Connection set-up from Asia Pacific edges dropped from 38 ms to 9 ms.
Async-first, zero-copy row decoding and compile-time checked queries.
“We deleted our read-replica fleet, our cache layer and two on-call rotations. p95 for checkout went from 180 ms to 22 ms.”
-14,212 lines“Branch-per-PR changed how we review migrations. Reviewers click the preview and the data is already there.”
+1 workflow