SlideShare a Scribd company logo
1 of 47
Download to read offline
2/15/12 1
8. Application Servers
CSEP 545 Transaction Processing
Philip A. Bernstein
Copyright ©2012 Philip A. Bernstein
2
Outline
1. Introduction
2. Two-Tier vs. Three-Tier
3. Web Servers
4. Transaction Bracketing
5. Processes and Threads
6. Remote Procedure Call
2/15/12
2/15/12 3
8.1 Introduction
• An application server coordinates the flow of requests between
message sources (displays, applications, etc.) and application
programs that run requests as transactions.
Web Server
Request Controller
Transaction Server Transaction Server
intranet
Queues
other TP
systems
DBMS DBMS
Other
Internet
Sites
2/15/12 4
Application Server Components
• Web Browser
– A smart device, with forms, menus, input validation
• Web server
– Performs front-end work, e.g., security, data caching, ….
– “Calls” the web page associated with the URL, which in turn
calls a request controller
• Request controller
– Calls Start, Commit, and Abort
– App logic that transforms request (automatic loan payment,
money transfer) into calls on basic objects (loan, account).
Sometimes called business rules.
• Transaction server
– Business objects (customer, account, loan, teller)
• DBMS – Database Management System
2/15/12 5
Application Server Functions
• Glue and veneer for TP applications.
– Glue fills in gaps in system functionality.
– Covers the interface with a seamless veneer.
• Mostly, it provides run-time functions for applications
(request control and transaction servers).
– OS functions: threading and inter-process communication,
often passed through from the underlying OS.
– Dist’d system functions: transactions, security, queuing, name
service, object pools, load balancing, …
– Portal functions: shopping cart, catalog mgmt, personalization ...
• Provides some application development tools.
• Provides system mgmt for the running application.
2/15/12 6
Application Server Products
• Adobe (Macromedia)
ColdFusion
• Apple WebObjects
• HP (Tandem) Pathway
• HP (DEC) ACMS
• IBM CICS
• IBM IMS/DC
• IBM Websphere
• Iona iPortal App Server
• Microsoft .NET Enterprise Services
(formerly COM+,
MS Transaction Server (MTS))
• Oracle (BEA) Tuxedo
• Oracle (BEA) WebLogic
• Oracle Application Server
• RedHat JBoss
• Sybase EAServer
• Also see serverwatch.com
2/15/12 7
8.2 Two-Tier vs. Three-Tier
• Before the web, most small-to-medium
scale apps were implemented in 2 tiers
on a LAN
– PC runs a 4GL, such as Sybase
PowerBuilder, Microsoft Visual Basic, or
Embarcadero Delphi
– Server system includes transaction server
application and DBMS
Front End
Program
Transaction
Server
DBMS
2/15/12 8
Two-Tier for the Web
• Front end program  Web server
– In essence, the web browser is a device
• Web server invokes a web page that
has embedded script
– Active Server Page (ASP .NET) or
Java Server Page (JSP)
– Page (file) extension tells the web server
to run the ASP/JSP interpreter
– Script can include DBMS calls and
can run as a transaction DBMS
Web Server
ASP/JSP
2/15/12 9
Two-Tier is Enabled by
DBMS Stored Procedures
• Stored procedure – An application
procedure that runs inside the DBMS
– Often in a proprietary language, such as
PL/SQL (Oracle), T-SQL (MS, Sybase)
– Moving toward standard languages,
such as Java and C#
• Implement transaction servers as
stored procedures
• Use DBMS client-server protocol
• No application server needed
– Hence, sometimes called “TP lite”
Presentation
or Web Server
Stored
Procedures
SQL Engine
SQL DBMS
An Aside: DBMS Interfaces
• Most apps are object-oriented
• Most database interfaces are relational
• So the object-relational mapping layer is an
important part of TP applications
– Often custom for an app suite
– Some generic: Microsoft Entity Framework, Oracle
TopLink, Open Source Hibernate
• Language Integrated Query (LINQ)
– Strongly-typed DB interface to .NET languages
102/15/12
2/15/12 11
Scalability Problem of Two-Tier
• 2-tier is feasible, but does not scale as well as 3-tier due to
session management
• Session - shared state between communicating parties
– Entails memory cost and a setup cost (3-way handshake)
• Sessions reduce amount of per-request context passing
(comm. addresses, authenticated user/device)
– Standard DB APIs (e.g., ODBC) work this way
– Hence, in 2-tier, N clients and M servers  N M sessions
– E.g. 105 presentation servers and 100 servers  107 sessions
• Partition presentation servers across request controllers
– Each request controller still connects to all txn servers but there
are many fewer request controllers than presentation servers
2/15/12 12
3-Tier Reduces the Number of Sessions
Request
Controller
Txn
Server
Txn
Server
Txn
Server
Request
Controller
Front
End
Front
End
. . .Front
End
Front
End
. . .
Txn
Server
. . .
• Partition the set of front end devices (e.g., 103 devices per RC)
• 100 RC  (103 devices/RC + 102 TS/RC) = 110,000 sessions
Partitioning Txn Servers
• If DB server is a bottleneck, then partition it.
– By value ranges or hashing
• E.g., partition Accounts by account range
– Range partitioning is susceptible to overload. It
benefits from auto-reconfiguration by splitting ranges.
– Table-lookup partitioning, per key-value.
• Enables upgrading a user to a new service or new release
• Request control is needed to direct a call to the
right DB partition (parameter-based routing)
– RC sends a Debit request for Account x to the TS
connected to the DB partition containing Account x
2/15/12 13
2/15/12 14
2-Tier vs. 3 Tier — Other Issues
• In early 90’s people argued whether 2-Tier was enough
– Scalability was the decisive factor, but there were other issues
• Database Servers
– Nonstandard stored procedure language, usually less expressive
with weaker development tools and it’s another language to learn
– Limited interoperability of cross-server calls
– Limited interoperability of distributed transactions
– Poor fit with OO design, which are inherently 3-tier
(client, business rules, business objects)
• Application Servers
– More system complexity
2/15/12 15
How the Web Changed Things
• Front End Program  Web server
• All requests have to pass through a Web server
– In 2-tier, each Web server needs sessions to all DB servers
– Session reduction by request control is less critical but still
useful
– DB partitioning may be implemented by the DB server
• Request control is still useful for request mgmt
– Calling Start, Commit, and Abort
– Encapsulating business rules that transform each request into
calls on basic objects
2/15/12 16
8.3 Web Servers
• Presentation independence - application is
independent of the display device used
– Today, this is via http and html
– In the past, it was via a display controller or middle-tier
minicomputer whose presentation functions insulated the
rest of the back-end system from different device types
• Web server performs presentation functions:
– Gathering input
– Validating input
– DB caching
– Authentication
• They also do some basic request routing
– Constructing requests – Invoking applications
• Examples - IIS (MS), Apache, Netscape Server
2/15/12 17
Gathering Input
• Gathering input - Select transaction type (menu item,
etc.), and fill in a form (request’s parameters)
– Today, Web forms, moving to XML (XForms, XSLT, …)
• 40-year evolution of presentation devices
– Teletype, character-at-a-time terminal (async), block-mode
terminal (IBM 3270)
– Specialized devices - ATMs, bar code readers, gas pumps,
robots, credit card authorization, cash registers, ticket
printers, etc.
– 4GL on a PC - ActiveX controls accessed from Visual Basic
(VB), PowerBuilder, Delphi, etc.
– HTML 5 in a web browser.
2/15/12 18
Caching
• Every process-to-process call has a cost
– Adds to response time and consumes resources
• Use a cache in Web server to avoid calling request
controller or DB system
– Cache popular read-only data that need not be refreshed
frequently
– E.g., catalog items, sale items, cover page at an auction site,
recent news, etc.
– Also, data required for input validation info
• Or use a cache server, such as memcached, Oracle
Coherence, or Windows Server AppFabric Caching
2/15/12 19
Input Validation
• Validate input against locally cached tables
– E.g., product types, department numbers
• Avoids wasting communications and server resources
for obvious input errors
– Fewer round-trips to the DBMS
– And faster feedback to the end user
• “Cache” is part of the web page
– List boxes, script
– Cache size is a factor (it affects page access time)
2/15/12 20
Authentication
• Authentication - determining the identity of a user and/or
display device
– Client system (e.g., PC) may do authentication, but the server
usually does it too (doesn’t trust clients)
– Encrypt the wire to avoid wiretapping and spoofing
• On the Web, Transport Layer Security (successor to SSL))
– Client gets a certificate with server’s public key from the server,
signed by trusted authority’s private key
– Client validates certificate using the authority’s public key
– Client and server exchange encryption keys
– Then all messages are encrypted
Authentication (cont’d)
• Geographical entitlement - check that a particular device
is allowed access (e.g., security trading room)
• Need system mgmt functions to create accounts,
initialize passwords, bracket hours of access
(simplify it using a role abstraction)
212/15/12
2/15/12 22
Constructing Requests
• A request includes
– User id – for authorization and personalization
– Device id – where to send a reply
– Device type - what message types can it understand?
– ObjectID – in a OO setting
– RequestID – to ask later about request status & to link a reply
– Request type – name of transaction type requested
– Request-specific parameters
• Can be combined with protocol header (e.g., http header)
2/15/12 23
Application Invocation
• Request arrives as an http message.
– Need to call a program (i.e. a WFC), to perform the request
• Common Gateway Interface
– Write a script, store it as a file in cgi-bin
– Web server creates a process to execute the request (Slow!!)
• ISAPI (Microsoft) and NSAPI (Netscape)
– Web server calls an in-proc .dll instead of creating a process
– Web server can cache the .dll
– More complex programming model, but much faster
• Active Server Pages and Java Server Pages
– Offers the performance of ISAPI with programmability of CGI
2/15/12 24
Load Balancing
• Web servers enable scale out, so you can just add more
server boxes to handle more load.
• To simplify this problem
– Ensure all web servers are stateless. I.e., no server-specific state
and don’t retain client state on web servers (hard to avoid …)
– Statelessness implies any web server can process any request.
– It also makes web server recovery is easy.
– Randomly assign requests to web servers (e.g., an IP sprayer)
– Avoid sending requests to a failed web server
– Downside: Have to pass all state with every request
• This is the philosophy behind REST/HTTP, using Get
and Post operations
2/15/12 25
8.4 Transaction Bracketing
• For the most part, Request Controllers (RC) and
Transaction Servers are just plain old server programs
• The main RC differentiating features
– Brackets transactions (issues Start, Commit, and Abort)
– Handles Aborts (returns cause of the Abort)
– Does not access the DBMS
2/15/12 26
Nested Transaction Calls
• What does Start do, when executed within a txn?
1. it starts an independent transaction, or
2. it does nothing, or
3. it increments a nested transaction count (which is decremented
by each commit and abort), or
4. it starts a sub-transaction.
• (2) and (3) are common.
– Enables a transaction-bracketed program to be called by
another transaction
• (1) implies Be Careful!
27
Transaction Bracketing
• Request controller brackets the transaction with Start,
Commit, Abort.
• Chained - All programs execute in a transaction.
A program can commit/abort a transaction,
after which another transaction immediately starts
– E.g., CICS syncpoint = Commit&Start
– Prevents programmer from accidentally issuing resource
manager operations outside a transaction
• Unchained - Explicit Start operation, so some statements
can execute outside a transaction
– No advantages, unless transactions have overhead even
if they don’t access resources.
2/15/12
2/15/12 28
Transparent Transaction Bracketing
• Transaction-hood is a property of the app component.
• In COM+, a class is declared:
– requires new - callee always starts a new transaction
– required - if caller is in a transaction, then run callee in
caller’s transaction, else start a new transaction
– supported - if caller is in a transaction, then run callee in
caller’s transaction, else run outside of any transaction
– not supported - don’t run in a transaction
• Caller can create a transaction context, which supports
Commit and Abort (chained model).
– Callee issues SetComplete when it’s done and willing to
commit, or SetAbort to abort.
2/15/12 29
Transparent Txn Bracketing (cont’d)
• Java Enterprise Edition
– Implements COM+ technology in Java: RequiresNew,
Required, Supported, NotSupported
– It came later, so there are two additions.
– Mandatory – If caller is in a transaction, then run the callee in
that transaction, else raise an exception
– Never – If caller is in a transaction, then raise an exception
2/15/12 30
Runtime Library Support
• TP services require runtime library support
– May or may not be language-specific
• Language-specific
– Java 2 Enterprise Edition (J2EE, formerly Enterprise Java Beans)
• Encapsulates runtime library as a container object.
• BEA Weblogic, IBM Websphere, ….
– Older examples are Tandem Pathway (Screen COBOL)
and Digital’s ACMSxp (Structured Txn Defn Lang)
• Language-independent runtime library
– MS COM+, IBM’s CICS, Oracle App Server, …
2/15/12 31
Exception Handling
• Request control brackets the transaction, so it must say what
to do if the transaction aborts
• An exception handler must know what state information is
available
– Cause of the abort, e.g., a status variable
– Possibly program exception separate from abort reason
– For system failures, application must save state in stable storage;
note that none of the aborted txn’s state will be available
• Chained model - exception handler starts a new txn
• COM+ - component returns a failure hresult
2/15/12 32
Integrity of Request after Abort
• To permit request retries, it’s useful if get-request
runs inside the request’s transaction:
Start;
get-request;
. . .
Commit;
• If the transaction aborts, then get-request is undone, so
the request becomes available for the next get-request.
• In the RPC or “push model,” make the “catch-the-call”
operation explicit, so it can be undone. Possibly hidden in
the dispatch mechanism. Often requires a queue manager.
2/15/12 33
Savepoints
• Savepoint - a point in a program where an application
saves all its recoverable state
• Can restore a savepoint within the transaction that issued
the savepoint. (It’s a partial rollback.)
• SQL DBMSs use them to support atomic SQL statements.
Start;
get-request;
Savepoint(“B”); . . .;
if (error) {Restore(“B”); …; Commit;}
. . .;
Commit;
• Savepoints are not recoverable. If the system fails or the
transaction aborts, the txn is completely undone.
2/15/12 34
8.5 Processes and Threads
• Application Server architecture is greatly affected by
– which components share an address space
– how many control threads per address space
• TP grew up in the days of batch processing, and reached
maturity in the days of timesharing.
• TP users learned early that a process-per-user fails:
– Too much context switching
– Too much fixed memory overhead per process
– Process per user per machine, when distributed
– Some OS functions scan the list of processes
– Load control is hard
2/15/12 35
Multithreading
• Have multiple threads of control in an address space
• Used to be a major Application Server feature
– Application Server switches threads when app calls a
Application Server function that blocks
• Now, most OS’s support it natively
– Can run a process’s threads on different processors (SMP)
• Whether at the user or OS level,
– multithreading has fewer processes and less context switching
– but little protection between threads and a server failure affects
many transactions
2/15/12 36
Mapping Servers to Processes
• Presentation/Web servers, request controllers, and
transaction servers are multithreaded servers
• Costs 1500 - 25,000 instructions per process call, vs.
50 instructions per local procedure call …
– but it scales, with flexible configuration and control
2/15/12 37
8.6 Remote Procedure Call
• Program calls remote procedure the same way it would call
a local procedure
• Hides certain underlying complexities
– communications and message ordering errors
– data representation differences between programs
• Transactional RPC
– Ideally, Start returns a transaction ID that’s hidden from the caller
– Procedures don’t need to explicitly pass transaction id’s.
– Easier and avoids errors
2/15/12 38
Binding
• Interface definitions
– From app or written in an interface definition language (IDL)
– compiles into Proxy and Stub programs
– Client calls the Proxy (representing the server)
– Stub calls the Server (represents the client on the server)
• Marshaling
– proxy marshals (sequentially lays out) calling parameters in a
packet and decodes marshaled return values
– stub decodes marshaled calling params and marshals return params
• Communications binding
– Client finds the server location via a directory service, based on
server name and possibly a parameter value
– To load balance across identical servers, randomly choose a server
2/15/12 39
Binding (cont’d)
• The binding process has security guarantees
– The client must have privileges to bind to the server
– The client must know it’s binding to an appropriate server to
avoid being spoofed
– E.g. client and server authenticate each other during session
creation, and maybe per-access too
2/15/12 40
RPC Walkthrough
RPC
Runtime
Server
stub
Server
App
receive
send
unpack
argu-
ments
Pack
results
P
work
return
Client
App
Client
Proxy
RPC
Runtime
Call P
Return
to caller
pack
argu-
ments
unpack
results
send
receive
wait
Client’s System Server’s System
Call
packet
Return
packet
2/15/12 41
Performance
• There are basically 3 costs
– marshaling and unmarshaling
– RPC runtime and network protocol
– physical wire transfer
• In a LAN, these are typically about equal
• Typical commercial numbers are 10-25K machine
instructions
• Can do much better in the local case by avoiding a full
context switch
2/15/12 42
Stateful Applications
• Sometimes an application maintains state on client’s behalf,
possibly across transactions. E.g.,
– Server scans a file. Each time it hits a relevant record it returns it.
Next call picks up the scan where it left off.
– Web server maintains a shopping basket or itinerary, etc.
– Server caches client’s authenticated identity or authorizations
– Server caches user’s profile for personalization
Approach 1: client passes state to server on each call, and
server returns it on each reply. Server retains no state.
– Doesn’t work well for TP, because there’s too much state
– Note that transaction id context is handled this way.
2/15/12 43
Stateful Servers Using Sessions
Approach 2: Shared client & server state via a session
– Server maintains state, indexed by client id (txn id or cookie).
Client’s later RPCs must go to same server.
– If the client fails, server must be notified to release client’s state or
deallocate based on timeout
– For transaction RPC, encapsulate context as a (volatile) resource.
Delete the state at commit/abort. Or possibly, maintain state across
transaction boundaries, but reconstruct it after system failure.
• E.g., COM+: Client can call a server object many times
– Client creates server object, which retains state across RPCs
– SetComplete (or SetAbort) by server app says that transaction can
be committed (or aborted) and state can be deleted
– EnableCommit (or DisableCommit) by server app says transaction
can (or cannot) be committed by client and don’t delete server state
Stateful Servers Using Sessions (cont’d)
• Session state can be stored persistently
– In a database system
• Possibly saved within a transaction
– Requires explicit deletion when the session fails
• E.g., via a lease that times out
– Could be tied to a long-lived business process
442/15/12
2/15/12 45
Fault Tolerance
• If a client doesn’t receive a reply within its timeout period
– RPC runtime can send a “ping” for non-idempotent calls
– After multiple pings, it return an error.
– For idempotent calls, RPC runtime can retry the call
(server interface definition can say whether it’s idempotent)
2/15/12 46
Web Services
• Distributed computing standards to enable
interoperation on the Internet
• SOAP - RPC with XML as marshalling format and
WSDL as interface definition
• UDDI - directory for finding Web Service
descriptions
• WS-Transaction - 2PC
• WS-Security, WS-Coordination, WS-Routing, …
• www.ws-i.org
2/15/12 47
Summary
• Scalability – 2 vs. 3 tier, sessions, stored procedures
• Web Server – gathering input, validating input, caching,
authentication, constructing requests, invoking
applications, load balancing
• Transaction bracketing – transparency, nesting,
exceptions, request integrity, savepoints
• Server processes – threads
• RPC – binding, stateful servers

