Friday, 29 March 2013

Oracle Application Architecture


 



Learning Oracle Apps Architecture is the first step towards learning anything in oracle apps.

The Oracle Application Architecture is a framework  for mufti-tiered distributed computing that supports Oracle Application Products.

In this model various services or servers are distributed among three levels called tiers.

Habit to listen the word 'Tier" in this post because it's the common term used in the Oracle Application Architecture. Sorry for boring  to you by using this word regularly.

A server(or services) are process or group of processes that runs in a single machine.

As I mentioned Oracle Application is based on tier,it mainly based on 3-Tier architecture. And they are named as:
                               1. Desktop Tier (Browser Tier)
                               2. Application Tier (Business layer)
                               3. Database Tier


Software Components of Three-tier Architecture:

Client:
1. Sun 1.5 Java Runtime Environment (JRE) i.e
    Java Virtual Machine(JVM) : J2SE plug-in.

The Client Interface is provided via HTML for HTML based Application and via a JAVA APPLET in a web browser in the traditional forms-based application.
Middle Tier(Application Tier):
1.Apache Web Server 2.0
2. JRE(Java Runtime Environment)-1.5
3. JDK(Java Development Kit)- 1.5x
4. Oracle Containers for J2EE(OC4J).
5. Oracle Forms/Reports 10g.

Database Tier:
1. Oracle 10g Enterprise Edition. 


Full explanation of the 3-tier Architecture model.
 
Desktop Tier
 Its is nothing but a simple web browser (Internet explorer or Netscape etc) from which end-user logs into the application or we can say user access the Oracle Application. Important thing to remember is that browser has to be java enabled. The components required on the desktop tier are Forms Client Applet and Oracle Jinitiator.

Database Tier:
It manages the Oracle database and stores all the data.Important thing to remember is that database tier does not directly communicates with desktop tier, but rather with servers on the middle tier which in turn provides the end-users with the information as required in interface which is more user friendly. Hence almost all the processing is handled at Applications and Database Tier (which are much bigger machines) leaving client machines free of any processing.

Application Tier:
 The Application tier where the application software resides.It hosts various servers,manages communication between desktop tier and database tier and contains the application file system.
The application tier architecture shifts software administration from the desktop to middle tier,thus removing the burden of installing the software for every client. It also supports load balancing between multiple Forms server and Concurrent processing server to provide optimum scalabilty and performance.

Six servers constitute the application tier:

1. Oracle HTTP server(Apache)
2. Forms server
3. Report sever(Applicable only for 11i based systems)
4.Concurrent processing server
5. Admin server
6.Discover server

Before discussing the HTML Based Applications architecture ,it is important to know what is Oracle HTTP server(Apache)

Oracle HTTP Server(Apache)

It processes all the request that comes from the client i.e from browser(when client hit a URL in browser is nothing but the request send by the user to fetch a services from web server ).
The web server has some additional components, viz-Web listener, Jserv (Java servlet engine) and Java Server Pages. The web listener components accepts incoming HTTP requests from client browsers.

Steps:
1. The browser contacts the web listener with the URL. If possible,the HTTP listener itself services requests by returning a simple HTML page.

2. If the page referenced by the URL needs advanced processing ,the listener passes the request on to the servlet engine, which contacts the database server as necessary.

The above steps only used in every case.(Core Concept )

HTML based Application and the Oracle Application Framework


Oracle HTML-based Applications are those designed in pure HTML and JavaScript. They dynamically generate HTML pages by executing java code. They use a metadata dictionary for a flexible layout and operate by direct connection to the web server.

How the Java servlet works with HTML based Applications

Just follow the diagram........

1. The user clicks a hyperlink in his browser from the client desktop. for example:http://abc.xyz.com:8005/OA_HTML/AppsLogin  .Giving port number means it will going to fetch the services from that port number which is resided in a machine somewhere else and we are going to call the services.
2. The browser connects the web listner with the URL.
3. The web listener contacts the servlet engine and it runs a Java Server Page(JSP).
4. Now it is the turn of the JSP page to connect to the Oracle database,gets information from the meta data dictionary and the content from the Application tables in order to construct the HTML page.
5. The web server passes the resulting HTML page back to the browser.

