MySQL
A widely-deployed open-source relational database known for speed, simplicity, and a huge ecosystem. It powers much of the web. Lighter than Postgres on features but extremely reliable for straightforward OLTP workloads.
- Web OLTP with read-heavy patterns.
- Teams already invested in the MySQL ecosystem.
- Complex analytical queries or advanced types (Postgres is stronger).
- Workloads needing strict constraints and richer SQL semantics.
Definition
MySQL is a relational DBMS using pluggable storage engines (InnoDB default). InnoDB provides ACID, MVCC, clustered (index-organized) tables, and crash recovery. MySQL emphasizes read performance and operational simplicity.
Why it exists
Many apps need a fast, simple, well-understood relational DB with broad hosting and tooling. MySQL's clustered index and replication are battle-tested for web workloads.
How it works
InnoDB stores rows in a clustered index (primary key order), so primary-key lookups and range scans are fast. Secondary indexes contain primary keys, requiring a second lookup. Async replication to replicas; Group Replication / InnoDB Cluster for HA. Buffer pool caches hot data.
Scaling limits
Like Postgres, single-primary writes. Clustered index means secondary-index lookups cost two seeks. Replication lag can cause stale reads. Large tables need sharding; no native sharding.
Cost shape
Self-hosted compute+storage; managed (RDS/Aurora) similar to Postgres. Aurora separates compute/storage for cheaper replica scaling.
Alternatives
- PostgreSQL — Richer SQL/types but heavier per-connection and fewer read-optimized defaults.
- Aurora — Cloud-native MySQL with storage scaling, vendor lock-in.
Failure modes
- Replication lag causing stale reads.
- Secondary-index double-lookup cost on large tables.
- Implicit type coercion causing subtle bugs.