\I believe FlyWheel uses MySQL (vs say MariaDB). MySQL supports multiple table formats, of which InnoDB is one / the best performant option for most relational data.
Which table format is used is dependent on
how the table is created. If your DB has any MyISAM tables, you’ll want to
convert those to InnoDB. This is step 0 and should be done on any WP install.
Proper indexing is step 1. See this
article for more info.
Indexes are most efficient on numbers and timestamps (not strings), so you’ll want to make sure the date is a true DATE field (not a char or varchar). IDs are simple to index as they are just numbers.
Don’t forget about
indexes on core WP tables too (this may be in place already, but do verify it as it’s a huge boost as that table gets queried on basically every request).
Increasing resources (i.e. a dedicated DB instance) is generally step 2-?. Most web databases never scale past this point.
Adding some caching (e.g. Redis) can cache frequently accessed data and offload frequent queries from the MySQL server — these may not be your custom queries, but fewer queries for, say, options means more for your custom ones.
Adding a read replica can be considered — this is a second server that mirrors the first and you only read from it. This also gives you some redundancy as it can fail over to become the main server and a new read replica spun up.
When all that starts to have performance issues… then you can consider partitioning, but that’s unlikely to become an issue anytime soon. Partitioning by user ID (since that is always known) would be a good idea — as you can easily partition into 10 tables based on the last digit of the user id (which should fairly even distribute records cross tables). HyperDB is a tool that can assist with this. If you need more than 10 well indexed tables and a read replica you have much bigger problems...
Here’s an
article that basically says this all again ;-)
---
Oh, and of course there’s the option to use a different DB host altogether (e.g.
PlanetScale ) or different DB engine (e.g.
DynamoDB which can be
free) and query it via PHP SDK or an API … and let someone else worry about scaling it.