What is PostgreSQL?
PostgreSQL (often just "Postgres") is a powerful, open-source relational database. It stores data in tables with rows and columns, and lets you define strict relationships between them — so your data stays consistent and correct. It has been refined for over 30 years and is trusted by everyone from startups to banks.
When should you use it?
Reach for PostgreSQL when your data has structure and relationships — users who have orders, orders that have items. When you need your data to be reliable and correct above all (it never silently loses or corrupts data), and when you might need advanced features later (full-text search, JSON columns, geographic data). It is the default sensible choice for most serious applications.
How to set it up
Install locally with your package manager (brew install postgresql on Mac, apt install postgresql on Linux), or run it in Docker with one command: docker run -e POSTGRES_PASSWORD=secret -p 5432:5432 postgres. For production, a managed service like AWS RDS or Supabase runs it for you.
How it connects to your code
From Python, connect with the psycopg library. From Node.js, use pg. You write SQL queries (SELECT * FROM users WHERE age > 18) and the database returns rows. An ORM like SQLAlchemy or Prisma can write the SQL for you.