Summary
In this chapter, we learned how the InnoDB storage engine guarantees the consistency of data in a concurrent environment. First, we discussed how locks and snapshots work. This low-level understanding of InnoDB mechanisms is necessary to understand how InnoDB transactions work. We discussed the isolation levels and how each isolation level uses locks and snapshots to guarantee a certain level of protection. We discussed how to deal with deadlocks that are normal on a busy database, but a DBA should avoid them becoming a problem. We also discussed metadata locks, which protect transactions from changes in the structures of the tables.
In the final section, we discussed how to avoid ALTER TABLE locking other transactions for a long period ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access