Timesheet data for a growing time tracking app
Your task
Your company sells a time tracking app to 25,000 businesses, from 5-person agencies to a firm with 12,000 staff. Staff log the hours they spend on each project. Managers approve timesheets each week and run reports for invoices and payroll. Each business signs in at its own address, such as acme.yourapp.com.
Everything sits in one Postgres database of 6 TB. Every screen and report in the app shows one business's data. Your own reports across all businesses use a nightly copy in a data warehouse.
At the Friday afternoon peak, the database runs at 80% CPU on the largest server your cloud offers. Most of that load is writes, as staff save and submit their week. The number of businesses grows by 40% a year. The largest business holds 2% of the data and makes 2% of the load. Any one business may be read-only for up to 1 hour on one night.
Where does each business's data live from now on, and how does a request find it?
It covers
- Time entries
- Business accounts
- Database growth