Database groups repositories for storing and querying data: relational databases (PostgreSQL, MySQL, SQLite), document and key-value stores (MongoDB, Redis), and newer distributed or analytical systems (CockroachDB, TimescaleDB, DuckDB). It also includes database proxies, connection poolers, and migration tools that sit alongside the database engines themselves.
Choosing a database starts with data shape and consistency needs. Relational databases like PostgreSQL and MySQL fit structured data with relationships and support ACID transactions, making them the default choice for most application backends. Document stores such as MongoDB suit data with a flexible or evolving schema, at the cost of some of the consistency guarantees relational systems provide. Redis is typically used as a cache or for data structures that need very fast, in-memory access rather than as a primary datastore. SQLite, being a single embedded file with no server process, fits local applications, prototypes, and edge deployments where running a separate database server isn't practical.
For workloads that outgrow a single server, distributed SQL databases like CockroachDB add horizontal scaling and multi-region replication while keeping a familiar SQL interface. Time-series and analytical workloads benefit from purpose-built engines like TimescaleDB (a PostgreSQL extension) or DuckDB, which is optimized for fast analytical queries on local or embedded data.
Factors to weigh when comparing databases: