MySQL is a free, open-source relational database management system, originally released in 1995 and now owned by Oracle. It powers a huge portion of the web — WordPress, Facebook's early stack, Shopify, and countless internal business systems.
Why MySQL is popular
- Free and open source (GPL), with a paid enterprise edition.
- Fast for read-heavy workloads and well understood by almost every developer.
- Runs on Linux, Windows, macOS, Docker and every major cloud.
- Mature ecosystem: Workbench, phpMyAdmin, connectors for PHP, Node.js, Python, Java, Go.
Client–server architecture
MySQL follows a client-server model in three layers:
- Connection layer — accepts connections, authenticates users, manages threads and connection pooling.
- Server layer — parser, optimizer, query cache (removed in 8.0), and all built-in SQL functionality. This is where your query is parsed into a tree and an execution plan is chosen.
- Storage engine layer — pluggable engines that actually read and write data on disk.
Client (app / mysql CLI)
│
Connection layer ──► authentication, threads
│
Server layer ──► parser → optimizer → executor
│
Storage engine ──► InnoDB / MyISAM / MEMORY
│
Disk / files
Storage engines
| Engine | Transactions | Locking | Best for |
|---|---|---|---|
| InnoDB (default) | Yes (ACID) | Row-level | Almost everything |
| MyISAM | No | Table-level | Legacy read-only data |
| MEMORY | No | Table-level | Fast temporary lookup tables |
| ARCHIVE | No | Row-level | Compressed cold storage |
| CSV | No | Table-level | Data exchange as plain CSV |
Use InnoDB unless you have a specific, well-understood reason not to. It supports foreign keys, crash recovery, and MVCC.
MySQL vs MariaDB vs PostgreSQL
- MariaDB is a community fork of MySQL, mostly drop-in compatible, with extra engines.
- PostgreSQL is stricter about standards and stronger for complex queries, custom types and GIS.
- MySQL 8.x closed much of the gap with window functions, CTEs, JSON and better optimizer behaviour.