<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://luminoussheep.net/mediawiki/index.php?action=history&amp;feed=atom&amp;title=J2EE_Tiering</id>
	<title>J2EE Tiering - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://luminoussheep.net/mediawiki/index.php?action=history&amp;feed=atom&amp;title=J2EE_Tiering"/>
	<link rel="alternate" type="text/html" href="https://luminoussheep.net/mediawiki/index.php?title=J2EE_Tiering&amp;action=history"/>
	<updated>2026-05-11T19:22:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://luminoussheep.net/mediawiki/index.php?title=J2EE_Tiering&amp;diff=45&amp;oldid=prev</id>
		<title>Martin: Created page with &quot;= Multi Tier Architecture = Client Server architecture with presentation, processing, data management being seperated  Typically: * Layer - Logical * Tier - Physical  Presenta...&quot;</title>
		<link rel="alternate" type="text/html" href="https://luminoussheep.net/mediawiki/index.php?title=J2EE_Tiering&amp;diff=45&amp;oldid=prev"/>
		<updated>2021-09-14T21:19:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Multi Tier Architecture = Client Server architecture with presentation, processing, data management being seperated  Typically: * Layer - Logical * Tier - Physical  Presenta...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Multi Tier Architecture =&lt;br /&gt;
Client Server architecture with presentation, processing, data management being seperated&lt;br /&gt;
&lt;br /&gt;
Typically:&lt;br /&gt;
* Layer - Logical&lt;br /&gt;
* Tier - Physical&lt;br /&gt;
&lt;br /&gt;
Presentation Tier &amp;lt;-&amp;gt; Business processing &amp;lt;-&amp;gt; Data management&lt;br /&gt;
&lt;br /&gt;
= Two Tier =&lt;br /&gt;
Disadvantages:&lt;br /&gt;
* Fails to separate business logic from presentation&lt;br /&gt;
** less reuse&lt;br /&gt;
* Easily compromised integrity&lt;br /&gt;
** Each client may have different business rules&lt;br /&gt;
* Difficult to administer&lt;br /&gt;
* Exposure to security issues&lt;br /&gt;
** Distributed DB access in each client&lt;br /&gt;
* Limited scalability&lt;br /&gt;
** Network resources required for each client&lt;br /&gt;
** Limited resources such as DB connections required for each client&lt;br /&gt;
** Slow network - more DB strain&lt;br /&gt;
** can not add more machines to business tier&lt;br /&gt;
* Restricted clients&lt;br /&gt;
* Limited presentations - PC/Phone/...&lt;br /&gt;
* Difficult to debug/fault find/monitor&lt;br /&gt;
* Hard to maintain - difficult to update clients/fix/ensure everyone has right version&lt;br /&gt;
&lt;br /&gt;
= Three Tier =&lt;br /&gt;
Split Presentation tier from Business tier&lt;br /&gt;
&lt;br /&gt;
Used in most ERP Enterprise Resource Planning solutions&lt;br /&gt;
* systems specialising in high volume transactions CICS, Tuxedo&lt;br /&gt;
&lt;br /&gt;
Problems:&lt;br /&gt;
* complexity&lt;br /&gt;
** distribution, multi threading, security&lt;br /&gt;
* system level complexities of distribution&lt;br /&gt;
** use of application frameworks such as TP Transaction Processing&lt;br /&gt;
** application server&lt;br /&gt;
* Lack of portability - each framework has own API&lt;br /&gt;
* Vendor incompatibility - no standard interoperable protocol&lt;br /&gt;
* Limited adoption - limited tools programmers typically only support one framework&lt;br /&gt;
* Historically not web compatible - proprietary client/appserver protocol - most now support web &lt;br /&gt;
&lt;br /&gt;
= J2EE Application Architecure =&lt;br /&gt;
&lt;br /&gt;
Supports 2 and 3 tier architecture&lt;br /&gt;
&lt;br /&gt;
[[Image:2tier.png]] [[Image:3tier.png]]&lt;br /&gt;
&lt;br /&gt;
== 4 Programming Environments ==&lt;br /&gt;
# Web container - presentation logic&lt;br /&gt;
# EJB container - business logic&lt;br /&gt;
# Application client container - J2EE app client - see [[J2EE_API and Services#JEE_5_API_and_Services]]&lt;br /&gt;
# Applet container&lt;br /&gt;
&lt;br /&gt;
== Advantages of EJB Development environment ==&lt;br /&gt;
* Simplicity provides frameworks for: security, transactions, muti threading, distribution, resource pooling, secure protocols&lt;br /&gt;
* Standards - Application portability - eases porting to other vendors platforms&lt;br /&gt;
* Component reuse - Beans - reusable business block&lt;br /&gt;
** can customise per deployment&lt;br /&gt;
** multiple applications share same bean and business logic&lt;br /&gt;
* clearly defined roles allow larger teams&lt;br /&gt;
* deployment in different environments - separates business logic from deployment configuration&lt;br /&gt;
** encourages tooling from vendors to support and reduce errors&lt;br /&gt;
* distributed environment independent from topology&lt;br /&gt;
* application interoperability&lt;br /&gt;
* integrates with systems other than java&lt;br /&gt;
** JCA and JMS allows integration with ERP, DBMS in a standard way&lt;br /&gt;
* Tooling and resources - standard lead to tools for development and maintenance&lt;br /&gt;
&lt;br /&gt;
Customer Benefits&lt;br /&gt;
* choice of server - price - features&lt;br /&gt;
* application management - sophisticated tools for management/monitoring/analysing&lt;br /&gt;
* integration with existing systems and data - reuse&lt;br /&gt;
* security - separation of roles - both people and software&lt;br /&gt;
&lt;br /&gt;
More tiers&lt;br /&gt;
* increase extensibility, manageability, security&lt;br /&gt;
* decrease performance - increases latency&lt;br /&gt;
&lt;br /&gt;
2 tier vs 3 tier&lt;br /&gt;
* Advantages&lt;br /&gt;
** gain performance network latency by bringing closer application server and DB&lt;br /&gt;
** better reliability - have control over server environment&lt;br /&gt;
** easier to extend&lt;br /&gt;
** easier to manage/optimise&lt;br /&gt;
&lt;br /&gt;
* Disadvantages&lt;br /&gt;
** loose performance if CPU bound&lt;br /&gt;
&lt;br /&gt;
Key terms:&lt;br /&gt;
&lt;br /&gt;
=== Availability ===&lt;br /&gt;
* often coupled with SLA&lt;br /&gt;
availability = (available time)/(time possible)&lt;br /&gt;
&lt;br /&gt;
=== Capacity ===&lt;br /&gt;
number of jobs/time unit&lt;br /&gt;
&lt;br /&gt;
=== Extensibility ===&lt;br /&gt;
Economically add/modify functionality&lt;br /&gt;
&lt;br /&gt;
=== Flexibility ===&lt;br /&gt;
Ability to support architecture/hardware changes - location independent code helps&lt;br /&gt;
&lt;br /&gt;
=== Manageability ===&lt;br /&gt;
Mange health of system - upgrades&lt;br /&gt;
&lt;br /&gt;
=== Reliability ===&lt;br /&gt;
Integrity and consistency of transactions and application&lt;br /&gt;
* MTBF 10^5 hours - for 1 box =&amp;gt; MTBF 10^15 hours for 3 boxes&lt;br /&gt;
&lt;br /&gt;
=== Performance ===&lt;br /&gt;
Response time&lt;br /&gt;
* SLA&lt;br /&gt;
* ability to control expensive requests&lt;br /&gt;
* process &amp;amp; network&lt;br /&gt;
&lt;br /&gt;
=== Scalability ===&lt;br /&gt;
Increase quality of service as load increases&lt;br /&gt;
* Vertically scale - add more memory/CPUs&lt;br /&gt;
* Horizontally scale - add more servers - requires load balancer - &amp;#039;&amp;#039;&amp;#039;also increases availability/reliability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Security  ===&lt;br /&gt;
Ensure information modifications and disclosures meet security policy&lt;br /&gt;
&lt;br /&gt;
=== Testability ===&lt;br /&gt;
Confirm expected results&lt;br /&gt;
* monitoring&lt;br /&gt;
&lt;br /&gt;
== Two tier ==&lt;br /&gt;
Good for:&lt;br /&gt;
* homogeneous environment&lt;br /&gt;
* static business rules&lt;br /&gt;
* small business &amp;lt;100 users&lt;br /&gt;
* often decision support services&lt;br /&gt;
* low interaction&lt;br /&gt;
Moving business logic to DB limits growth - difficult to scale&lt;br /&gt;
* stored procedures lack rich development tools - debugging/test/VCS&lt;br /&gt;
&lt;br /&gt;
== Three tier ==&lt;br /&gt;
Good for:&lt;br /&gt;
* 100s of users&lt;br /&gt;
* batch jobs (tend to tie up 2 tier clients)&lt;br /&gt;
* high transaction load&lt;br /&gt;
* changeable business rules&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Load balancing ==&lt;br /&gt;
Distributes load across machines&lt;br /&gt;
&lt;br /&gt;
== Replication ==&lt;br /&gt;
http://en.wikipedia.org/wiki/Replication_(computer_science)&lt;br /&gt;
=== Active replication ===&lt;br /&gt;
* Clustering&lt;br /&gt;
* Each request is applied on every system&lt;br /&gt;
* An interceptor is used to &lt;br /&gt;
* Equivalent to a hot backup&lt;br /&gt;
* Multi-primary - (multi-master in DB terms)&lt;br /&gt;
* Requires distributed concurrency - e.g. distributed lock manager&lt;br /&gt;
* Cluster is horizontally scalable by adding more machines&lt;br /&gt;
&lt;br /&gt;
=== Passive replication ===&lt;br /&gt;
* High availability&lt;br /&gt;
* A request is applied on one system then replicated to the others&lt;br /&gt;
* Equivalent to a warm backup&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Backup - copy of data unchanged for long periods - replicas - frequently updated quickly loose historical state&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Applet Client Tier ===&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/blueprints/qanda/client_tier/index.html&lt;br /&gt;
&lt;br /&gt;
Applet client should talk to web container not EJB container&lt;br /&gt;
&lt;br /&gt;
# JRE may not support direct EJB communication&lt;br /&gt;
# Firewalls may prevent direct EJB communication&lt;br /&gt;
# Exposing the EJB container to the internet so client can communication is a security risk&lt;br /&gt;
# Servlet layer decouples the applet from the business layer - [[Facade Pattern]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== J2EE Notes ==&lt;br /&gt;
Annotations: replace deployment descriptors&lt;br /&gt;
* put resources in code next to where they are used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dependency injection: Hides lookup and creation of resources&lt;br /&gt;
* EJB, Web container and clients&lt;br /&gt;
* container inserts references to components/resources using annotations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solves scalability, accessibility, manageability&lt;br /&gt;
* Splits business and presentation tiers&lt;br /&gt;
&lt;br /&gt;
[[Image:Tier.png]]&lt;br /&gt;
&lt;br /&gt;
Considered 3 tier due to number of machines&lt;br /&gt;
* Makes business tier multi-threaded - and web tier&lt;br /&gt;
&lt;br /&gt;
Security: can be defined at deployment time&lt;br /&gt;
* provides a standard login mechanism - authentication&lt;br /&gt;
&lt;br /&gt;
J2EE component: self contained software unit&lt;br /&gt;
* application - classes &amp;amp; files&lt;br /&gt;
* communicates with other components&lt;br /&gt;
* well formed&lt;br /&gt;
* compliant with specification&lt;br /&gt;
* deployed and managed by J2EE server&lt;br /&gt;
&lt;br /&gt;
# Application clients and applets - run on client&lt;br /&gt;
# Servlets/JFS/JPS - web components -run on web server&lt;br /&gt;
# EJB - business components - run on application server&lt;br /&gt;
&lt;br /&gt;
* Web tier - interface, session, input, dialogue, display management&lt;br /&gt;
* Appserver tier - process managment, development, enactment, monitoring, resourcing&lt;br /&gt;
* EIS tier - DBMS - data and file services - ensures consistency, locking, replication &lt;br /&gt;
&lt;br /&gt;
Resources named rather than location based - aids flexibility (moving)/scalability (adding)&lt;/div&gt;</summary>
		<author><name>Martin</name></author>
	</entry>
</feed>