r/mysql • u/Accurate_Gift_3929 • Apr 12 '25
schema-design MySql multi-tenant application max database count?
I'm rebuilding an existing application with 150k+ users and I'm using the multi-tenancy model for the database. I'm running into an issue where table_definition_cache limit is getting hit. Is it feasible to just increase this (which is normally 2-3k I think) to an insanely high level? Considering each user will have their own database, how will this affect performance?
2
Upvotes
View all comments
Show parent comment
1
u/Wiikend Apr 14 '25
We use multitenancy in MariaDB for 1500 client databases with 300+ tables each and user counts ranging from 1 to several hundred. They are automatically backed up every night by a cronjob. Schema changes and provisioning new databases to new clients are handled by the exact same mechanism - running DB update scripts, and keeping track in a central DB that manages which databases are on which DB version (i.e. what DB update scripts have been run on each DB). It's very doable in our case, but I have never tried in OPs scale.