An INSERT, UPDATE, or DELETE may look like a small operation from the outside. You add a row, change some values, or remove something no longer needed. Inside the database, however, such a request can involve memory, transaction logs, indexes, older row versions, and background cleanup. Other machines may also be involved.
It is the responsibility of the database to make these pieces work together while letting you run concurrent queries and recovering from crashes. This is why a committed row can still be waiting for its data page to reach disk, and a deleted row may continue to take up storage space long after the delete finishes.
This article examines the life of a row with respect to these operations. It covers what a row is, how insert operations work, and the role of the write-ahead log (WAL). It also explains how update and delete operations behave, along with vacuum and compaction processes that reclaim space.
Finally, it looks at how replication and backup work, and how database commits generate additional work across the system. Together, these mechanisms explain why a simple change to a row involves far more machinery than it first appears to, and why the database must carefully coordinate memory, disk, and network activity to keep data consistent and durable.
Source: ByteByteGo · Summarized by HeadlinesBriefing