Design a scalable, fault-tolerant system that allows citizens to search, view availability, and book vaccination slots at healthcare centers. The system should support millions of concurrent users, ensure fairness in slot allocation, and prevent double bookings.
Functional Requirements (FR)
User Registration & Authentication
•Citizens can register using phone/email and verify via OTP.
•Maintain basic profile (name, age, ID proof, location, vaccination status).
Vaccination Center Management
•Centers can register and update details (location, vaccines offered, capacity).
•Centers can update availability per day/time slot.
Slot Search & Discovery
•Citizens can search for available slots by pincode, district, vaccine type, or date.
•Show real-time slot availability.
Slot Booking
•Users can book a slot for themselves (or dependents).
•Ensure atomic booking (avoid race conditions and overbooking).
Notifications & Reminders
•Send confirmation SMS/email.
•Remind users before their appointment.
Vaccination Status Tracking
•Mark attendance after vaccination.
•Generate vaccination certificate.
Cancellation & Rescheduling
•Users can cancel or reschedule before slot start time.
•Update slot availability accordingly.
Non-Functional Requirements (NFR)
•Scalability: Handle millions of concurrent users during peak demand (e.g., 9 AM slot releases).
•High Availability: System should be available 24/7 with minimal downtime.
•Consistency: Slot booking must be atomic (no double booking).
•Low Latency: Search results should appear within a second.
•Security: Protect personal health information (PII).
•Fairness: Prevent bots and ensure equal access (rate limiting, captcha).
Core Components
API Gateway & Authentication Service
•Secure user authentication and rate limiting.
User Management Service
•Handles profiles, vaccination status, certificates.
Center Management Service
•Onboards vaccination centers, manages slots, and capacity.
Slot Search & Availability Service
•Indexed and cached availability search by location and vaccine type.
Slot Booking Service
•Manages atomic booking transactions with concurrency control.
•Uses distributed locks or optimistic concurrency.
Notification Service
•Sends SMS, email, or app reminders.
Certificate Service
•Generates vaccination certificates with digital signatures/QR codes.
Analytics & Reporting Service
•Monitors vaccination rates, slot utilization, demand trends.
Data Flow (High-Level)
1.User registers → Profile stored in User DB.
2.Search slots → Query Slot Availability DB (with cache for speed).
3.Book slot → API → Booking Service → Transaction (lock + update availability).
4.Confirm booking → Notification Service sends SMS/email.
5.Vaccination done → Center updates status → Certificate Service issues certificate.
Key Design Considerations
Concurrency Control:
•Use distributed locks (e.g., Redis Redlock) or DB row-level locking.
•Optimistic locking with retry on failure.
Caching Strategy:
•Use CDN/Redis to serve availability search results.
•Invalidate cache on booking updates.
Fairness & Bot Protection:
•Use CAPTCHAs, request throttling, and rate limiting.
•Scalability: 1. Horizontal scaling of Slot Booking Service and Search Service. 2. Partition slots by region/date.
•Data Storage:1. Relational DB for transactions (bookings, users, centers). 2. NoSQL or search indexes (Elasticsearch) for availability lookup.
✅ This HLD problem statement gives a clear scope to design a Vaccination Slot Booking System that is scalable, secure, and fair, while handling real-time availability and high concurrency.