Docsity

Workflow Controller - E-Commerce - Lecture Slides, Slides of Fundamentals of E-Commerce

Toggle sidebar
bg1
1
2/2/05 1
6. A pplication Server
Issues for the Project
Tran saction Proc essing
for E-Comm erce
2/2/05 2
R equests
•A re q u e st is a message that describes a unit of work fo r the
system to execu te.
•An app lication server coordinates the flow of requests
betw een message sou rces (disp lays, ap plications, etc.) and
app lication program s that run requests as transactions.
•Basic control flow :
–Translate the disp lay input (fo rm /m enu selection, etc.)
into a standard-form at requ e st
– S end the re q u es t to the app rop riate serv er based on the
tran saction type in the req u e st h eader
–Start the transaction
–In voke the transaction type’s application program
–Commit and send the transaction’s output to the disp lay
2/2/05 3
A pplication Server Architecture
• A pp server should make the previous con trol flow scale up
•Bold lines carry req ue st messages
Web Server
Workflow Controller
Transaction Serve r Transaction Server
intranet
ht
t
p
other TP
systems
2
34
5
Web Browser
Resource Manager
1
6
Resource Manager
2/2/05 4
A pplication Server C om ponents
•Web Browser
–A sm a rt device, with forms, menus, input validation
•Web serv er
–Performs front-en d work, e.g., security, data caching, ….
–“Calls” the web page assoc iated with the URL, which in turn
calls a workflow controller
•Workflow contro ller
–Calls Start, Com m it, and Abort
–A pp logic that transforms the request (autom atic loan paym ent,
money transfer) into calls on basic objects (loan, accoun t).
Som etimes called business rules.
•Transaction server
–Business objects (custom er, accoun t, loan, teller)
•R esource M anager –usually a database (DB) sy stem
2/2/05 5
Project’s Pro cess Architecture 1
Web Brow ser
Web Server
Workflow controller
Transaction Server
Resource Manager
Client
Workflow Controller
Resource Manager
2/2/05 6
Workflow C ontroller
•For the most part, Workflow Contro llers and
Transaction Servers are just plain old se rv er program s
•The fea tures that differen tiate a W o rk flow Contro ller
are that it
–Brackets transactions (issu es Start, Commit, and Abort),
so that transaction se rver procedures can execu te either as
independent tran sactions or as step s in larger transactions
–Reports Com m its to the client (e.g. web server)
–H andles Aborts and other failures (e.g. re-runs the transaction)
–Does not access the DB system , so it need not be close to the
DB system (i.e. Resource Manager)
Docsity.com
pf3

Partial preview of the text

Download Workflow Controller - E-Commerce - Lecture Slides and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

2/2/ 05 1

6.A pplication Server

Issues forthe Project

Transaction Processing

forE-Com m erce

2/2/ 05 2

Requests

  • A requestis a m essage thatdescribes a unitofw ork forthe

system to execute.

  • A n application servercoordinates the flow ofrequests

betw een m essage sources (displays,applications,etc.)and

application program s thatrun requests as transactions.

  • Basic controlflow :
    • Translate the display input(form /m enu selection,etc.)

into a standard-form atrequest

  • Send the requestto the appropriate serverbased on the

transaction type in the requestheader

  • Startthe transaction
  • Invoke the transaction type’s application program
  • Com m itand send the transaction’s outputto the display

2/2/ 05 3

A pplication ServerA rchitecture

  • A pp servershould m ake the previous controlflow scale up
  • Bold lines carry requestm essages

W eb Server

W orkflow C ontroller

Transaction Server Transaction Server

intranet

http

other TP

systems

Web Browser

Resource M anager

Resource M anager 2/2/ 05 4

A pplication ServerCom ponents

  • W eb Brow ser
    • A sm artdevice,w ith form s,m enus,inputvalidation
  • W eb server
    • Perform s front-end w ork,e.g.,security,data caching,….
    • “Calls” the w eb page associated w ith the U RL,w hich in turn calls a w orkflow controller
  • W orkflow controller
    • Calls Start,Com m it,and Abort
    • A pp logic thattransform sthe request(autom atic loan paym ent, m oney transfer)into calls on basic objects(loan,account). Som etim es called business rules.
  • Transaction server
    • Businessobjects(custom er,account,loan,teller)
  • Resource M anager– usually a database (D B)system

