---
title: "#locking articles | Hashnode"
description: "Explore 11 articles tagged #locking on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/locking"
---

Tag

# #locking

11 posts · 0 followers

[Yashika Vijayvargiya](https://hashnode.com/@railswithyashika) · [Jul 16](https://hashnode.com/posts/part-2-pessimistic-locking-in-rails-preventing-race-conditions-in-production/6a5891819c495ff02808a37a)

### [Part 2: Pessimistic Locking in Rails – Preventing Race Conditions in Production](https://railswithyashika.hashnode.dev/part-2-pessimistic-locking-in-rails-preventing-race-conditions-in-production?utm_source=hashnode&utm_medium=feed)

Introduction In the previous article, we learned why databases need locking and how PostgreSQL uses MVCC (Multi-Version Concurrency Control) to allow multiple transactions to work simultaneously. Howe

7 min read · [railswithyashika.hashnode.dev](https://railswithyashika.hashnode.dev/part-2-pessimistic-locking-in-rails-preventing-race-conditions-in-production?utm_source=hashnode&utm_medium=feed)

[Yashika Vijayvargiya](https://hashnode.com/@railswithyashika) · [Jul 13](https://hashnode.com/posts/understanding-database-locking-in-rails-postgresql-part-1/6a54c10885ce22766e87c425)

### [Understanding Database Locking in Rails & PostgreSQL (Part 1)](https://railswithyashika.hashnode.dev/understanding-database-locking-in-rails-postgresql-part-1?utm_source=hashnode&utm_medium=feed)

Learn database locking in Ruby on Rails from scratch. Understand optimistic locking, pessimistic locking, advisory locks, race conditions, deadlocks, transactions, and real production examples with ActiveRecord.

4 min read · [railswithyashika.hashnode.dev](https://railswithyashika.hashnode.dev/understanding-database-locking-in-rails-postgresql-part-1?utm_source=hashnode&utm_medium=feed)

[Gautam Patel](https://hashnode.com/@iamgautam03) · [Apr 8](https://hashnode.com/posts/concurrency-gone-wrong-fixing-lost-updates-with-database-locking/69d6445c707c1ce76827788c)

### [Concurrency Gone Wrong: Fixing Lost Updates with Database Locking](https://iamgautam.hashnode.dev/concurrency-gone-wrong-fixing-lost-updates-with-database-locking?utm_source=hashnode&utm_medium=feed)

Learn optimistic vs pessimistic locking in databases, prevent lost updates, and handle concurrency with real examples and use cases.

4 min read · [iamgautam.hashnode.dev](https://iamgautam.hashnode.dev/concurrency-gone-wrong-fixing-lost-updates-with-database-locking?utm_source=hashnode&utm_medium=feed)

[EKASPREET SINGH ATWAL](https://hashnode.com/@ekas-7) · [Mar 16](https://hashnode.com/posts/concurrency-without-the-chaos/69b85bd52ad6ae5184e89a90)

### [Concurrency Without the Chaos](https://ekas-7.hashnode.dev/concurrency-without-the-chaos?utm_source=hashnode&utm_medium=feed)

A Deep Dive into Optimistic Locking with Spring Boot

3 min read · [ekas-7.hashnode.dev](https://ekas-7.hashnode.dev/concurrency-without-the-chaos?utm_source=hashnode&utm_medium=feed)

[Surya Sathi](https://hashnode.com/@surya-sathi) · [Jan 5](https://hashnode.com/posts/state-in-a-system/695b5a9ccb23c712c0f51b43)

### [State in a System](https://systems-notes.hashnode.dev/state-in-a-system?utm_source=hashnode&utm_medium=feed)

Explained through a simple example of a login system

11 min read · [systems-notes.hashnode.dev](https://systems-notes.hashnode.dev/state-in-a-system?utm_source=hashnode&utm_medium=feed)

[Quan Nguyen](https://hashnode.com/@quannv) · [Jan 11, 2025](https://hashnode.com/posts/distributed-lock-with-redis/67824efb7a0902c25806a4e1)

### [Distributed Lock with Redis](https://ituniverse.hashnode.dev/distributed-lock-with-redis?utm_source=hashnode&utm_medium=feed)

Distributed Lock với Redis là một cơ chế khóa phân tán sử dụng Redis như một kho lưu trữ để điều phối và quản lý trạng thái khóa giữa nhiều client trong môi trường phân tán. Cơ chế này đảm bảo rằng tại một thời điểm, chỉ một client duy nhất có thể gi...

11 min read · [ituniverse.hashnode.dev](https://ituniverse.hashnode.dev/distributed-lock-with-redis?utm_source=hashnode&utm_medium=feed)

[Quan Nguyen](https://hashnode.com/@quannv) · [Jan 8, 2025](https://hashnode.com/posts/optimistic-and-pessimistic-locking-in-jpa/677df21e9782f011effc9afd)

### [Optimistic and Pessimistic Locking in JPA](https://ituniverse.hashnode.dev/optimistic-and-pessimistic-locking-in-jpa?utm_source=hashnode&utm_medium=feed)

💡 Khóa (locking) là một cơ chế cho phép thực hiện công việc song song với cùng một dữ liệu trong cơ sở dữ liệu. Khi có nhiều giao dịch (transaction) cố gắng truy cập cùng một dữ liệu cùng lúc, các khóa sẽ được sử dụng để đảm bảo rằng chỉ có mộ...

17 min read · [ituniverse.hashnode.dev](https://ituniverse.hashnode.dev/optimistic-and-pessimistic-locking-in-jpa?utm_source=hashnode&utm_medium=feed)

[Mahmoud Ashour](https://hashnode.com/@MahmoudAshour) · [Oct 8, 2024](https://hashnode.com/posts/locked-in-the-hidden-world-of-database-locks/670578f7a0099b6a7af757bb)

### [Locked In: The Hidden World of Database Locks](https://mahmoudashour.hashnode.dev/locked-in-the-hidden-world-of-database-locks?utm_source=hashnode&utm_medium=feed)

Learn about table-level, row-level, and next-key locks to prevent concurrency issues such as race conditions and phantom reads

7 min read · [mahmoudashour.hashnode.dev](https://mahmoudashour.hashnode.dev/locked-in-the-hidden-world-of-database-locks?utm_source=hashnode&utm_medium=feed)

[Jyotiprakash Mishra](https://hashnode.com/@jpmishra) · [Oct 7, 2024](https://hashnode.com/posts/a-primer-on-cache-coherence-protocols/6703e70f0bb9d75b2fcb7d35)

### [A Primer on Cache Coherence Protocols](https://blog.jyotiprakash.org/a-primer-on-cache-coherence-protocols?utm_source=hashnode&utm_medium=feed)

In modern multi-core processors, multiple cores operate in parallel, each with its own cache to store frequently accessed data. These caches are designed to reduce the time it takes for a processor to retrieve data from memory, speeding up overall pe...

26 min read · [blog.jyotiprakash.org](https://blog.jyotiprakash.org/a-primer-on-cache-coherence-protocols?utm_source=hashnode&utm_medium=feed)

[Samuel Sorial](https://hashnode.com/@samuel-sorial) · [Feb 8, 2023](https://hashnode.com/posts/pessimistic-concurrency-control-2pl/63e3a22b1e97db7c25ec3373)

### [Pessimistic Concurrency Control - 2PL](https://samuel-sorial.hashnode.dev/pessimistic-concurrency-control-2pl?utm_source=hashnode&utm_medium=feed)

Introduction In today's high-traffic database management systems (DBMS), leveraging the full potential of hardware is essential. With the advent of modern CPUs, the opportunity for parallel processing has increased significantly. However, executing m...

4 min read · [samuel-sorial.hashnode.dev](https://samuel-sorial.hashnode.dev/pessimistic-concurrency-control-2pl?utm_source=hashnode&utm_medium=feed)
