The concept of scalability revolves around the ability and the degree of ease to serve more customers with proportional expansion in product/service development/support resources within contextually acceptable performance parameters. In the software industry scalability equates to applications being able to accept and service increasing volumes of requests within acceptable response time, e.g., degree of parallelism. In web applications, web servers generally accept a certain pre-defined number of requests in parallel as do most other server applications, e.g., database servers, mail servers, etc.
At a macro level, accepting service requests in parallel is only the first step in making software scalable. The immediate next step is to be able to effectively and reasonably timely service the requests in parallel which, to a certain degree, pertains to parallelizing the state and behavior of the underlying data and libraries. Service libraries and databases may both be farmed to improve parallelism and hence scalability at the macro level. At this level, scalability may be generally enhanced by hardware and off the shelf server software that support farming. The reasonable performance criteria may be may be contended by general performance improvement techniques, e.g., caching, pooling, etc.
Supporting scalability at the macro level is not enough. Consider a farmed transactional database with no locks, it would substantially lower predictability rendering the platform unusable. This single factor mandates the concept of collision management, e.g., locking mechanism, which is applicable to both data and behavior. An interesting aspect of collision management is that it directly and negatively affects scalability. The more strict a locking mechanism, the less scalable the portion of the software impacted by the lock. An acceptable practice to support scaling while maintaining predictability is to implement optimistic locking while versioning records and raising exceptions in the case of a conflicting collision.
Here are some software development techniques to improve scalability:
- Offer multiple independent entry points. Web applications do that by default
- Farm out different tiers and services of an application
- Break up an application into smaller, independent if possible, services, so that they may be individually pooled and/or scaled up as necessary
- Consolidate services from different applications, e.g., consider a serviced customer object instead of each application requiring a customer class having it’s own version
- Implement object pooling
- Implement collision management. Lock shared resources, but granulize the lock; version database records, etc.
- Maintain rules and encapsulate behavior as close to the relevant data as possible, within a given context
- It’s not necessary for scalability but not having it may be detrimental to scalability
- Don’t write business logic on UI tier and don’t write UI logic in business tier. Avoid implementing business logic on the UI tier, because object hydration and processing rules that rely on those object can both be expensive and can easily be moved to a farmed Application server if they are on the middle-tier
- Attain scalability in the software development process
- Encapsulate common features of a set of objects into interfaces and distribute to the development team for implementation