SS

SUMIT SHARMA

Portfolio0%
SS
SUMIT SHARMA
Back to Projects Archive (12)
Systems / DSACONCURRENCY

SmartSlot

Appointment Booking Engine with Database Concurrency Control

SmartSlot preview
Highlight 01PostgreSQL Row-Level Locks
Highlight 02ACID Isolation
Highlight 03Real-Time WebSockets

Project Overview & Problem Statement

A concurrency-focused booking engine built to serialize high-volume reservation requests and eliminate race conditions at the database tier using PostgreSQL pessimistic row locking.

The Engineering Problem:When multiple users simultaneously attempt to reserve the same time slot, conventional application-tier checks produce race conditions and accidental double-bookings.

System Architecture & Data Flow

Engineered with an ASP.NET Core 8 backend paired with a PostgreSQL relational layer. Booking requests execute inside strict ACID transactions wrapped in 'SELECT FOR UPDATE' pessimistic locks, ensuring that simultaneous claims on the same slot are strictly serialized before WebSocket status changes broadcast to all connected clients.

Architectural Solution:Shifted lock acquisition directly into the database tier using PostgreSQL 'SELECT FOR UPDATE' within explicit transactions, combined with real-time WebSocket state broadcasting.

Key Engineering Challenges

Handling sudden bursts of concurrent clicks on popular time slots without creating dirty reads, orphaned lock deadlocks, or UI state mismatches across different browser tabs.

Implementation Decisions:Applied explicit transaction isolation levels in PostgreSQL, implemented idempotent booking confirmation tokens, and linked ASP.NET Core Hubs to broadcast slot status mutations via bidirectional WebSockets.

Feature Implementation & Capabilities

Pessimistic row-level locking (SELECT FOR UPDATE) to serialize contested slots
Strict ACID transaction boundaries preventing race condition over-bookings
Bidirectional WebSocket state updates pushed instantly to active clients
ASP.NET Core clean architecture with structured domain and repository separation

Technology Stack

ASP.NET Core 8ReactTypeScriptPostgreSQLWebSockets
Next Project

NexaPilot

Autonomous AI Agent Workflow Co-Pilot with Dynamic Tool Calling