Architectural considerations
An architecture can be assessed using the following qualitive measures:
- Scalability
- Maintainability
- Reliability
- Availability
- Extensibility
- Performance
- Manageability
- Security
1. Scalability
Scalability is the ability to economically support the required
quality of service as the load increases. There are two types
of scaling:
- Vertical
- Horizontal
1.1. Vertical Scaling
- 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.).
1.2. Horizontal Scaling
- 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 scaling. Scalability
affects capacity. The more scalable the system is the more capacity
it can support. This must be traded-off against the complexity &
manageability costs.
2. Maintainability
- Maintanibility is the ability to correct flaws in the existing
fucntionality without impacting any other components
- 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.
- Improves: Availability, Reliability, Scalability
- Decreases: Performance, Manageability
3. Reliability
- Reliability is 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.
4. Availability
- Availability is about assuring that services are available
to the required number of users for the required proportion of
time.
5. Extensibility
- The ability to modify or add functionality without impacting
the existing functionality.
- The key to an extensible design is to make an effective OO design.
Extensibility pays the most towards the font end of a system.
- 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.
6. 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.
7. Manageability
- Manageability refers to the ability to manage a system to ensure
the health of the system.
- A single tier or monolithic app would be more manageable from
a management perspective than a multi-tier system but this must
be weighed against the possibility of a change rippling through
a monolithic app.
- A simple architecture may not be as flexible or available as
a more complex system but the amount of effort required to keep
the system up & functioning will be less.
- A component-based architecture like J2EE offsets some of the
manageability problems caused by a multi-tier system.
8. Security
- Security ensures that info is neither modified nor disclosed
except in accordance with the security policy.
- Tradeoffs: personal privacy, ease of use, and expense.
- A highly secure system is:
- More costly
- Harder to define and develop
- Requires more watchdog activities
Considering Tiers
There are a number of options for distributing an applications
workload, typically across different machines.
- 1-tier (monolithic) architectures
- 2-tier architectures
- 3-tier or more (n-tier) architectures.
1. One Tier
Standalone applications which store data, apply business logic and
display results. Not scalable.
2. Two Tier
Typically used by older applications with a client on one machine
using a network protocol (TCP/IP) to connect to a remote database
with the business logic separated across both tiers (fat client
and stored procedures)
3. Three Tier Model
The above architecture describes a simple J2EE architecture surporting
clear distinction of work between the infrastructure providers (J2EE
container, peristence services, security services, etc.) and between
businesss providers (front-end, business logic and data).
J2EE multitiered applications are generally considered to be three-tiered
applications because they are distributed over three different locations:
client machines, the J2EE server machine, and the database or legacy
machines at the back end.
3.1 Client Tier
The client tier supports a variety of client types both inside
and outside of the corporate firewall.
- Web Clients
- A Web client consists of two parts: dynamic Web pages containing
various types of markup language (HTML, XML, and so on), which
are generated by Web components running in the Web tier, and a
Web browser, which renders the pages received from the server.
A Web client is sometimes called a thin client. Thin clients usually
do not do things like query databases, execute complex business
rules, or connect to legacy applications. When you use a thin
client, heavyweight operations like these are off-loaded to enterprise
beans executing on the J2EE server where they can leverage the
security, speed, services, and reliability of J2EE server-side
technologies.
- Applets
- A Web page received from the Web tier can include an embedded
applet. An applet is a small client application written in the
Java programming language that executes in the Java virtual machine
installed in the Web browser. However, client systems will likely
need the Java Plug-in and possibly a security policy file in order
for the applet to successfully execute in the Web browser.
Web components are the preferred API for creating a Web client
program because no plug-ins or security policy files are needed
on the client systems. Also, Web components enable cleaner and
more modular application design because they provide a way to
separate applications programming from Web page design. Personnel
involved in Web page design thus do not need to understand Java
programming language syntax to do their jobs.
- Application Clients
- A J2EE application client runs on a client machine and provides
a way for users to handle tasks that require a richer user interface
than can be provided by a markup language. It typically has a
graphical user interface (GUI) created from Swing or Abstract
Window Toolkit (AWT) APIs, but a command-line interface is certainly
possible.
Application clients directly access enterprise beans running in
the business tier. However, if application requirements warrant
it, a J2EE application client can open an HTTP connection to establish
communication with a servlet running in the Web tier. [taken from
Sun
J2EE tutorial]
3.2. Middle Tier
The Middle tier hosts application specific business logic and system
level services such as transaction management, concurrency control
and security. This separation promotes:
- Scalability
- Accessiblity
- Security
3.3. Enterprise Information System (EIS) Tier
The existence of legacy data often means there is no choice on
this tier. Java applications/servlets can interface to a RDBMS (Relational
DataBase Management System) using JDBC (it is possible to obtain
JDBC drivers for almost all RDBMSs from either the database vendor
or from a third-party vendors if the database vendor cannot supply
one). Non-Java programs (e.g. CGI programs) access RDBMSs using
ODBC.
Object-oriented applications sitting on the third tier can be accessed
using CORBA (read about Java IDL), and non object-oriented applications
sitting on the third tier can be accessed using sockets (if a published
interface exists).
Obviously, a Java application sitting on the third tier can be
accessed from the second tier using RMI if the second tier app is
Java.
B2B
B2B is Business to Business commece. This is different to B2C (business
to Consumer). [need to expand]
B2B Architectures
- Spoke
- Exchange
- Hub
1. Spoke
Subscribing to a large parterns extranet as a spoke is cheap and quick.
However it is difficult to assemble the big picture from other spokes.
2. Exchange
Subscribing to a central exchange that combinues data from all partners
is easy as the exchange takes care of IT issues. However the data
is not customised and may be limited
3. Hub
Building a hub is a major undertaking, but can provide significant
business benefit. An Application Service Provider (ASP) may assist
through provision of configurable software.
Techniques
Typically XML over HTTP or HTTPS to a web container and then EJB
container. Finally interacting with EIS tier.
Microsoft Message Queue Server (MSMQ) is a messaging technology
which seems to be used as an underlying technology for implementing
some B2B solutions.
Does the J2EE Connector Architecture (http://java.sun.com/j2ee/connector/)
relate to B2B?
|