More Related Content

What's hot

Client Server Computing Slides by Puja Dhar
Client Server Computing Slides by Puja DharClient Server Computing Slides by Puja Dhar
Client Server Computing Slides by Puja Dharpuja_dhar
 
Satyanarayan 5+Years Exp WAS Admin
Satyanarayan 5+Years Exp WAS AdminSatyanarayan 5+Years Exp WAS Admin
Satyanarayan 5+Years Exp WAS AdminSatya (mca)
 
Survey on Client Tools, Server and Communication types
Survey on Client Tools, Server and Communication typesSurvey on Client Tools, Server and Communication types
Survey on Client Tools, Server and Communication typesManjuShanmugam1593
 
Impact 2014 - IIB - selecting the right transformation option
Impact 2014 -  IIB - selecting the right transformation optionImpact 2014 -  IIB - selecting the right transformation option
Impact 2014 - IIB - selecting the right transformation optionAndrew Coleman
 
Managed File Transfer White Paper
Managed File Transfer White PaperManaged File Transfer White Paper
Managed File Transfer White PaperDeborah Galea
 
Client-Server Model
Client-Server ModelClient-Server Model
Client-Server ModelHTS Hosting
 
Client server-computing
Client server-computingClient server-computing
Client server-computingjayasreep3
 
