Engine-specific internals for the two databases that dominate backend interviews: InnoDB storage and locking, replication and online DDL, Postgres MVCC, JSONB, vacuum, extensions and tuning.
Preview — first 3 of 150 cards
InnoDB vs MyISAM?
InnoDB: ACID transactions, row-level locks, foreign keys, MVCC, crash recovery, clustered index. MyISAM: table-level locks, no transactions/FK, faster full-text historically (legacy). Default and recommended is InnoDB.
SHOW ENGINES;
What is a clustered index in InnoDB?
The primary key is the clustered index: rows are kept in PK order within the B+tree leaf pages (not in physical order on disk). Secondary indexes store the PK as the row pointer. So PK lookups are fastest; choose a short, stable, monotonic PK.
CREATE TABLE t (id INT PRIMARY KEY, v VARCHAR(10)) ENGINE=InnoDB;
What is the InnoDB buffer pool?
Main memory cache for data pages, index pages, and other InnoDB structures. Size to ~70-80% of RAM (innodb_buffer_pool_size). The hit ratio is 1 - Innodb_buffer_pool_reads / Innodb_buffer_pool_read_requests; a low ratio means the working set needs more memory or better indexing.
SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_read%';
SELECT 1 - (SELECT VARIABLE_VALUE FROM performance_schema.global_status
WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads')
/ (SELECT VARIABLE_VALUE FROM performance_schema.global_status
WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests') AS hit_ratio;
147 more cards in this sheet
Unlock the Backend, Databases & AI bundle — ₹399
One-time payment. Unlocks this sheet and 14 other sheets in the bundle, plus a typeset PDF of each.
Unlock the bundle
See all bundles
Or get all 76 sheets for ₹999 — one payment, every future sheet included.