Scalability is a desirable property of a system, a network, or a process, which indicates its ability to either handle growing amounts of work in a graceful manner or to be readily enlarged. (Wikipedia)
In order to achieve good scalability an application has to be designed with scalability in mind. Every application requires its own level of scalability and performance, and this should ideally be addressed during functional and technical design specification.
During this design phase there are a number of things to consider, – especially performance. Higher performance generally means more requests per second and less intensive operations; good caching is vital (think Smarty, ZendPlatform, memcached etc)
Where possible try to build software that is ‘loosely coupled’, – that way if it is required in the future it will be possible to serve different components from different servers. Often application bottlenecks occur in a small part of the application so with loosely coupled software it is easier to relocate that component to dedicated hardware.
Infrastructure architecture must support the application architecture. PHP web server clusters require a solution for sharing sessions between servers. These servers can have their own local cache or they could use a shared caching mechanism. Building on a SOA architecture can help spread load across multiple servers.
Designing a database includes thinking about scalability and performance. While replication is a good way to spread read queries across multiple servers it doesn’t help when you have lots of writes. Data partitioning is a valuable consideration; for example each group of database servers can serve part of your database. This allows you to spread writes to different groups of servers, however obviously adds to the complexity of partitioning and fetching data.
During the development process ensure that you develop with a database that reflects the real thing. Try to populate your database with content before you start developing as a database with just a couple of rows behaves different to one with millions of rows.