What is sequential write and what is random write

I want to know what exactly is a sequential write and what is a random write in a definition. I'll be more helpful, for example. I tried googling the result. But not many google explanations. Thanks to

+3


source to share


1 answer


When you write two blocks that are next to each other on disk, you have a sequential write.

When you write two blocks far apart on disk, you have random writes.



With a spinning platter, the second pattern is much slower (can be magnitudes) because the head has to be moved to a new position.

Database technology (or perhaps not as important with SSDs) is largely about optimizing disk access patterns. So what you see often is, for example, trading direct updates to data at its location on disk (random access) versus writing to the transaction log (sequential access). This makes it difficult and time-consuming to recover to the actual value, but allows for much faster commits (and you have checkpoints to eventually consolidate the logs that accumulate).

+2


source







All Articles