<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kerochan</title>
    <description>The latest articles on DEV Community by Kerochan (@kerochan).</description>
    <link>https://dev.to/kerochan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3909036%2Fb27221fd-3727-49f1-9215-459e8cd5223b.jpeg</url>
      <title>DEV Community: Kerochan</title>
      <link>https://dev.to/kerochan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kerochan"/>
    <language>en</language>
    <item>
      <title>Why I enforce booking concurrency at the database layer (and not in Node.js)</title>
      <dc:creator>Kerochan</dc:creator>
      <pubDate>Sun, 03 May 2026 19:07:52 +0000</pubDate>
      <link>https://dev.to/kerochan/why-i-enforce-booking-concurrency-at-the-database-layer-and-not-in-nodejs-38im</link>
      <guid>https://dev.to/kerochan/why-i-enforce-booking-concurrency-at-the-database-layer-and-not-in-nodejs-38im</guid>
      <description>&lt;p&gt;Booking systems have an inherent problem: race conditioning.&lt;/p&gt;

&lt;p&gt;A naive approach of fixing it is checking availability before inserting a booking, but it &lt;em&gt;still&lt;/em&gt; introduces a race condition where multiple requests can pass validation simultaneously.&lt;/p&gt;

&lt;p&gt;This is why we need a DB constraint solution, using a UNIQUE constraint on time_slot_id in the bookings table.&lt;/p&gt;

&lt;p&gt;Here is my project for proof: &lt;a href="https://kerochan.lol/blog/pern.html" rel="noopener noreferrer"&gt;https://kerochan.lol/blog/pern.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy60hcn9jml2sz1gt6lo5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy60hcn9jml2sz1gt6lo5.jpg" alt=" " width="540" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>backend</category>
      <category>webdev</category>
      <category>node</category>
    </item>
  </channel>
</rss>
