File locking vs Row Level Locking

dwivedialind

dwivedialind

Posted on June 17, 2024

File locking vs Row Level Locking

This is a submission for DEV Computer Science Challenge v24.06.12: One Byte Explainer.

Explainer

Have you ever wondered how can multiple users perform DML operations on same table at the same time? Because of row level locking in RDBMS. In RDBMS every row is a file instead of table as a file.
Rows inside a table is scattered (fragmented) all over the DB server HD, to speed up INSERT statement.

Additional Context

Consider a multi-user environment, if multiple users are inserting rows simultaneously into the same table, and if MySQL were to store the rows sequentially then it would be really slow.
That's why when you insert a row into the table, wherever it finds the free space it will store the row there.

💖 💪 🙅 🚩
dwivedialind
dwivedialind

Posted on June 17, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Dev challenge - Algorithms
devchallenge Dev challenge - Algorithms

June 24, 2024

One Byte Explainer: Large Language Models
Data Compression: Under 256 characters
devchallenge Data Compression: Under 256 characters

June 24, 2024