Databases & Storage
PostgreSQL
A mature open-source relational database with strong transactional guarantees, rich SQL features and extensions, suitable as the primary database for most products.
What PostgreSQL is
PostgreSQL is an open-source object-relational database system. It provides ACID transactions, constraints, advanced indexing, JSON support, full-text search and an extension ecosystem that includes PostGIS for geospatial data and pgvector for vector similarity search.
What it solves
- Storing business data with integrity guaranteed by transactions and constraints
- Complex querying, joins and reporting on operational data
- Handling semi-structured data with JSONB alongside relational tables
- Avoiding vendor lock-in with a widely supported open-source engine
When it makes sense
- As the primary database for most web applications and SaaS products
- Financial, order and user data where correctness matters
- Products that need both relational data and some document-style flexibility
- Small to medium vector search workloads via pgvector
Strengths
- Reliable ACID transactions and strong data integrity
- Rich SQL, indexing options and extensions
- Available as a managed service from all major cloud providers
- Large community, tooling and operational knowledge
Limitations
- Row-oriented storage is not optimal for large-scale analytical scans over billions of rows
- Write scaling beyond a single primary requires partitioning, sharding or additional tooling
- Needs maintenance attention: vacuuming, index tuning, connection pooling
- Schema migrations on large tables must be planned to avoid locking
Alternatives, and when they are better
- ClickHouse
ClickHouse is better for analytical workloads: aggregating very large volumes of events, logs or metrics with fast queries over a few columns. It is typically used alongside PostgreSQL rather than replacing it for transactional data.
- MySQL
MySQL is a reasonable choice when the team or hosting environment is already standardized on it and advanced PostgreSQL features are not needed.
- MongoDB
A document database can fit when data is truly schema-less and document-shaped and multi-record transactions are rare.
Practical examples
- A multi-tenant SaaS database storing accounts, subscriptions, permissions and audit history
- An order management system with inventory reservations handled in transactions
- A knowledge base that stores documents and embeddings together using pgvector
How it fits into the product architecture
PostgreSQL is usually the system of record, accessed by backend services through an ORM or query builder and a connection pooler. Read replicas can offload reporting queries, and analytical data can be streamed to a dedicated store such as ClickHouse. Operations include automated backups with tested restores, point-in-time recovery, monitoring of slow queries and controlled schema migrations in the CI/CD pipeline.
Next step
Choosing a stack for a new product?
We start from requirements, costs of ownership and the team you will have, then recommend technology with the reasons written down.