---
title: "Discussion on \"Why SELECT Before INSERT Causes Duplicate Records\" | Hashnode"
description: "Discussion on \"Why SELECT Before INSERT Causes Duplicate Records\". Checking records before an insert causes race conditions under load. Learn why row locks fail and how unique constraints reliably prevent duplicate records."
url: "https://hashnode.com/posts/why-select-before-insert-causes-duplicates/6afafa364a946c51216bc841"
---

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

Discussion

# [Why SELECT Before INSERT Causes Duplicate Records](https://doogal.dev/why-select-before-insert-causes-duplicates?utm_source=hashnode&utm_medium=feed)

Checking records before an insert causes race conditions under load. Learn why row locks fail and how unique constraints reliably prevent duplicate records.

3h ago · 4 min read · doogal.dev  
Read the article

-   [#databases](https://hashnode.com/tag/databases)
-   [#sql](https://hashnode.com/tag/sql)
-   [#backend](https://hashnode.com/tag/backend)
-   [#softwareengineering](https://hashnode.com/tag/softwareengineering)

## Written by

[Doogal Simpson](https://hashnode.com/@doogal)

@doogal

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

"hey doogal, what is .... ?"

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
