MySQL

MySQL

World's most popular open-source relational database

Features

  • InnoDB storage engine with ACID compliance
  • Built-in replication (async, semi-sync, group)
  • MySQL Shell for DevOps and admin automation
  • JSON document store capability

Pros

  • Widest hosting support and deployment simplicity
  • Excellent read performance for web applications
  • Mature replication and high-availability solutions

Cons

  • Fewer advanced features compared to PostgreSQL
  • Oracle ownership creates licensing concerns
  • Less extensible than PostgreSQL

Overview

MySQL is the world’s most popular open-source relational database, powering major platforms like WordPress, Facebook, Twitter, and YouTube. Its focus on speed, reliability, and ease of use has made it the default database for web applications since the early 2000s.

MySQL’s InnoDB engine provides full ACID compliance, row-level locking, and crash recovery. It offers multiple replication topologies for high availability and includes built-in support for JSON documents, full-text search, and spatial data.

When to Use

MySQL is a solid choice for web applications that need a reliable, well-supported relational database, especially when using platforms like PlanetScale. For complex queries, extensions, or advanced features, PostgreSQL may be a better fit.

Getting Started

docker run -d --name mysql \
  -e MYSQL_ROOT_PASSWORD=secret \
  -p 3306:3306 mysql:8

mysql -h 127.0.0.1 -u root -psecret
CREATE DATABASE myapp;
USE myapp;
CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  email VARCHAR(255) UNIQUE NOT NULL
);