The database is the hardest part to scale because it holds the state every server depends on. The usual path is indexes and query fixes, a bigger machine, caching, read replicas for read-heavy traffic, and finally sharding to split data across databases. Use replicas when reads dominate, and sharding only when writes or data size outgrow one machine. Do not jump to sharding early, since it makes joins and cross-shard queries hard for good.