2/2/ 05 5

Project’s Process A rchitecture 1

W eb Brow ser

W eb Server

W orkflow controller

Transaction Server

Resource M anager

Client

W orkflow Controller

Resource M anager

2/2/ 05 6

W orkflow Controller

  • Forthe m ostpart,W orkflow Controllers and

Transaction Servers are justplain old serverprogram s

  • The features thatdifferentiate a W orkflow Controller

are thatit

  • Brackets transactions(issuesStart,Com m it,and Abort), so thattransaction serverprocedures can execute eitheras independenttransactions oras steps in largertransactions
  • Reports Com m its to the client(e.g.w eb server)
  • H andles A borts and otherfailures (e.g.re-runsthe transaction)
  • D oes notaccessthe D B system ,so itneed notbe close to the D B system (i.e.Resource M anager)

2

2/2/ 05 7

Transaction Server

  • The features thatdifferentiate a Transaction Server are

the inverse ofthe W orkflow Controller,nam ely thatit

  • D oes notissue Start,Com m it,and A bort(so itcan be called eitherasan independenttransaction oras a step in larger transaction)
  • D oes nottalk directly to the client(e.g.,W eb Server)
  • Can accessthe D B system
  • In addition,itcan callothertransaction servers.
  • O ften,som e transaction servercode runs as stored

procedures inside the D B system.

  • So com bining the transaction serverand resource m anagerin the projectisn’treally an oversim plification. 2/2/ 05 8

Transaction M anager(TM )

  • The TM is the serverthatsupports Start,Com m itand

A bort.

  • Itim plem ents tw o-phase com m it(2PC).
  • This is a m ajorfeature ofm any application servers.
    • 10 years ago,itw as them ajorfeature (TM + T-RPC).
    • Supports2PC acrossdifferentRM s.
    • So it’s usefulto have a TM in the application servereven though D B productsim plem ent2PC them selves

2/2/ 05 9

Project’s Process A rchitecture 2

W eb Brow ser

W eb Server

W orkflow controller

Transaction Server

Resource M anager

Client

W orkflow Controller

Transaction Resource M anager M anager

Start, Commit, Abort

2PC

2/2/ 05 10

Rem ote Procedure Call(RPC)

  • W ithin a system orintranet,RPC is the m ostpopularform

ofinter-process com m unication

  • A program calls a rem ote procedure (in anotherprocess)the

sam e w ay itw ould calla localprocedure

  • This sim plifies the m essage protocol.It’s alw ays a callm essage follow ed by a return m essage.
  • Ithides certain com m unicationserrors.
  • Itautom atesthe w ork ofm arshaling param eters into and outof the calland return m essages.
  • There are m any im plem entations ofthe concept
  • RM I,D CO M ,CO RBA /IIO P,H TTP,SO A P,O D BC,….
  • In the project,allinter-process com m unications is via RPC.

2/2/ 05 11

TransactionalRPC

  • TransactionalRPC is an RPC protocolthatim plem ents

the necessary plum bing to cope w ith a callerand/orcallee

thatare running a transaction.

  • Ideally,Startreturns a transaction ID that’s hidden from

the callerin a transaction context

  • TransactionalRPC passes thattransaction contextas a hidden param eter.It’s an easierprogram m ing m odeland avoids errors.
  • W hen a transaction firstarrives ata callee C,C needsto enlist w ith the localtransaction m anager(TM ),so the TM know s to callC during tw o-phase com m it.
  • A lso,C needsto execute the callin the contextofthe transaction thatcalled it.

2/2/ 05 12

TransactionalRPC in the Project

  • Y ou are im plem enting transactionalRPC in the project.
    • In steps6 and 7
    • Butthe transaction contextparam eteris explicit(nothidden).