When we hit the :http://abc.xyz.com:8005/OA_HTML/AppsLogin URL in a browser we are requesting for the login page(above are the steps undergoes background to get the login page to user)

                                 


 Forms server
How the Forms server works

@ Browser sends request (URL) to HTTP Listener  (Apache server) _______  Indierctly checking whether the Apache server is up or not .
@ HTML page is retrieved(static) or generated(dynamic).

Mainly it helped to deploy the forms in the internet. Forms Server is an application server optimized to deploy Oracle Forms applications in a mulch-tiered environment.

The Forms Server is a middle-tier application server for deploying complex, transactional forms applications to the Internet. Developers can build new applications with Oracle Forms Developer and deploy them to the Internet with the Forms Server.


The Forms Server consists of three major components
  • The Forms Applet, which is automatically downloaded to the client and viewed within the Web browser
  • The Forms Listener, which resides on the middle tier
  • The Forms Runtime Engine, which also resides on the middle tier 
In forms server architecture concepts the Browser send the request(URL) to HTTP Listener for
Java Applet.



Forms Server process flow

When a user runs a Forms application on the Web, the following sequence of events occurs:
  1. The user accesses the URL of an HTML page that indicates a Forms application should be run.
  2. The HTML page is downloaded to the Web browser. If needed, the client will also download the Java archive file containing the Forms applet. The Forms applet will be instantiated and the parameters from the HTML page will be used to determine which Forms application will be run.
  3. The Forms applet sends a request to the Forms Listener (which resides on a specific port of the machine from which the Forms applet was downloaded).
  4. The Forms Listener contacts the Forms Runtime Engine and connects to a Forms Server runtime process. If included in the HTML page, Forms command-line parameters (such as form name, user ID and password, database SID, menu name, and so on) and any user-defined Form Builder parameters are passed to the process by the Forms Listener.
  5. The Listener establishes a connection with the Runtime Engine, and sends the connection information to the Forms applet.
  6. The Forms applet then establishes a direct connection with the Runtime Engine.
  7. The Forms applet and Runtime Engine then communicate directly, freeing the Listener to accept startup requests from other users. The Forms applet displays the application's user interface in the main window of the user's Web browser.
  8. The application running on the Runtime Engine communicates directly with the database. 
Concurrent  Processing Server

A concurrent server has to be able to serve more than one client at a time. 

For example, a chat server may be serving a specific client for hours—it cannot wait till it stops serving a client before it serves the next one. 

When an Oracle Application user submits a request to run a program,it is called a concurrent request.
The set of program responsible for running the concurrent request is known as Concurrent Manager.
It runs in the background and takes care of initiating and completing concurrent requests.

Concurrent Manager acts like a job processing adminstarators in Oracle Application and employ workers in the operating system  to process the application requested by the user. A manager can run any program or can be specialized to run only certain program. 


Server Load Balancing: 

Why is load balancing of servers needed?
If there is only one web server responding to all the incoming HTTP requests for your website, the capacity of the web server may not be able to handle high volumes of incoming traffic once the website becomes popular. The website's pages will load slowly as some of the users will have to wait until the web server is free to process their requests. The increase in traffic and connections to your website can lead to a point where upgrading the server hardware will no longer be cost effective.

In order to achieve web server scalability, more servers need to be added to distribute the load among the group of servers, which is also known as a server cluster. The load distribution among these servers is known as load balancing. Load balancing applies to all types of servers (application server, database server), however, we will be devoting this section for load balancing of web servers (HTTP server) only.


About load balancing mechanism - IP Spraying
When multiple web servers are present in a server group, the HTTP traffic needs to be evenly distributed among the servers. In the process, these servers must appear as one web server to the web client, for example an internet browser. The load balancing mechanism used for spreading HTTP requests is known as IP Spraying. The equipment used for IP spraying is also called the 'load dispatcher' or 'network dispatcher' or simply, the 'load balancer'. In this case, the IP sprayer intercepts each HTTP request, and redirects them to a server in the server cluster. Depending on the type of sprayer involved, the architecture can provide scalability, load balancing and fail-over requirements.