PostgreSQL Is Free. Running It Is Not.
The real cost of a "free" database in production — and why we built our own
The real cost of a "free" database in production — and why we built our own
Every startup pitch deck says the same thing: "We use PostgreSQL." The investor nods. PostgreSQL is free, battle-tested, and everybody uses it. What's not to like?
Nothing — until you look at the bill.
The license is free. Everything around it is not.
PostgreSQL itself costs zero. You download it, install it, run it. No license fee. This is true and it is also the least important cost in the entire stack.
Here is what a real production deployment of PostgreSQL costs for a SaaS with 10,000 users:
| Component | What it does | Monthly cost |
|---|---|---|
| PostgreSQL hosting (AWS RDS db.t3.medium) | Runs the database | $65 |
| Storage (100GB SSD) | Stores the data | $12 |
| Automated backups | Point-in-time recovery | $10 |
| Redis (ElastiCache) | Caching — because PostgreSQL is too slow for hot reads | $15-50 |
| Amazon S3 | File storage — because PostgreSQL doesn't store files well | $5-50 |
| Elasticsearch | Search — because PostgreSQL full-text search is limited | $50-200 |
| Pinecone or Weaviate | AI vector store — because PostgreSQL pgvector is bolted on | $70-200 |
| Monitoring (Datadog / pganalyze) | Know when it breaks | $20-100 |
| Data transfer | AWS charges for bytes leaving the VPC | $10-50 |
| Total | $257-737/month |
That is the cost of a "free" database. And this is before you hire someone to manage it.
The six services nobody talks about
The real problem is not PostgreSQL's price. It is that PostgreSQL is one tool in a stack of six to eight:
PostgreSQL stores structured data. But you also need:
Redis for caching — because reading from PostgreSQL on every request is too slow for real-time dashboards. Redis costs money, runs on a separate server, has its own failure modes, and needs its own backup.
Amazon S3 for files — because storing PDFs, images, and attachments in PostgreSQL is a bad practice. S3 costs money, lives in a different availability zone, and can get out of sync with your database. When a user uploads a file, you write metadata to PostgreSQL and the file to S3 and pray both operations succeed.
Elasticsearch for search — because PostgreSQL's built-in text search works for simple cases and falls apart for anything resembling a real search experience. Elasticsearch is its own cluster, its own query language, its own operational burden.
Pinecone or Weaviate for AI — because if you want semantic search, RAG, or any AI feature that needs embeddings, PostgreSQL's pgvector extension is functional but limited compared to purpose-built vector databases.
An ORM (Prisma, SQLAlchemy, TypeORM) between your application and your database — because your application speaks JavaScript or Python and your database speaks SQL and someone has to translate. The ORM is an entire dependency with its own bugs, its own performance characteristics, and its own version compatibility matrix.
A migration tool (Flyway, Alembic, Knex) to change your schema — because ALTER TABLE on a large table locks it, in production, while your users wait. Schema migrations are the single largest source of production incidents at early-stage startups.
Each of these six services has its own server, its own configuration, its own monitoring, its own backup strategy, and its own way of failing at 3 AM. The "free" database requires five paid companions and a layer of glue code to function as a complete storage system.
What this means for margins
Let us do the math that matters to an investor.
A SaaS company charging $30/user/month for 1,000 users generates $30,000/month in revenue. Their infrastructure cost:
| Item | Cost |
|---|---|
| PostgreSQL (RDS) | $175 |
| Redis | $50 |
| S3 | $30 |
| Elasticsearch | $100 |
| Application server (EC2) | $150 |
| Load balancer, DNS, etc. | $50 |
| Monitoring | $50 |
| Total infrastructure | $605/month |
| Gross margin | 98% |
That looks great. But add the people cost:
| Role | Monthly cost (loaded) |
|---|---|
| Backend engineer (maintains 6 services) | $12,000 |
| DevOps / SRE (keeps them running) | $10,000 |
| Half a DBA (manages PostgreSQL) | $5,000 |
| Total people cost | $27,000/month |
| Real gross margin | 8% |
Infrastructure is cheap. The people who manage the infrastructure are not. And the reason you need those people is that you are running six services instead of one.
What one service looks like
We built Orion DB — a database engine that serves five roles in one process:
| What PostgreSQL stack needs | What Orion DB does |
|---|---|
| PostgreSQL (structured data) | Hierarchical object store — data is a tree, not flat tables |
| Redis (cache) | Same engine — tree traversal is O(depth), not O(rows) |
| Amazon S3 (files) | Same engine — files are binary members, seekable by offset |
| Elasticsearch (search) | Same engine — OID-as-index, hash a word, point read |
| Pinecone (AI vectors) | Same engine — AIRecords stored in the same tree |
One process. One file. One backup. One failure mode. No ORM — the compiler knows the schema. No migration tool — collections are schemaless. No connection pool — same process.
The infrastructure cost for 30,000 users on Orion DB: one $70/month server. Not six services on AWS. One Linux box with our binary.
The people cost: zero additional. There is no Redis to configure, no S3 to sync, no Elasticsearch cluster to manage, no ORM to update, no migration to run. The person who writes the application IS the person who manages the database, because they are the same code in the same language.
The margin difference
| Traditional stack | Our stack | |
|---|---|---|
| Infrastructure (30K users) | $605/month (6 services) | $70/month (1 server) |
| People overhead | 2-3 engineers for infra | 0 additional |
| Gross margin | 60-70% | 87% |
| Cost per user | $0.05-0.50 | $0.002 |
This is why we charge $50/month flat and it is profitable. Our competitors charge $30/user/month and their margins are worse, because their "free" database costs them $605/month in direct infrastructure plus $27,000/month in people who manage it.
Why this matters to an investor
The standard question is: "What is your infrastructure cost per user?" And the standard answer is a number between $0.05 and $0.50, and the investor benchmarks it against other SaaS companies in the same range.
Our answer — $0.002 per user — is not in the same range. It is 25 to 250 times lower. And the reason is not clever optimization of the same stack. The reason is a different stack: one engine instead of six services, one language that knows the database instead of an ORM between two languages, one file instead of five storage systems.
The "free database" is the most expensive decision in every SaaS company's architecture. It is free to download and it costs $27,605/month to run. We eliminated that cost by building our own.
*Orion DB is the storage engine inside the Elastic Platform. We built the compiler (EPL), database, protocol (TProtocol), HTTP server (HSRV), and GUI framework from scratch. Nine products ship on it. Twenty AI agents build on it daily.*
*More: elastcode.com/investors*