1693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
1693: 21 Ways to Make Your Data Work for You - IBM Connect 20161693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
1693: 21 Ways to Make Your Data Work for You - IBM Connect 2016panagenda
 
IBM Managed File Transfer Solutions Overview
IBM Managed File Transfer Solutions OverviewIBM Managed File Transfer Solutions Overview
IBM Managed File Transfer Solutions OverviewLightwell
 
IBM Managed File Transfer Portfolio - IBMImpact 2014
IBM Managed File Transfer Portfolio - IBMImpact 2014IBM Managed File Transfer Portfolio - IBMImpact 2014
IBM Managed File Transfer Portfolio - IBMImpact 2014Leif Davidsen
 
IBM Sterling File Gateway
IBM Sterling File GatewayIBM Sterling File Gateway
IBM Sterling File GatewayLightwell
 
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 20161049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016panagenda
 

What's hot (18)

Client Server Computing Slides by Puja Dhar
Client Server Computing Slides by Puja DharClient Server Computing Slides by Puja Dhar
Client Server Computing Slides by Puja Dhar
 
Resume
ResumeResume
Resume
 
Satyanarayan 5+Years Exp WAS Admin
Satyanarayan 5+Years Exp WAS AdminSatyanarayan 5+Years Exp WAS Admin
Satyanarayan 5+Years Exp WAS Admin
 
