Skip to main content
InterviewHubPRO
Section Overview
Q32

Question 32 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

64%
MySQL & InnoDB (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

What is `innodb_flush_log_at_trx_commit` and how does it balance Durability vs Performance?

senior LevelFormsPerformanceMySQL

In Simple Words: Controls how often the Redo Log is fsynced to disk:

  • 1 (Default - Full ACID): Fsyncs the redo log to physical disk on every transaction commit. Safest; zero data loss on power failure.
  • 0: Log buffer is written and fsynced to disk once per second. High speed; crashes can lose the last 1 second of transactions.
  • 2: Writes to OS file cache on every commit, but fsyncs to physical disk once per second. Withstands MySQL daemon crashes without data loss, but loses 1 second on OS kernel panic.