Friday, August 1, 2008

Java Architecture tutorial

The key to an extensible Some rough guidelines:
More than 25 top-level classes will lead to problems Every use case should be able to be implemented using domain model methods J2EE supports extensibility because it is component-based and allows you to separate the roles of an app. JSPs can handle presentation. Servlets can handle routing, and EJBs can handle business logic. Performance Architectural performance is concerned with creating an architecture that forces end-to-end performance. The purpose of an architecture that ensures performance is to control expensive calls and to identify bottlenecks. If you know the boundaries of the various parts of the system, the technologies, and the capabilities of the technologies you can do a good job of controlling performance. You want to minimize the number of network calls your distributed app makes – make a few “large” calls that get a lot of data vs. lots of calls that get small amounts of data. Try to minimize process-to-process calls because they are expensive. Use resource pooling to reduce the number of expensive resources that need to be created like network connections, database connections, etc. Performance involves minimizing the response time for a given transaction load. While a number of factors relating to the application design can affect this, adding additional resources in the following two ways, or a combination of both, can be used to good effect: Vertical scaling, which involves creating additional application server processes on a single physical machine in order to provide multiple thread pools, each corresponding to the JVM associated with each application server process. Horizontal scaling, which

Java Architecture tutorial

Throughput, while related to performance, more precisely involves the creation of some number of
application server instances (clones) in order to increase the number of concurrent transactions that can be accommodated. As with performance, the application server instances can be added through vertical and/or horizontal scaling.
2 Availability Availability is about assuring that services are available to the required number of users for the required proportion of time. Availability requires that the topology provide some degree of process redundancy in order to eliminate single points of failure. While vertical scalability can provide this by creating multiple processes, the physical machine then becomes a single point of failure. For this reason a high-availability topology typically involves horizontal scaling across multiple machines. Hardware-based high availability: By providing both vertical and horizontal scalability the WebSphere Application Server runtime architecture eliminates a given application server process as a single point of failure. In fact the only single point of failure in the WebSphere runtime is the database server where the WebSphere administrative repository resides. It is on the database server that any hardware-based high availability (HA) solutions such as HACMP, Sun Cluster, or MC/ServiceGuard should be configured. Extensibility Ability to modify or add functionality without impacting the existing functionality.

Java Architecture tutorial

The more scalable manageability costs.
Maintainability How related is this to Flexibility? Flexibility is the ability to change the architecture to meet new requirements in a cost-efficient manner. A flexible system should be more maintainable in the face of changes to the environment and/or to the application itself. While maintainability is somewhat related to availability, there are specific issues that need to be considered when deploying a topology that is maintainable. In fact some maintainability factors are at cross purposes to availability. For instance, ease of maintainability would dictate that one minimize the number of application server instances in order to facilitate online software upgrades. Taken to the extreme, this would result in a single application server instance, which of course would not provide a high availability solution. In many cases it is also possible that a single application server instance would not provide the required. Flexibility improves: Availability, Reliability, Scalability Flexibility slightly decreases: Performance, Manageability Flexibility is achieved via code that can be distributed across servers with load balancing that prevents one system from being overburdened. The use of a multi-tier architecture also helps achieve flexibility. Reliability The ability to ensure the integrity and consistency of the application and all of its transactions. You increase reliability through the use of horizontal scalability, i.e., by adding more servers. This only works up to a certain point, though. When you increase reliability you increase availability.

Java Architecture tutorial

Common Architectures Scalability: Scalability is the ability to economically support the required quality of service as the load increases. Two types: Vertical and Horizontal Vertical: Achieved by adding capacity (memory, CPUs, etc.) to existing servers. Requires few to no changes to the architecture of a system. Increases: Capacity, Manageability Decreases: Reliability, Availability (single failure is more likely to lead to system failure) Vertical scalability is usually cheaper than horizontal scalability. J2EE supports vertical scaling because of automatic lifecycle management. Adding more capacity to a server allows it to manage more components (EJBs, etc.). Horizontal: Achieved by adding servers to the system. Increases the complexity of the system architecture. Increases: Reliability, Availability, Capacity, Performance (depends on load balancing), Flexibility Decreases: Manageability (more elements in the physical architecture) J2EE supports horizontal scaling because the container and server handle clustering and load balancing. Availability and reliability are obtained through scalability. Scalability affects capacity.