While every application has unique growth aspects, there are many common techniques that you'll find necessary as an application using a PostgreSQL database becomes used more heavily. The chapters of this book each focus on one of the common aspects of this process. The general path that database servers follow includes the following steps:
- Select hardware to run the server on. Ideally, you'll test that hardware to make sure it performs as expected too.
- Set up all the parts of database disk layout: RAID level, filesystem, and possibly table/index layout on disk.
- Optimize the server configuration.
- Monitor server performance and how well queries are executing.
- Improve queries to execute more efficiently, or add indexes to help accelerate them.
- As it gets more difficult to just tune the server to do more work, instead reduce the amount it has to worry about by introducing connection pooling and caching.
- Partition larger tables into sections. Eventually, really large ones may need to be split so that they're written to multiple servers simultaneously.
This process is by no means linear. You can expect to make multiple passes over optimizing the server parameters. It may be the case that you decide to buy newer hardware first, rather than launching into replication or partitioning work that requires application redesign work. Some designs might integrate caching into the design from the very beginning. The important thing is to be aware of the various options available and to collect enough data about what limits the system is reaching to decide which of the potential changes is most likely to help.