# DB Bench — Neon vs Xata Serverless Postgres

## Overview
- **Generated**: 2026-05-17T22:31:35.730Z
- **Total samples**: 332
- **Completed runs**: 4
- **Data range**: 2026-05-17T22:00:00.603Z → 2026-05-17T22:15:01.102Z
- **Runtime**: Cloudflare Workers (smart_placement, us-east-1)
- **Driver**: Both providers use `@neondatabase/serverless` HTTP driver (same driver for fair comparison)
- **Target DB**: 100k rows in `bench_items` table with indexes on category and created_at

## Performance Comparison (all times in ms)

| Test Type | Metric | Neon p50 | Xata p50 | Δ (Xata−Neon) | Neon p95 | Xata p95 | Neon Count | Xata Count |
|-----------|--------|----------|----------|---------------|----------|----------|------------|------------|
| cold_start | totalMs | 1129 | 152 | -977 | 1129 | 152 | 1 | 1 |
| warm_latency | totalMs | 9 | 16 | +7 | 11.05 | 26.05 | 60 | 60 |
| simple_select | totalMs | 10 | 15.5 | +5.5 | 11 | 25.15 | 30 | 30 |
| indexed_lookup | totalMs | 10 | 17 | +7 | 15 | 24.65 | 30 | 30 |
| aggregation | totalMs | 43 | 28 | -15 | 146.4 | 72 | 15 | 15 |
| write | totalMs | 11 | 20 | +9 | 28.2 | 29 | 30 | 30 |

## Detailed Statistics

### Neon

| Test Type | Count | Min | p50 | Avg | p95 | p99 | Max |
|-----------|-------|-----|-----|-----|-----|-----|-----|
| cold_start | 1 | 1129 | 1129 | 1129 | 1129 | 1129 | 1129 |
| warm_latency | 60 | 8 | 9 | 9.32 | 11.05 | 12 | 12 |
| simple_select | 30 | 8 | 10 | 10.27 | 11 | 27.33 | 34 |
| indexed_lookup | 30 | 9 | 10 | 11.37 | 15 | 19.26 | 21 |
| aggregation | 15 | 39 | 43 | 57.33 | 146.4 | 162.08 | 166 |
| write | 30 | 9 | 11 | 14.97 | 28.2 | 77.57 | 97 |

### Xata

| Test Type | Count | Min | p50 | Avg | p95 | p99 | Max |
|-----------|-------|-----|-----|-----|-----|-----|-----|
| cold_start | 1 | 152 | 152 | 152 | 152 | 152 | 152 |
| warm_latency | 60 | 13 | 16 | 16.72 | 26.05 | 28.82 | 30 |
| simple_select | 30 | 13 | 15.5 | 16.8 | 25.15 | 35.97 | 38 |
| indexed_lookup | 30 | 14 | 17 | 18.37 | 24.65 | 27.42 | 28 |
| aggregation | 15 | 25 | 28 | 35.67 | 72 | 77.6 | 79 |
| write | 30 | 15 | 20 | 21.13 | 29 | 32.55 | 34 |

## Cold Start Details

| Provider | Total ms | Pre-probe State | Cold Verified | Instance Ready Count |
|----------|----------|-----------------|---------------|---------------------|
| neon | 1129 | idle | true | — |
| xata | 152 | unknown | false | 1 |

## Methodology Context

- Both providers are serverless Postgres (Neon and Xata/Crunchy Bridge Postgres)
- Both use the same HTTP driver (`@neondatabase/serverless`) — Xata supports the Neon serverless protocol natively
- Benchmarks run from Cloudflare Workers with `smart_placement` (pinned near us-east-1)
- Cold start tests use passive observation: both DBs have 5-min scaleToZero idle timeout, cold endpoint runs every 15 min
- Pre-probe state is checked via each provider's management API before sending the query
- `connect_ms` is near-zero for both (HTTP driver — no persistent connection)
- `query_ms` = `total_ms` = full HTTP round-trip including DB execution time
- Warm tests: warm_latency (SELECT 1 ×20), simple_select (LIMIT 10 ×10), indexed_lookup (PK lookup ×10), aggregation (GROUP BY ×5), write (INSERT ×10)
- Cold start: 1 sample per provider per run, scheduled every 15 min (~96/day)
- Branch create: create branch → poll readiness → verify data → delete, ×3 per provider

## Questions for Discussion

1. Is the warm latency difference between providers significant for real-world applications?
2. What explains Xata's aggregation advantage despite higher latency on simple queries?
3. How does the cold start difference (if observed) affect serverless application architecture?
4. What additional tests would provide more useful differentiation data?
5. How should cost be factored in alongside these performance numbers?