# Dentalia — Appointment Scheduling for 65 Clinics That Finally Has Zero Double Bookings

> Dentalia runs 65+ dental clinics across Mexico. Their old scheduling system produced double bookings when two patients tried to book the same doctor slot simultaneously. Database-level pessimistic locking eliminated the problem. Zero double bookings since launch — across every clinic, every doctor, every time.

## Project context

- Client: Dentalia
- Industry: Healthcare / Dental
- Year: 2023

## Challenge

Race conditions in concurrent booking caused double bookings regularly during peak hours. Two patients would book the same slot simultaneously, both receive confirmations, and both show up at the clinic. Besides the patient experience damage, each incident required manual rescheduling and a clinic team member's time. The schema also didn't scale well to 65+ clinics — availability queries were joining massive tables.

## Solution

Schema redesign: availability computed from schedule templates + exception overrides (not from a slot-per-row table). Pessimistic locking on the booking transaction: SELECT FOR UPDATE on slot acquisition, held for the full duration. Template-based availability queries run faster and scale to any number of clinics. Docker deployment for consistency across all environments.

## Services

- Web Development

## Published results

- 0 Double-booking incidents (since launch)
- 65+ Clinics on one platform (single codebase)
- fast Availability query performance (template-based schema)
- eliminated Manual rescheduling incidents (was weekly occurrence)

## Benefits

- Pessimistic DB locking — race conditions are impossible
- 65+ clinics and hundreds of doctors on one platform
- Template-based availability — clean schema at scale
- Docker — consistent from dev to production

## Source and contact

- Canonical project page: https://qualityx.co/en/portfolio/dentalia-scheduling-platform
- Discuss a related project on WhatsApp: https://wa.me/905392376734
