Grokking Operating Systems and Networking for Backend Engineers
0% completed
Why Databases Write a Log First
On a cloud virtual machine, a small program saved an order in two ways. The first way updated two 8 KB pages in the places where they live in the data file, which took 1.03 ms per order. The second way appended one 256-byte record to the end of a log, which took 0.23 ms.
The log was more than four times faster, and it was also the safer of the two. After a crash, the log can rebuild every order that was confirmed, while the in-place version can leave a half-finished change behind
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%