This document provides an overview of new InnoDB scalability improvements in MySQL 8.0, including improved read and write scalability. It discusses how the InnoDB architecture was updated to support read/write workloads on modern hardware more efficiently. The redo log was redesigned to be lock-less. Contention aware transaction scheduling and other new features like instant alter algorithms and temporary session tablespaces were added to enhance performance.
2. About Me
2
Karthik.P R,
Founder/CEO Mydbops, Ex-Yahoo!,
Working with MySQL ecosystem from 2010,
Juggles between Business leadership and hands
on technical expertise and a Creative Team
Builder.
3. About Mydbops
● Founded in 2015, HQ in Bangalore India with 150+ customer base across the globe.
● Mydbops is on Database Consulting with core specialization on MySQL and MongoDB Administration and
Support.
● We have expert team with 20+ certified DBA’s providing full time support and currently managing 300+
servers on premises and cloud.
● We help organisations to architect and scale systems in MySQL/MongoDB by implementing the advanced
technologies in industry which are completely open source.
● We are a leading solution provider in the market for all sort of cloud based database deployments and
management.
● An AWS partner for databases.
3
12. InnoDB Read Scalability
● MySQL 5.7
○ Full RO Transaction
○ Faster Reads than writes
● MySQL 8.0
○ RW Scalability
○ Efficient on same HW
○ High Concurrency Work load
12
13. InnoDB Read Scalability
Read Scalability
● Single mutex Contention ( fil_sys_t::mutex)
Solution :
● Sharding the fil_sys_t::mutex
● 64 Shards
● individual shar for REDO and UNDO Spaces
13
16. InnoDB Write Scalability
Redo log (WAL) - 5.7
● Major Component to ensure ACID
● Ensure Changes are durable
● Crash Recovery
● Slower at high concurrency ( Modern Hardware )
● Needs a new design
16
24. Lock Scheduling
CATS ( Contention Aware Transaction Scheduling )
● University of Michigan Contribution.
● Philosophy: Not all transaction are same.
● FIFO ( Default MySQL 5.7 )
● Switches between CATS from FIFO ( MySQL 8.0 )
● >= 32 Waiting threads
● Reduces lock sys wait mutex
● First database to adopt this Philosophy in Transaction
24
27. InnoDB Features
Data Dictionary ( SDI )
● A major overhaul in Data Dictionary
● ibd2sbi tool
Alter Algorithm=Instant
● Change Index
● Rename Table
● Modify column
● Add/Drop Virtual columns
27
28. InnoDB Features
Alter table add column
● Tencent Games
● Instant add column (at end)
Temporary Tablespace ( Session )
● Pool of 10 temporary tablespace ( .ibt )
● Each of 80K ( 5 pages ) in size
● 400K Space ID is reserved
28
29. InnoDB Features
Undo logs
● SQL to control Undo logs
○ Create UNDO Tablespace …
○ Alter UNDO Tablespace ….
○ Drop UNDO Tablespace ..
● Default 2 files ( 4 is better )
InnoDB Dedicated Server
● Better defaults
● InnoDB Buffer Pool / InnoDB log File Size / InnoDB Flush method
29
30. InnoDB Features
InnoDB Parallel Thread Count
● Path to parallel query in InnoDB
● Innodb_parallel_read_threads
● Make count() and Check tables faster
● Default 4 threads
30