---
title: "Discussion on \"Two Users Bought the Last Item. Your Database Allowed It.\" | Hashnode"
description: "Discussion on \"Two Users Bought the Last Item. Your Database Allowed It.\". I raced 50 buyers for one item in Postgres and MySQL. The usual code sold it 48 times, and MySQL's default isolation level didn't stop it"
url: "https://hashnode.com/posts/two-users-bought-the-last-item-database-race-condition/6b0d64a4763c57f4b120439b"
---

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

Discussion

# [Two Users Bought the Last Item. Your Database Allowed It.](https://rimazsaththar.hashnode.dev/two-users-bought-the-last-item-database-race-condition?utm_source=hashnode&utm_medium=feed)

I raced 50 buyers for one item in Postgres and MySQL. The usual code sold it 48 times, and MySQL's default isolation level didn't stop it

1d ago · 13 min read · rimazsaththar.hashnode.dev  
Read the article

-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#mysql](https://hashnode.com/tag/mysql)
-   [#databases](https://hashnode.com/tag/databases)
-   [#go](https://hashnode.com/tag/go)
-   [#backend-development](https://hashnode.com/tag/backend-development)

## Written by

[Rimaz Saththar](https://hashnode.com/@rimazsaththar)

@rimazsaththar · Sri Lanka

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

Startup Co-Founder | Backend & Distributed Systems | Open-source contributor (Jaeger, OpenSSL, Sorbet)

Computer Science undergraduate and startup co-founder. I build backend and distributed systems in Java/Spring Boot, Go and Python, and contribute to Open-source software

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
