The relational database was the default for most applications for 30 years. The proliferation of purpose-built databases has made database selection a real engineering decision. The NoSQL hype has faded; what remains is a more nuanced understanding of when each database type excels.

Relational databases are still the default

PostgreSQL and SQL Server remain the right choice for the majority of applications: transactional workloads with complex relationships, ad-hoc query requirements, and data integrity requirements that benefit from constraints, foreign keys, and ACID transactions. The argument that relational databases do not scale is outdated, PostgreSQL on a well-provisioned server handles millions of rows and thousands of transactions per second. Start with relational and migrate if you have a concrete use case for something else.

Document databases for schema flexibility

MongoDB and Azure Cosmos DB (document API) are appropriate when: the data has variable schema that would require frequent ALTER TABLE in a relational database, the document (JSON object) is the natural unit of access and modification, and the use case does not require cross-document joins. E-commerce product catalogs, CMS content, and user profiles with variable attributes are strong document database use cases.

Redis for speed and its limits

Redis is not a primary database; it is a high-performance data structure store. The use cases: session storage, caching expensive queries, rate limiting (atomic counters), pub/sub for real-time messaging, and leaderboards (sorted sets). Redis data is in-memory (with optional persistence), which makes it orders of magnitude faster than any disk-backed database for these patterns. Using Redis as a primary database for non-ephemeral data is a misuse of the tool.

The time-series case

InfluxDB, TimescaleDB (Postgres extension), and Azure Data Explorer are purpose-built for time-series data: metrics, sensor data, log telemetry, financial tick data. The key optimisations: columnar storage, automatic data compression, time-based partitioning, and query engines optimised for aggregation over time ranges. For high-volume time-series ingestion and retention, a purpose-built time-series database outperforms a general relational database by orders of magnitude.