Just Fucking Use Postgres
You probably think you need some fancy-ass NoSQL database. You're over here evaluating document stores because some blog said "schema-less is the future." You're considering key-value stores because you heard they're fast. You're using fucking Firebase because you can't be bothered to learn SQL. Well guess what, dipshit:
You just need Postgres.
That's it. That's the fucking answer. Stop Googling "NoSQL vs SQL" for the 47th time. Stop asking on Reddit if you should use a document database. Stop pretending you have Google-scale problems when you have 12 users.
Here's why, motherfucker:
- It's been around since 1996 and it's not going anywhere
- It handles JSON better than your precious NoSQL
- It does full-text search without ElasticSearch
- It has actual fucking transactions that work
- It scales to billions of rows (more than you'll ever have)
- It's free and open source, you cheap bastard
"But I need to scale!"
No you fucking don't. You know what scales? Postgres. You know what doesn't? Your janky-ass microservices architecture with 47 different databases that you can't query together. Instagram scaled to millions of users on Postgres. Spotify uses Postgres. Reddit uses Postgres. But sure, your todo app needs a distributed database cluster.
"But NoSQL is more flexible!"
Flexible is just another word for "I don't know what the fuck my data looks like." You know what's actually flexible? JSONB columns in Postgres. You can shove whatever garbage JSON you want in there AND still query it with indexes AND have actual data integrity. It's literally the best of both worlds but you're too busy chasing NoSQL trends to notice.
"But NoSQL is easier!"
You know what's easier? Not losing your data. NoSQL databases trade consistency for... what exactly? "Eventual consistency" means "sometimes wrong." "Schema-less" means "good luck migrating this shit later." Learning SQL takes like 2 hours. Stop being lazy.
What Postgres Actually Does
- ACID transactions: Your data doesn't get fucked up. Just fucking use transactions.
- Foreign keys: Maintains relationships like an adult database. Just fucking use foreign keys.
- Full-text search: You don't need ElasticSearch for your blog. Just fucking use Postgres Full-Text Search.
- JSON support: JSONB is faster than MongoDB for most queries. Just fucking use JSONB.
- Geospatial data: PostGIS is better than whatever you were planning. Just fucking use PostGIS.
- Time-series data: TimescaleDB extension handles it better than InfluxDB. Just fucking use TimescaleDB.
- Pub/Sub messaging: LISTEN/NOTIFY works for 99% of use cases. Just fucking use LISTEN/NOTIFY.
- Queues: pgmq and other queue extensions exist. Just fucking use Postgres queues.
- Vector search: pgvector does embeddings and similarity search. Just fucking use pgvector.
- Graph queries: Recursive CTEs handle most graph problems. Just fucking use WITH RECURSIVE.
- Caching: Materialized views are built-in. Just fucking use MATERIALIZED VIEWS.
- Extensions: It has more features than your framework. Just fucking use extensions.
- Mature tooling: Every language has a Postgres driver. Just fucking use it.
Stop Over-Engineering Your Shit
You don't need a database for caching (Redis), a database for full-text search (ElasticSearch), a database for time-series data (InfluxDB), a database for graphs (Neo4j), and a database for your actual data (whatever NoSQL flavor of the week). You need one fucking database: Postgres. It does all of that.
Use Postgres. Learn SQL. Stop cargo-culting technology choices from companies that have actual scale problems. Your startup with 3 users and a dream doesn't need the same database as Netflix.
"Just use Postgres."
- Everyone who's been doing this for more than 5 minutes
Yes, This is Satire (Kind Of)
Look, there ARE legitimate use cases for other databases. If you're building a real-time chat app, maybe you want Redis. If you're actually doing big data analytics with unstructured data at massive scale, maybe you want a specialized NoSQL solution. If you're Google, you probably know what you're doing.
But for 95% of applications, Postgres is the right choice. It's the sensible default. Start with Postgres. Only move away from it when you have a SPECIFIC, MEASURED reason to do so. Not because it's trendy. Not because you read a blog post. Because you actually need something it can't do.
Until then: Just. Fucking. Use. Postgres.