Survey on Client Tools, Server and Communication types
Survey on Client Tools, Server and Communication typesSurvey on Client Tools, Server and Communication types
Survey on Client Tools, Server and Communication types
 
Impact 2014 - IIB - selecting the right transformation option
Impact 2014 -  IIB - selecting the right transformation optionImpact 2014 -  IIB - selecting the right transformation option
Impact 2014 - IIB - selecting the right transformation option
 
Managed File Transfer White Paper
Managed File Transfer White PaperManaged File Transfer White Paper
Managed File Transfer White Paper
 
Client-Server Model
Client-Server ModelClient-Server Model
Client-Server Model
 
Client server-computing
Client server-computingClient server-computing
Client server-computing
 
1693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
1693: 21 Ways to Make Your Data Work for You - IBM Connect 20161693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
1693: 21 Ways to Make Your Data Work for You - IBM Connect 2016
 
VendorReview_IBMDB2
VendorReview_IBMDB2VendorReview_IBMDB2
VendorReview_IBMDB2
 
Resume
ResumeResume
Resume
 
IBM Lotus Notes 360
IBM Lotus Notes 360IBM Lotus Notes 360
IBM Lotus Notes 360
 
IBM Managed File Transfer Solutions Overview
IBM Managed File Transfer Solutions OverviewIBM Managed File Transfer Solutions Overview
IBM Managed File Transfer Solutions Overview
 
IBM Managed File Transfer Portfolio - IBMImpact 2014
IBM Managed File Transfer Portfolio - IBMImpact 2014IBM Managed File Transfer Portfolio - IBMImpact 2014
IBM Managed File Transfer Portfolio - IBMImpact 2014
 
IBM Sterling File Gateway
IBM Sterling File GatewayIBM Sterling File Gateway
IBM Sterling File Gateway
 
Case mis ch06
Case mis ch06Case mis ch06
Case mis ch06
 
QSpiders - Server Architecture
QSpiders - Server ArchitectureQSpiders - Server Architecture
QSpiders - Server Architecture
 
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 20161049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
1049: Best and Worst Practices for Deploying IBM Connections - IBM Connect 2016
 

Viewers also liked

Viewers also liked (10)

09 workflow
09 workflow09 workflow
09 workflow
 
11 tm
11 tm11 tm
11 tm
 
18 philbe replication stanford99
18 philbe replication stanford9918 philbe replication stanford99
18 philbe replication stanford99
 
02 fault tolerance
02 fault tolerance02 fault tolerance
02 fault tolerance
 
06 07 lock
06 07 lock06 07 lock
06 07 lock
 
13 tm adv
13 tm adv13 tm adv
13 tm adv
 
14 turing wics
14 turing wics14 turing wics
14 turing wics
 
10 replication
10 replication10 replication
10 replication
 
7 concurrency controltwo
7 concurrency controltwo7 concurrency controltwo
7 concurrency controltwo
 
6 two phasecommit
6 two phasecommit6 two phasecommit
6 two phasecommit
 

