MySQL powers a huge number of websites, from WordPress and Laravel apps to large e-commerce stores, and most performance problems in those apps trace back to the database. This course teaches you to find slow queries, fix them with the right indexes and schema changes, and run MySQL safely with proper users, backups and replication.
What you'll learn
- How InnoDB stores data: pages, clustered and secondary indexes, and the buffer pool
- Designing indexes: composite indexes, column order, covering indexes and when indexes hurt
- Reading
EXPLAINandEXPLAIN ANALYZEoutput and rewriting slow queries - Finding problems with the slow query log, Performance Schema and the sys schema
- Schema design for performance: data types, normalisation and pagination that scales
- Key configuration settings, including buffer pool size, redo log and connection limits
- Locking, transactions, isolation levels and diagnosing deadlocks
- Users, roles, privileges and secure configuration
- Backups and point-in-time recovery with MySQL Shell dump utilities, binary logs and physical backup tools
- Replication with GTIDs, read replicas, and planning upgrades to the current LTS release
Who it's for
- Backend developers whose apps have started to slow down
- Developers and sysadmins who look after MySQL or MariaDB servers without a dedicated DBA
- WordPress and e-commerce developers dealing with large databases
Prerequisites
- Comfortable writing SQL with joins and aggregates (see SQL and PostgreSQL Essentials)
- Basic Linux command line skills
- Access to a MySQL 8.x server you can experiment on, local or in Docker
Outcomes
By the end of this course you will be able to:
- Identify the slowest queries on a server and explain why they are slow.
- Design indexes and rewrite queries to fix them.
- Set up tested backups and restore to a point in time.
- Configure replication and plan a safe version upgrade.
Course outline
| Module | Topic |
|---|---|
| 1 | MySQL architecture and InnoDB internals |
| 2 | Data types and schema design for performance |
| 3 | How indexes work |
| 4 | EXPLAIN, EXPLAIN ANALYZE and query rewriting |
| 5 | Slow query log, Performance Schema and sys schema |
| 6 | Configuration and memory tuning |
| 7 | Transactions, locking and deadlocks |
| 8 | Users, roles and security |
| 9 | Backups and point-in-time recovery |
| 10 | Replication and read replicas |
| 11 | Monitoring, upgrades and managed MySQL in the cloud |
| 12 | Project: diagnosing and tuning a slow application database |
FAQ
Does this apply to MariaDB?
Most of it does. We point out where MariaDB differs, especially in replication and some optimiser features.
Which MySQL version do you use?
MySQL 8.4 LTS, with notes on newer innovation releases and on upgrading from 5.7 or 8.0.
Is this useful if I use a managed database like Amazon RDS?
Yes. Indexing, query tuning and backups still matter; we note which tasks the provider handles for you.
How do I join?
Get in touch and we'll share the current format, schedule and enrolment details.