How do you know when you need to scale your database? There are many inputs to help you make this decision.
One way to scale is as a reaction to problems with your existing architecture. If you are developing an application and notice that the database is becoming a bottleneck on page load times and app usability, that's probably a good sign that scaling needs to occur. Of course, you may also reach a point where it isn't just the internal developers noticing problems but where you get feedback from your users complaining about application performance and load times. Ideally, you'd never reach this point, but if you do, scaling is a must to keep your users happy.
You should plan ahead for scaling rather than reacting to circumstances and constantly putting out fires. You can take several steps to monitor your database to prepare to upgrade your scale.
It's critical to monitor the usage of your hardware. For example, say you have a database-backed web app that you've been running for two years and have a single-primary db server with one terabyte of storage, currently half full at 500 gigabytes. Doing simple math, you could go another two years before you hit the storage limits, but storage growth is only sometimes linear. You may have seen a recent uptick in users and expect exponential growth in your customer base in the coming months. In this case, you may plot out that you'll reach one terabyte in only a few months rather than two years. You should plan to scale to meet this demand before it becomes a show-stopping problem.
You should also monitor other resource usage, such as CPU capacity. You probably want to upgrade before your server has 100% CPU utilization, so pick a lower threshold.
Some types of applications lead to a more evenly-spread workload. For example, if you are running a chat or social networking website. Of course, there will be times of day when usage is higher and lower, but there's generally a consistent hum of messages and posts being posted and liked. However, other more event-driven applications may experience considerable changes in demand throughout a given day, week, or month. Keeping a watchful eye on the CPU demands of your application is essential. When you notice that you are consistently going above some threshold, then that's a sign you should upgrade to meet demand.
Having a good monitoring and analytics platform can help make these decisions. If you use PlanetScale, you can access PlanetScale Insights, which gives you great monitoring capabilities into query performance, anomaly occurrence, latency, intelligent schema recommendations, and more. An excellent platform to display analytics can make all the difference in helping you make good scaling choices.