Similar to 8 application servers_v2

5 application serversforproject
5 application serversforproject5 application serversforproject
5 application serversforprojectashish61_scs
 
C/S archtecture including basic networking
C/S archtecture including basic networkingC/S archtecture including basic networking
C/S archtecture including basic networkingabhinav2727
 
Introduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxIntroduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxLEENASAHU42
 
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...Prolifics
 
Introduction to the client server computing By Attaullah Hazrat
Introduction to the client server computing By Attaullah HazratIntroduction to the client server computing By Attaullah Hazrat
Introduction to the client server computing By Attaullah HazratAttaullah Hazrat
 
Part 1 network computing
Part 1 network computingPart 1 network computing
Part 1 network computingLinh Nguyen
 
Aerospike Hybrid Memory Architecture
Aerospike Hybrid Memory ArchitectureAerospike Hybrid Memory Architecture
Aerospike Hybrid Memory ArchitectureAerospike, Inc.
 
Ch2_Ed7_Network_Applications.ppt
Ch2_Ed7_Network_Applications.pptCh2_Ed7_Network_Applications.ppt
Ch2_Ed7_Network_Applications.pptFernandoLipardoJr
 
Client server architecture
Client server architectureClient server architecture
Client server architectureBhargav Amin
 
Web-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptxWeb-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptxAlokKumar250045
 
APIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingAPIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingPhil Wilkins
 
Scaling habits of ASP.NET
Scaling habits of ASP.NETScaling habits of ASP.NET
Scaling habits of ASP.NETDavid Giard
 
1588487811-chp-11-c-enterprise-application-integration.ppt
1588487811-chp-11-c-enterprise-application-integration.ppt1588487811-chp-11-c-enterprise-application-integration.ppt
1588487811-chp-11-c-enterprise-application-integration.pptKalsoomTahir2
 
--Enterprise-Application-Integration.ppt
--Enterprise-Application-Integration.ppt--Enterprise-Application-Integration.ppt
--Enterprise-Application-Integration.ppteddielyndacanay0
 

Similar to 8 application servers_v2 (20)

5 application serversforproject
5 application serversforproject5 application serversforproject
5 application serversforproject
 
L21 scalability
L21 scalabilityL21 scalability
L21 scalability
 
C/S archtecture including basic networking
C/S archtecture including basic networkingC/S archtecture including basic networking
C/S archtecture including basic networking
 
Ead pertemuan-7
Ead pertemuan-7Ead pertemuan-7
Ead pertemuan-7
 
Database Management System - 2a
Database Management System - 2aDatabase Management System - 2a
Database Management System - 2a
 
Introduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxIntroduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptx
 
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
 
Introduction to the client server computing By Attaullah Hazrat
Introduction to the client server computing By Attaullah HazratIntroduction to the client server computing By Attaullah Hazrat
Introduction to the client server computing By Attaullah Hazrat
 
Unit 2 oracle9i
Unit 2  oracle9i Unit 2  oracle9i
Unit 2 oracle9i
 
Client server
Client serverClient server
Client server
 
Part 1 network computing
Part 1 network computingPart 1 network computing
Part 1 network computing
 
Aerospike Hybrid Memory Architecture
Aerospike Hybrid Memory ArchitectureAerospike Hybrid Memory Architecture
Aerospike Hybrid Memory Architecture
 
Ch2_Ed7_Network_Applications.ppt
Ch2_Ed7_Network_Applications.pptCh2_Ed7_Network_Applications.ppt
Ch2_Ed7_Network_Applications.ppt
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Web-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptxWeb-Server & It's Architecture.pptx
Web-Server & It's Architecture.pptx
 
Technical Architectures
Technical ArchitecturesTechnical Architectures
Technical Architectures
 
APIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingAPIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go Streaming
 
Scaling habits of ASP.NET
Scaling habits of ASP.NETScaling habits of ASP.NET
Scaling habits of ASP.NET
 
1588487811-chp-11-c-enterprise-application-integration.ppt
1588487811-chp-11-c-enterprise-application-integration.ppt1588487811-chp-11-c-enterprise-application-integration.ppt
1588487811-chp-11-c-enterprise-application-integration.ppt
 
--Enterprise-Application-Integration.ppt
--Enterprise-Application-Integration.ppt--Enterprise-Application-Integration.ppt
--Enterprise-Application-Integration.ppt
 

More from ashish61_scs

More from ashish61_scs (20)

7 concurrency controltwo
7 concurrency controltwo7 concurrency controltwo
7 concurrency controltwo
 
Transactions
TransactionsTransactions
Transactions
 
22 levine
22 levine22 levine
22 levine
 
21 domino mohan-1
21 domino mohan-121 domino mohan-1
21 domino mohan-1
 
20 access paths
20 access paths20 access paths
20 access paths
 
19 structured files
19 structured files19 structured files
19 structured files
 
17 wics99 harkey
17 wics99 harkey17 wics99 harkey
17 wics99 harkey
 
16 greg hope_com_wics
16 greg hope_com_wics16 greg hope_com_wics
16 greg hope_com_wics
 
15 bufferand records
15 bufferand records15 bufferand records
15 bufferand records
 
14 scaleabilty wics
14 scaleabilty wics14 scaleabilty wics
14 scaleabilty wics
 
10b rm
10b rm10b rm
10b rm
 
10a log
10a log10a log
10a log
 
08 message and_queues_dieter_gawlick
08 message and_queues_dieter_gawlick08 message and_queues_dieter_gawlick
08 message and_queues_dieter_gawlick
 
05 tp mon_orbs
05 tp mon_orbs05 tp mon_orbs
05 tp mon_orbs
 
04 transaction models
04 transaction models04 transaction models
04 transaction models
 
03 fault model
03 fault model03 fault model
03 fault model
 
01 whirlwind tour
01 whirlwind tour01 whirlwind tour
01 whirlwind tour
 
Solution5.2012
Solution5.2012Solution5.2012
Solution5.2012
 
Solution6.2012
Solution6.2012Solution6.2012
Solution6.2012
 
Solution7.2012
Solution7.2012Solution7.2012
Solution7.2012
 

Recently uploaded

Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 

