Month-end reports in dental practice software
Your task
Your company sells software to 3,000 dental practices. Receptionists use it to book appointments, check patients in and take payments. All practices share one Postgres database. At the morning peak, front desk screens make about 600 queries a second, and each takes a few milliseconds.
On the first working day of each month, practice managers run month-end reports: income, unpaid bills and patients due a check-up. A report reads up to 2 years of one practice's records and takes 20 to 60 seconds. About 2,000 reports run between 08:00 and 10:00 that day. Last month, front desk screens took 6 seconds to load all morning.
A report may show data up to 5 minutes old. Front desk screens must show each change at once, such as a payment taken a moment ago.
Where do the reports run, and what keeps the front desk fast on the first working day?
It covers
- Month end reports
- Front desk
- Shared database