JCEA Part 1: Common Architectures

 

Contents

  1. General
  2. References
  3. Syllabus
    1. Concepts
    2. Common architectures
    3. Legacy connectivity
    4. EJB
    5. EJB Container model
    6. Protocols
    7. Applicability of J2EE
    8. Patterns
    9. Messaging
    10. Internationalisation
    11. Security
  4. Reference
    1. UML
  5. Resources
  6. Further Tips
 
 

Syllabus

  • Given an architecture described in terms of network layout, list benefits and potential weaknesses associated with it
 

Information

Architectural considerations

An architecture can be assessed using the following qualitive measures:

  1. Scalability
  2. Maintainability
  3. Reliability
  4. Availability
  5. Extensibility
  6. Performance
  7. Manageability
  8. 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:

  1. Vertical
  2. 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. 1-tier (monolithic) architectures
  2. 2-tier architectures
  3. 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

  1. Spoke
  2. Exchange
  3. 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?

 

 

Glossary

Transaction monitor
Transaction monitors are programs that monitor transactions to ensure that they are completed in a successful manner. They ensure that successful transactions are committed and that unsuccessful transactions are aborted.
J2EE Components
J2EE applications are made up of components. A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and that communicates with other components. The J2EE specification defines the following J2EE components:
  1. Application clients and applets are components that run on the client.
  2. Java Servlet and JavaServer Pages (JSP) technology components are Web components that run on the server.
  3. Enterprise JavaBeans (EJB) components (enterprise beans) are business components that run on the server.
J2EE components are written in the Java programming language and are compiled in the same way as any program in the language. The difference between J2EE components and "standard" Java classes is that J2EE components are assembled into a J2EE application, verified to be well formed and in compliance with the J2EE specification, and deployed to production, where they are run and managed by the J2EE server.
CGI (Common Gateway Interface)
CGI requests are handled by creating a new process for each request. Servlet requests are handled in separate threads rather than separate processes, and so use far less system resources than CGI requests. Consequently the system can support many more servlet requests than CGI requests
DNS Round Robin:
Spreading incoming IP packets among a number of DNS addresses equally. That means that each subsequent packet is sent to the next address in a list, until the end of the list is reached and the next packet is sent to the first address again. This is a simple load-balancing strategy. It does not take into account the actual load on the machines.
DCOM
It doesn't have proven scalability, which CORBA does, and there is currently no centralised naming service. You can't use it to integrate with legacy applications, which you can with CORBA. based on complex framework
CORBA
  • Pros:
    • CORBA is the most mature and is an 'open' standard.
    • CORBA also appears to have a performance increase over RMI
    • Services can be written in many different languages, executed on many different platforms, and accessed by any language with an (IDL) mapping.
    • With IDL, the interface is clearly separated from implementation, and developers can create different implementations based on the same interface.
  • Cons:
    • Communication only between object-oriented applications, 'object wrapper' around non object-oriented applications.
      Based on a complex framework
    • CORBA does not support the transfer of objects, or code.
    • If CORBA fails to achieve sufficient adoption by industry, then CORBA implementations become the legacy systems.
RMI
Remote Method Invocation is a Java API.
  • Pros:
    • Based on a fairly simple framework.
    • Can introduce new code to foreign JVMs
    • Garbage collected.
    • Portable across many platforms
  • Cons:
    • Can only be used to communicate between Java applications.
    • Security threats with remote code execution, and limitations on functionality enforced by security restrictions
    • The cost and time to convert to a new technology may be prohibitive
    • Can only operate with Java systems - no support for legacy systems written in C++, Ada, Fortran, Cobol...
RMI-IIOP
It's goal was to marry RMI and CORBA. Connect RMI clients to CORBA servers and vice versa. Benefits: Greater re-usability, legacy integration, robust firewall navigation. In the future support for transaction and security contexts can be added (new EJB/IIOP standard). Specification
OODBMSs and OQL
Object Query Language. This is a declarative (nonprocedural) language for querying and updating objects. SQL-92 was used as the basis for OQL
Pros:
When you use an ODBMS, you will write less code than if you were writing to an RDBMS.
If you are working with complex data, an ODBMS can give you performance that is ten to a thousand times faster than an RDBMS. Cons:
Active Replication
Every replica handles requests and replies. Interceptor has to block extra calls to third objects and extra responses (same as hot backup). Passive Replication: One primary replica handles requests and synchronises state with secondary replicas. Requests are also logged. For fail-over, a secondary replica becomes primary and processes all requests after the last synchronisation point (same as warm backup). Miscellaneous concepts
 

Links

  1. http://www.x-nt.com/1.html
  2. http://b2b.ebizq.net/
  3. Techmetrix has published results on performances of widely  used internet architectures.
  4. Active replication for fault tolerence
  5. DNS round robin:
    1. Paper
    2. Dylan Walsh resource
  6. There is a paper on active replacation for fault tolerance
  7. Balaji Notes [on Yahoo Groups]
  8. B2B Overview
  9. Sun J2EE Overview
  10. Microsoft Message Queue Server (MSMQ) by Gopalan Suresh Raj
  11. JavaWorld article
  12. B2B web site
  13. Paper on techniques for scalable web page serving
  14. Ian's mock test
 

Observations

  • Well, there were questions in the exam that required you to know what B2B is all about and how a B2B application is typically modelled using the Hub and Spoke model. Basic B2B stuff.
  • One question expected you to know the difference between B2B and B2C architectures
  • here were two questions which invloved DNS Round Robin
  • Common Architectures will cover 1-tier (monolithic), 2-tier and n-tier. Useful to know how the non-functional requirements tie in with the architecture.

Page created by Leo Crawford
last updated in July 2002