8 application servers_v2

  • 1. 2/15/12 1 8. Application Servers CSEP 545 Transaction Processing Philip A. Bernstein Copyright ©2012 Philip A. Bernstein
  • 2. 2 Outline 1. Introduction 2. Two-Tier vs. Three-Tier 3. Web Servers 4. Transaction Bracketing 5. Processes and Threads 6. Remote Procedure Call 2/15/12
  • 3. 2/15/12 3 8.1 Introduction • An application server coordinates the flow of requests between message sources (displays, applications, etc.) and application programs that run requests as transactions. Web Server Request Controller Transaction Server Transaction Server intranet Queues other TP systems DBMS DBMS Other Internet Sites
  • 4. 2/15/12 4 Application Server Components • Web Browser – A smart device, with forms, menus, input validation • Web server – Performs front-end work, e.g., security, data caching, …. – “Calls” the web page associated with the URL, which in turn calls a request controller • Request controller – Calls Start, Commit, and Abort – App logic that transforms request (automatic loan payment, money transfer) into calls on basic objects (loan, account). Sometimes called business rules. • Transaction server – Business objects (customer, account, loan, teller) • DBMS – Database Management System
  • 5. 2/15/12 5 Application Server Functions • Glue and veneer for TP applications. – Glue fills in gaps in system functionality. – Covers the interface with a seamless veneer. • Mostly, it provides run-time functions for applications (request control and transaction servers). – OS functions: threading and inter-process communication, often passed through from the underlying OS. – Dist’d system functions: transactions, security, queuing, name service, object pools, load balancing, … – Portal functions: shopping cart, catalog mgmt, personalization ... • Provides some application development tools. • Provides system mgmt for the running application.
  • 6. 2/15/12 6 Application Server Products • Adobe (Macromedia) ColdFusion • Apple WebObjects • HP (Tandem) Pathway • HP (DEC) ACMS • IBM CICS • IBM IMS/DC • IBM Websphere • Iona iPortal App Server • Microsoft .NET Enterprise Services (formerly COM+, MS Transaction Server (MTS)) • Oracle (BEA) Tuxedo • Oracle (BEA) WebLogic • Oracle Application Server • RedHat JBoss • Sybase EAServer • Also see serverwatch.com
  • 7. 2/15/12 7 8.2 Two-Tier vs. Three-Tier • Before the web, most small-to-medium scale apps were implemented in 2 tiers on a LAN – PC runs a 4GL, such as Sybase PowerBuilder, Microsoft Visual Basic, or Embarcadero Delphi – Server system includes transaction server application and DBMS Front End Program Transaction Server DBMS
  • 8. 2/15/12 8 Two-Tier for the Web • Front end program  Web server – In essence, the web browser is a device • Web server invokes a web page that has embedded script – Active Server Page (ASP .NET) or Java Server Page (JSP) – Page (file) extension tells the web server to run the ASP/JSP interpreter – Script can include DBMS calls and can run as a transaction DBMS Web Server ASP/JSP
  • 9. 2/15/12 9 Two-Tier is Enabled by DBMS Stored Procedures • Stored procedure – An application procedure that runs inside the DBMS – Often in a proprietary language, such as PL/SQL (Oracle), T-SQL (MS, Sybase) – Moving toward standard languages, such as Java and C# • Implement transaction servers as stored procedures • Use DBMS client-server protocol • No application server needed – Hence, sometimes called “TP lite” Presentation or Web Server Stored Procedures SQL Engine SQL DBMS
  • 10. An Aside: DBMS Interfaces • Most apps are object-oriented • Most database interfaces are relational • So the object-relational mapping layer is an important part of TP applications – Often custom for an app suite – Some generic: Microsoft Entity Framework, Oracle TopLink, Open Source Hibernate • Language Integrated Query (LINQ) – Strongly-typed DB interface to .NET languages 102/15/12
  • 11. 2/15/12 11 Scalability Problem of Two-Tier • 2-tier is feasible, but does not scale as well as 3-tier due to session management • Session - shared state between communicating parties – Entails memory cost and a setup cost (3-way handshake) • Sessions reduce amount of per-request context passing (comm. addresses, authenticated user/device) – Standard DB APIs (e.g., ODBC) work this way – Hence, in 2-tier, N clients and M servers  N M sessions – E.g. 105 presentation servers and 100 servers  107 sessions • Partition presentation servers across request controllers – Each request controller still connects to all txn servers but there are many fewer request controllers than presentation servers
  • 12. 2/15/12 12 3-Tier Reduces the Number of Sessions Request Controller Txn Server Txn Server Txn Server Request Controller Front End Front End . . .Front End Front End . . . Txn Server . . . • Partition the set of front end devices (e.g., 103 devices per RC) • 100 RC  (103 devices/RC + 102 TS/RC) = 110,000 sessions
  • 13. Partitioning Txn Servers • If DB server is a bottleneck, then partition it. – By value ranges or hashing • E.g., partition Accounts by account range – Range partitioning is susceptible to overload. It benefits from auto-reconfiguration by splitting ranges. – Table-lookup partitioning, per key-value. • Enables upgrading a user to a new service or new release • Request control is needed to direct a call to the right DB partition (parameter-based routing) – RC sends a Debit request for Account x to the TS connected to the DB partition containing Account x 2/15/12 13
  • 14. 2/15/12 14 2-Tier vs. 3 Tier — Other Issues • In early 90’s people argued whether 2-Tier was enough – Scalability was the decisive factor, but there were other issues • Database Servers – Nonstandard stored procedure language, usually less expressive with weaker development tools and it’s another language to learn – Limited interoperability of cross-server calls – Limited interoperability of distributed transactions – Poor fit with OO design, which are inherently 3-tier (client, business rules, business objects) • Application Servers – More system complexity
  • 15. 2/15/12 15 How the Web Changed Things • Front End Program  Web server • All requests have to pass through a Web server – In 2-tier, each Web server needs sessions to all DB servers – Session reduction by request control is less critical but still useful – DB partitioning may be implemented by the DB server • Request control is still useful for request mgmt – Calling Start, Commit, and Abort – Encapsulating business rules that transform each request into calls on basic objects
  • 16. 2/15/12 16 8.3 Web Servers • Presentation independence - application is independent of the display device used – Today, this is via http and html – In the past, it was via a display controller or middle-tier minicomputer whose presentation functions insulated the rest of the back-end system from different device types • Web server performs presentation functions: – Gathering input – Validating input – DB caching – Authentication • They also do some basic request routing – Constructing requests – Invoking applications • Examples - IIS (MS), Apache, Netscape Server
  • 17. 2/15/12 17 Gathering Input • Gathering input - Select transaction type (menu item, etc.), and fill in a form (request’s parameters) – Today, Web forms, moving to XML (XForms, XSLT, …) • 40-year evolution of presentation devices – Teletype, character-at-a-time terminal (async), block-mode terminal (IBM 3270) – Specialized devices - ATMs, bar code readers, gas pumps, robots, credit card authorization, cash registers, ticket printers, etc. – 4GL on a PC - ActiveX controls accessed from Visual Basic (VB), PowerBuilder, Delphi, etc. – HTML 5 in a web browser.
  • 18. 2/15/12 18 Caching • Every process-to-process call has a cost – Adds to response time and consumes resources • Use a cache in Web server to avoid calling request controller or DB system – Cache popular read-only data that need not be refreshed frequently – E.g., catalog items, sale items, cover page at an auction site, recent news, etc. – Also, data required for input validation info • Or use a cache server, such as memcached, Oracle Coherence, or Windows Server AppFabric Caching
  • 19. 2/15/12 19 Input Validation • Validate input against locally cached tables – E.g., product types, department numbers • Avoids wasting communications and server resources for obvious input errors – Fewer round-trips to the DBMS – And faster feedback to the end user • “Cache” is part of the web page – List boxes, script – Cache size is a factor (it affects page access time)
  • 20. 2/15/12 20 Authentication • Authentication - determining the identity of a user and/or display device – Client system (e.g., PC) may do authentication, but the server usually does it too (doesn’t trust clients) – Encrypt the wire to avoid wiretapping and spoofing • On the Web, Transport Layer Security (successor to SSL)) – Client gets a certificate with server’s public key from the server, signed by trusted authority’s private key – Client validates certificate using the authority’s public key – Client and server exchange encryption keys – Then all messages are encrypted
  • 21. Authentication (cont’d) • Geographical entitlement - check that a particular device is allowed access (e.g., security trading room) • Need system mgmt functions to create accounts, initialize passwords, bracket hours of access (simplify it using a role abstraction) 212/15/12
  • 22. 2/15/12 22 Constructing Requests • A request includes – User id – for authorization and personalization – Device id – where to send a reply – Device type - what message types can it understand? – ObjectID – in a OO setting – RequestID – to ask later about request status & to link a reply – Request type – name of transaction type requested – Request-specific parameters • Can be combined with protocol header (e.g., http header)
  • 23. 2/15/12 23 Application Invocation • Request arrives as an http message. – Need to call a program (i.e. a WFC), to perform the request • Common Gateway Interface – Write a script, store it as a file in cgi-bin – Web server creates a process to execute the request (Slow!!) • ISAPI (Microsoft) and NSAPI (Netscape) – Web server calls an in-proc .dll instead of creating a process – Web server can cache the .dll – More complex programming model, but much faster • Active Server Pages and Java Server Pages – Offers the performance of ISAPI with programmability of CGI
  • 24. 2/15/12 24 Load Balancing • Web servers enable scale out, so you can just add more server boxes to handle more load. • To simplify this problem – Ensure all web servers are stateless. I.e., no server-specific state and don’t retain client state on web servers (hard to avoid …) – Statelessness implies any web server can process any request. – It also makes web server recovery is easy. – Randomly assign requests to web servers (e.g., an IP sprayer) – Avoid sending requests to a failed web server – Downside: Have to pass all state with every request • This is the philosophy behind REST/HTTP, using Get and Post operations
  • 25. 2/15/12 25 8.4 Transaction Bracketing • For the most part, Request Controllers (RC) and Transaction Servers are just plain old server programs • The main RC differentiating features – Brackets transactions (issues Start, Commit, and Abort) – Handles Aborts (returns cause of the Abort) – Does not access the DBMS
  • 26. 2/15/12 26 Nested Transaction Calls • What does Start do, when executed within a txn? 1. it starts an independent transaction, or 2. it does nothing, or 3. it increments a nested transaction count (which is decremented by each commit and abort), or 4. it starts a sub-transaction. • (2) and (3) are common. – Enables a transaction-bracketed program to be called by another transaction • (1) implies Be Careful!
  • 27. 27 Transaction Bracketing • Request controller brackets the transaction with Start, Commit, Abort. • Chained - All programs execute in a transaction. A program can commit/abort a transaction, after which another transaction immediately starts – E.g., CICS syncpoint = Commit&Start – Prevents programmer from accidentally issuing resource manager operations outside a transaction • Unchained - Explicit Start operation, so some statements can execute outside a transaction – No advantages, unless transactions have overhead even if they don’t access resources. 2/15/12
  • 28. 2/15/12 28 Transparent Transaction Bracketing • Transaction-hood is a property of the app component. • In COM+, a class is declared: – requires new - callee always starts a new transaction – required - if caller is in a transaction, then run callee in caller’s transaction, else start a new transaction – supported - if caller is in a transaction, then run callee in caller’s transaction, else run outside of any transaction – not supported - don’t run in a transaction • Caller can create a transaction context, which supports Commit and Abort (chained model). – Callee issues SetComplete when it’s done and willing to commit, or SetAbort to abort.
  • 29. 2/15/12 29 Transparent Txn Bracketing (cont’d) • Java Enterprise Edition – Implements COM+ technology in Java: RequiresNew, Required, Supported, NotSupported – It came later, so there are two additions. – Mandatory – If caller is in a transaction, then run the callee in that transaction, else raise an exception – Never – If caller is in a transaction, then raise an exception
  • 30. 2/15/12 30 Runtime Library Support • TP services require runtime library support – May or may not be language-specific • Language-specific – Java 2 Enterprise Edition (J2EE, formerly Enterprise Java Beans) • Encapsulates runtime library as a container object. • BEA Weblogic, IBM Websphere, …. – Older examples are Tandem Pathway (Screen COBOL) and Digital’s ACMSxp (Structured Txn Defn Lang) • Language-independent runtime library – MS COM+, IBM’s CICS, Oracle App Server, …
  • 31. 2/15/12 31 Exception Handling • Request control brackets the transaction, so it must say what to do if the transaction aborts • An exception handler must know what state information is available – Cause of the abort, e.g., a status variable – Possibly program exception separate from abort reason – For system failures, application must save state in stable storage; note that none of the aborted txn’s state will be available • Chained model - exception handler starts a new txn • COM+ - component returns a failure hresult
  • 32. 2/15/12 32 Integrity of Request after Abort • To permit request retries, it’s useful if get-request runs inside the request’s transaction: Start; get-request; . . . Commit; • If the transaction aborts, then get-request is undone, so the request becomes available for the next get-request. • In the RPC or “push model,” make the “catch-the-call” operation explicit, so it can be undone. Possibly hidden in the dispatch mechanism. Often requires a queue manager.
  • 33. 2/15/12 33 Savepoints • Savepoint - a point in a program where an application saves all its recoverable state • Can restore a savepoint within the transaction that issued the savepoint. (It’s a partial rollback.) • SQL DBMSs use them to support atomic SQL statements. Start; get-request; Savepoint(“B”); . . .; if (error) {Restore(“B”); …; Commit;} . . .; Commit; • Savepoints are not recoverable. If the system fails or the transaction aborts, the txn is completely undone.
  • 34. 2/15/12 34 8.5 Processes and Threads • Application Server architecture is greatly affected by – which components share an address space – how many control threads per address space • TP grew up in the days of batch processing, and reached maturity in the days of timesharing. • TP users learned early that a process-per-user fails: – Too much context switching – Too much fixed memory overhead per process – Process per user per machine, when distributed – Some OS functions scan the list of processes – Load control is hard
  • 35. 2/15/12 35 Multithreading • Have multiple threads of control in an address space • Used to be a major Application Server feature – Application Server switches threads when app calls a Application Server function that blocks • Now, most OS’s support it natively – Can run a process’s threads on different processors (SMP) • Whether at the user or OS level, – multithreading has fewer processes and less context switching – but little protection between threads and a server failure affects many transactions
  • 36. 2/15/12 36 Mapping Servers to Processes • Presentation/Web servers, request controllers, and transaction servers are multithreaded servers • Costs 1500 - 25,000 instructions per process call, vs. 50 instructions per local procedure call … – but it scales, with flexible configuration and control
  • 37. 2/15/12 37 8.6 Remote Procedure Call • Program calls remote procedure the same way it would call a local procedure • Hides certain underlying complexities – communications and message ordering errors – data representation differences between programs • Transactional RPC – Ideally, Start returns a transaction ID that’s hidden from the caller – Procedures don’t need to explicitly pass transaction id’s. – Easier and avoids errors
  • 38. 2/15/12 38 Binding • Interface definitions – From app or written in an interface definition language (IDL) – compiles into Proxy and Stub programs – Client calls the Proxy (representing the server) – Stub calls the Server (represents the client on the server) • Marshaling – proxy marshals (sequentially lays out) calling parameters in a packet and decodes marshaled return values – stub decodes marshaled calling params and marshals return params • Communications binding – Client finds the server location via a directory service, based on server name and possibly a parameter value – To load balance across identical servers, randomly choose a server
  • 39. 2/15/12 39 Binding (cont’d) • The binding process has security guarantees – The client must have privileges to bind to the server – The client must know it’s binding to an appropriate server to avoid being spoofed – E.g. client and server authenticate each other during session creation, and maybe per-access too
  • 40. 2/15/12 40 RPC Walkthrough RPC Runtime Server stub Server App receive send unpack argu- ments Pack results P work return Client App Client Proxy RPC Runtime Call P Return to caller pack argu- ments unpack results send receive wait Client’s System Server’s System Call packet Return packet
  • 41. 2/15/12 41 Performance • There are basically 3 costs – marshaling and unmarshaling – RPC runtime and network protocol – physical wire transfer • In a LAN, these are typically about equal • Typical commercial numbers are 10-25K machine instructions • Can do much better in the local case by avoiding a full context switch
  • 42. 2/15/12 42 Stateful Applications • Sometimes an application maintains state on client’s behalf, possibly across transactions. E.g., – Server scans a file. Each time it hits a relevant record it returns it. Next call picks up the scan where it left off. – Web server maintains a shopping basket or itinerary, etc. – Server caches client’s authenticated identity or authorizations – Server caches user’s profile for personalization Approach 1: client passes state to server on each call, and server returns it on each reply. Server retains no state. – Doesn’t work well for TP, because there’s too much state – Note that transaction id context is handled this way.
  • 43. 2/15/12 43 Stateful Servers Using Sessions Approach 2: Shared client & server state via a session – Server maintains state, indexed by client id (txn id or cookie). Client’s later RPCs must go to same server. – If the client fails, server must be notified to release client’s state or deallocate based on timeout – For transaction RPC, encapsulate context as a (volatile) resource. Delete the state at commit/abort. Or possibly, maintain state across transaction boundaries, but reconstruct it after system failure. • E.g., COM+: Client can call a server object many times – Client creates server object, which retains state across RPCs – SetComplete (or SetAbort) by server app says that transaction can be committed (or aborted) and state can be deleted – EnableCommit (or DisableCommit) by server app says transaction can (or cannot) be committed by client and don’t delete server state
  • 44. Stateful Servers Using Sessions (cont’d) • Session state can be stored persistently – In a database system • Possibly saved within a transaction – Requires explicit deletion when the session fails • E.g., via a lease that times out – Could be tied to a long-lived business process 442/15/12
  • 45. 2/15/12 45 Fault Tolerance • If a client doesn’t receive a reply within its timeout period – RPC runtime can send a “ping” for non-idempotent calls – After multiple pings, it return an error. – For idempotent calls, RPC runtime can retry the call (server interface definition can say whether it’s idempotent)
  • 46. 2/15/12 46 Web Services • Distributed computing standards to enable interoperation on the Internet • SOAP - RPC with XML as marshalling format and WSDL as interface definition • UDDI - directory for finding Web Service descriptions • WS-Transaction - 2PC • WS-Security, WS-Coordination, WS-Routing, … • www.ws-i.org
  • 47. 2/15/12 47 Summary • Scalability – 2 vs. 3 tier, sessions, stored procedures • Web Server – gathering input, validating input, caching, authentication, constructing requests, invoking applications, load balancing • Transaction bracketing – transparency, nesting, exceptions, request integrity, savepoints • Server processes – threads • RPC – binding, stateful servers