<?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: ui h</title>
    <description>The latest articles on DEV Community by ui h (@ui_h_7ebff474ce051167765d).</description>
    <link>https://dev.to/ui_h_7ebff474ce051167765d</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4260708%2F3bfb27ec-7fe6-419a-b6d7-f3731a48a557.png</url>
      <title>DEV Community: ui h</title>
      <link>https://dev.to/ui_h_7ebff474ce051167765d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ui_h_7ebff474ce051167765d"/>
    <language>en</language>
    <item>
      <title>How We Prevent Double Bookings in a Room Booking App</title>
      <dc:creator>ui h</dc:creator>
      <pubDate>Mon, 23 Nov 2026 13:32:54 +0000</pubDate>
      <link>https://dev.to/ui_h_7ebff474ce051167765d/how-we-prevent-double-bookings-in-a-room-booking-app-43ff</link>
      <guid>https://dev.to/ui_h_7ebff474ce051167765d/how-we-prevent-double-bookings-in-a-room-booking-app-43ff</guid>
      <description>&lt;p&gt;Two people request the same room. One wants it from 10:00 to 11:00, and the other wants it from 10:30 to 11:30. A calendar can show both requests as pending. The tricky part comes when two people try to confirm them at the same time.&lt;/p&gt;

&lt;p&gt;In RoomBooking, pending requests leave the calendar open. A confirmed booking or a closure creates an occupancy record for that room. The database checks for conflicts when it inserts the record, so two requests that looked available on screen cannot both reserve overlapping time.&lt;/p&gt;

&lt;p&gt;The overlap rule is &lt;code&gt;existing_start &amp;lt; requested_end AND existing_end &amp;gt; requested_start&lt;/code&gt;. The strict comparisons matter. A meeting that ends at 11:00 can be followed by another starting at 11:00. A request starting at 10:59 conflicts with the first meeting. The check runs per room, so a booking in Room A leaves Room B available.&lt;/p&gt;

&lt;p&gt;Three examples are worth testing side by side:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Existing booking&lt;/th&gt;
&lt;th&gt;New request&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Room A, 10:00–11:00&lt;/td&gt;
&lt;td&gt;Room A, 10:30–11:30&lt;/td&gt;
&lt;td&gt;Conflict&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Room A, 10:00–11:00&lt;/td&gt;
&lt;td&gt;Room A, 11:00–12:00&lt;/td&gt;
&lt;td&gt;Allowed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Room A, 10:00–11:00&lt;/td&gt;
&lt;td&gt;Room B, 10:30–11:30&lt;/td&gt;
&lt;td&gt;Allowed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If the venue needs 15 minutes between groups to reset the room, include that time in the reserved interval or add a closure. The same overlap check then protects setup and cleanup time.&lt;/p&gt;

&lt;p&gt;You can see the visitor-facing booking flow in the &lt;a href="https://roombooking.app/demo.html" rel="noopener noreferrer"&gt;RoomBooking demo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>architecture</category>
      <category>database</category>
    </item>
  </channel>
</rss>
