---
title: "Discussion on \"Part 2: Pessimistic Locking in Rails – Preventing Race Conditions in Production\" | Hashnode"
description: "Discussion on \"Part 2: Pessimistic Locking in Rails – Preventing Race Conditions in Production\". Introduction\nIn 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.\nHowe"
url: "https://hashnode.com/posts/part-2-pessimistic-locking-in-rails-preventing-race-conditions-in-production/6a5891819c495ff02808a37a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [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

Jul 16 · 7 min read · railswithyashika.hashnode.dev  
Read the article

-   [#howto](https://hashnode.com/tag/howto)
-   [#what](https://hashnode.com/tag/what)
-   [#locking](https://hashnode.com/tag/locking)
-   [#pessimistic-locking](https://hashnode.com/tag/pessimistic-locking)
-   [#optimistic-locking](https://hashnode.com/tag/optimistic-locking)
-   [#ruby](https://hashnode.com/tag/ruby)
-   [#ruby-on-rails](https://hashnode.com/tag/ruby-on-rails)

## Written by

[Yashika Vijayvargiya](https://hashnode.com/@railswithyashika)

@railswithyashika · Pune, India

  
[View profile](https://hashnode.com/@railswithyashika)

Senior Ruby on Rails Engineer | React | System Design | Sharing Real-World Engineering Lessons

Senior Ruby on Rails Engineer sharing practical insights on Rails, React, system design, performance optimization,. My goal is to simplify complex concepts through real-world examples and hands-on experiences.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
