RDS costs $15/month even when sleeping. Neon's serverless PostgreSQL scales to zero — and you only pay when queries run.
What is Neon?
Neon is serverless PostgreSQL that separates storage and compute. Your database scales to zero when idle, branches like git for testing, and wakes up in milliseconds when a query arrives.
Why Neon
1. Scale to Zero
Traditional PostgreSQL:
Midnight: 0 queries → still paying $15/month
3 AM: 0 queries → still paying
6 AM: 1 query → compute wakes up → serves query → back to zero
Neon:
Midnight: 0 queries → $0
3 AM: 0 queries → $0
6 AM: 1 query → compute activates in ~500ms → serves query → scales to zero
2. Database Branching
# Create a branch from production
neonctl branches create --name feature-auth --parent main
# Test schema changes on the branch
psql $BRANCH_URL -c "ALTER TABLE users ADD COLUMN avatar_url TEXT;"
# Branch has production data but changes don't affect main
# Delete when done
neonctl branches delete feature-auth
3. Serverless Driver (HTTP)
import { neon } from '@neondatabase/serverless';
const sql = neon(process.env.DATABASE_URL);
// Works in Vercel Edge, Cloudflare Workers, Deno Deploy
const users = await sql`SELECT * FROM users WHERE active = true LIMIT 10`;
No TCP connections. Pure HTTP — works in any serverless runtime.
4. Connection Pooling
import { Pool } from '@neondatabase/serverless';
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
// WebSocket-based pooling for serverless
const client = await pool.connect();
const result = await client.query('SELECT * FROM products');
client.release();
5. Instant Point-in-Time Restore
# Restore to any point in the last 7 days (free) or 30 days (paid)
neonctl branches restore main --timestamp "2026-03-27T15:30:00Z"
6. Autoscaling
Free tier: 0.25 vCPU (scales to zero)
Pro: 0.25 → 8 vCPU (auto-scales based on load)
Morning: 0.25 vCPU (low traffic)
Noon: 2 vCPU (peak)
Night: 0 vCPU (scaled to zero)
Free Tier
| Feature | Free |
|---|---|
| Compute hours | 191h/month |
| Storage | 512 MB |
| Branches | 10 |
| History | 7 days |
| Projects | 1 |
191 compute hours = always-on for a small app, or scale-to-zero for multiple projects.
Neon vs Supabase vs PlanetScale vs RDS
| Neon | Supabase | PlanetScale | RDS | |
|---|---|---|---|---|
| Database | PostgreSQL | PostgreSQL | MySQL | Any |
| Scale to zero | Yes | No | Yes | No |
| Branching | Yes | No | Yes | No |
| Serverless driver | HTTP | PostgREST | HTTP | No |
| Connection pooling | Built-in | PgBouncer | Built-in | Via proxy |
| Free tier | 512MB, 191h | 500MB, always-on | 5GB, sleep | None |
Getting Started
# Sign up at neon.tech
# Create project → get connection string
npm install @neondatabase/serverless
import { neon } from '@neondatabase/serverless';
const sql = neon(process.env.DATABASE_URL);
const result = await sql`SELECT NOW()`;
The Bottom Line
Neon makes PostgreSQL serverless-native. Scale to zero for $0 idle cost, branch for safe testing, and connect from any edge runtime via HTTP. The best free PostgreSQL for side projects.
Need data tools? I build scraping solutions. Check my Apify actors or email spinov001@gmail.com.
Top comments (0)