Image for Lock Granularity

Lock Granularity

Lock granularity refers to the level of detail at which a database system controls access to data. It determines how much data is locked during a transaction—ranging from a broad scope (like a whole table) to a narrow scope (such as a single row). Finer granularity (smaller units) allows for more concurrent access, increasing efficiency, but may be more complex to manage. Coarser granularity (larger units) simplifies locking but can reduce simultaneous access, potentially causing delays. Balancing lock granularity helps optimize database performance and data integrity.