The binlog cache: memory, temp files and seven states
The previous post looked at the on-disk file. This one looks at what happens before: a transaction’s events go into the binlog cache and are written to the binlog as a unit at commit. The problem it solves A binlog transaction must be all-or-nothing: either every event lands in the file or none does. The cache is that staging area — small transactions stay in memory, large ones spill to a temporary file, and commit writes the whole thing at once. ...