Introduction
Everyone loves Serverless Postgres (Neon, Supabase, Aurora Serverless). It scales to zero, wakes up instantly, and saves money.
But under the hood, most are proprietary forks or expensive managed services.
As a DevOps engineer, I wanted the best of both worlds:
- Serverless Scaling: Pay for what I use.
- Standard Postgres: No vendor lock-in.
- Control: Running on my own Kubernetes cluster (EKS).
So I built Vura (https://vura.dev). Here is the architecture.
The Problem with RDS & Aurora
AWS RDS is great, but expensive. Even a small t3.micro instance costs ~$15/month idle. Multiply that by 10 microservices or side projects, and you're burning $150/month for databases doing nothing.
Aurora Serverless v2 scales, but the minimum capacity unit (ACU) is still pricey (~$45/mo minimum).
The Solution: Postgres on EKS
Kubernetes is perfect for orchestrating stateful workloads if you know what you're doing.
Architecture Overview:
- Orchestration: Kubernetes (EKS).
- Storage: EBS gp3 (fast, persistent) or Local NVMe (for high performance tiers).
- Operator: Custom operator to manage Postgres pods.
- Proxy: PgBouncer + Custom Proxy for "Wake on Connect".
How "Scale to Zero" Works
The magic of Serverless is scaling to zero when idle.
- Idle Detection: A sidecar monitors active connections. If 0 connections for 5 minutes -> Scale Deployment to 0 replicas.
- The Proxy: We keep a lightweight proxy running (consuming ~5MB RAM). It holds the IP address.
- Wake Up: When a client connects (e.g., your Lambda function), the proxy intercepts the TCP packet.
- It signals K8s to scale the Postgres deployment to 1.
- It holds the connection open (pauses the handshake).
- Once Postgres is ready (2-3 seconds), it proxies the traffic.
Result: You pay $0 for compute when no one is using your app.
The Economics (Why it's cheaper)
- Compute: Spot Instances on EKS. We bin-pack hundreds of databases onto a few nodes.
- Storage: You only pay for the EBS volume size (e.g., 5GB = $0.40/mo).
- Vura Pricing: We charge flat rates ($5/mo) because we can oversubscribe CPU/RAM safely, unlike AWS which reserves capacity.
Why not just use Neon/Supabase?
They are great! But Vura offers:
- Standard Postgres: We run the official docker image. Extensions work out of the box.
- Region Choice: We run on AWS us-east-1 currently, but can deploy to any K8s cluster (Edge, On-prem).
- Simplicity: No custom drivers needed. Just a connection string.
Try it out
I'm looking for beta testers who want a free database for their side projects.
π https://vura.dev
Let me know what you think of this architecture!
Top comments (0)