SDI.
All Databases
RelationalOps: medium

MySQL

MySQL is the most widely deployed open-source relational database, powering much of the web including major platforms like Facebook, GitHub, and Shopify. Its InnoDB storage engine provides ACID transactions, row-level locking, and crash recovery, while the pluggable engine architecture allows specialized engines for different workloads. MySQL's replication ecosystem and tooling maturity make it a proven choice for high-traffic web applications.

Strengths

Battle-tested at extreme scale (Meta runs millions of QPS across MySQL fleets)InnoDB's clustered index on primary key provides fast primary-key lookups with data localityMature replication ecosystem: async, semi-sync, and Group Replication for HAExcellent tooling for online schema changes (gh-ost, pt-online-schema-change)Lower memory footprint per connection compared to PostgreSQL's process model

Weaknesses

Historically weaker SQL standard compliance (improving in MySQL 8.x with CTEs, window functions)Query optimizer less sophisticated than PostgreSQL for complex analytical queriesNo native JSONB-equivalent with efficient indexing; JSON support is functional but slowerGROUP BY behavior and implicit type casting can produce surprising results without strict modeMVCC implementation in InnoDB can cause long-running transactions to block purge operations

Ideal Workloads

  • -High-throughput web applications with predictable query patterns and simple joins
  • -Read-heavy workloads scaled horizontally with read replicas
  • -Multi-tenant SaaS applications using schema-per-tenant or row-level partitioning
  • -Applications requiring proven HA solutions like InnoDB Cluster or Vitess-based sharding

Scaling Model

Scales vertically with hardware and read-horizontally via replication. Write scaling requires application-level sharding or middleware like Vitess (used by YouTube, Slack, and others) which provides transparent horizontal sharding, connection pooling, and query routing. MySQL InnoDB Cluster provides built-in HA with Group Replication and MySQL Router.

Consistency Model

Strong consistency on primary with REPEATABLE READ as the default InnoDB isolation level. Semi-synchronous replication ensures at least one replica acknowledges a transaction before commit returns, reducing data loss risk. Asynchronous replicas are eventually consistent. Group Replication provides virtual synchronous replication across a cluster with conflict detection.

When to Use

  • You are building a web application with well-understood query patterns and high read/write ratios
  • You need a database with decades of operational knowledge and mature tooling
  • Your team has MySQL expertise and you want predictable performance at scale
  • You plan to use Vitess or ProxySQL for future horizontal scaling
  • You need online schema migrations on large tables with minimal downtime

When Not to Use

  • You need advanced SQL features like lateral joins, partial indexes, or sophisticated query planning
  • Your workload requires complex analytical queries with many joins and aggregations
  • You need built-in support for geospatial, full-text search, or semi-structured data as first-class features
  • You require multi-master writes without an external orchestration layer

Source: editorial — Based on MySQL 8.x documentation and large-scale production deployment patterns

Command Palette

Search for a command to run...