Message-based MVC Architecture for Distributed and Desktop Applications Xiaohong Qiu

advertisement
Message-based MVC Architecture for
Distributed and Desktop Applications
Xiaohong Qiu
Department of Electrical Engineering and Computer Science
Syracuse University
March 2, 2005
Xiaohong Qiu
1
Presentation Topics
Background for My Research
Architecture of Message-based MVC
SVG Experiments
Performance Analysis
Collaboration Paradigms
Conclusion and Future work
March 2, 2005
Xiaohong Qiu
2
Background
General area is technology support for Synchronous and Asynchronous
Resource Sharing.
 e-learning
 e-science
 e-business
 e-entertainment
(e.g. video/audio conferencing)
(e.g. large-scale distributed computing)
(e.g. virtual organizations)
(e.g. online game)
Grids
manage and share (typically asynchronously) resources (people, computers,
data, applications etc.) or distributed services in a centralized fashion.
Web Services
define loosely coupled software components across internet interacting with
messages.
Peer-to-Peer Grids
link services, resources and clients in dynamic decentralized fashion.
The system consists of a sea of message-based Services (e.g. shared SVG as a Web Service)
Services linked by publish/subscribe messaging infrastructure (e.g. NaradaBrokering)
March 2, 2005
Xiaohong Qiu
3
Classic Grid Architecture
IBM
Comupting
Laser Printer
Resources
Database
Database
File
Server
Netsolv
e
Computing
Supercomputer
Security
Middle Tier
Brokers Service
Providers
Collaboration
Compositio
n
Content
Access
Middle Tier becomes Web Services
Clients
Laptop
Cellular
Phone
March 2, 2005
Cellular
phone
PDA
Desktop
A centralized
organization
Xiaohong
Qiu
Workstation
Java Ring
4
Peer to Peer Grids
File
Server
Workstation
User Facing Web Service Interfaces
Database
Laptop
Peers
Java Ring
Brokers
PDA
Brokers
Event/Messag
e Brokers
Brokers
Brokers
Event/Messag
e Brokers
Service Facing Web Service Interfaces
IBM
Peers
Laser Printer
Supercomputer
Database
Cellular
phone
March 2, 2005
Comupting
Desktop
A democratic
organization
Xiaohong
Qiu
Cellular
Phone
5
Research on a generic model of
building applications
Application domains
Distributed (Web)
 Service Oriented Architecture and Web Services
Desktop (client)
 Model-View-Controller (MVC) paradigm
Internet collaboration
 Hierarchical Web Service pipeline model
Motivations
CPU speed (Moore’s law) and network bandwidth (Gilder’s law) continue to
improve bring fundamental changes
Internet and Web technologies have evolved into a global information
infrastructure for sharing of resources
Applications getting increasingly sophisticated
 Internet collaboration enabling virtual enterprises
 large-scale distributed computing
Requires new application architecture that is adaptable to fast technology
changes with properties
March 2, 2005
Xiaohong Qiu
6
Summary of the situation
The Internet has evolved into stability


TCP/IP network stack dominating the communication protocol domain;
IP forms the low-level sphere surrounding hardware network core
Construction of distributed operating system over the Internet is not completed


It keeps adding new functionalities to the general purpose platform
One current effort focuses on building of messaging infrastructure tailored for disparate applications
Evolution of application architectures






client-server model
Multi-tier (e.g. three-tier) model
A variety of distributed model (e.g. Java RMI, CORBA, COM/DCOM, J2EE, .NET)
Grids
Peer-to-peer
Web Services and SOA
Web application deployment shows diverse directions but have common
features



User interfaces
Services for the sharing of information and resources (e.g. through unicast and multicast of group
communication)
In the most general sense, collaboration is the core problem and service of Web applications, although
“collaboration” usually refers to system with real-time synchronous and compelling time constraints
Next generation of Web client should enable pervasive accessibility


Ubiquitous availability to clients fro heterogeneous platforms (e.g. Windows, Linux, Unix, and PalmOS)
Uniform Web interface that provides a platform with aggregation of multiple services
March 2, 2005
Xiaohong Qiu
7
Architecture of network system
PDA
IBM
W
A
Network
N
ATM
Supercomputer
ut
in
Core
switch
router
g
FT
P W
SDL
Stre
a mi
ng Media
y
rl a
O
ve
P2
P
Messaging Infrastructure
router
t
lne
rd
Te
oa
SSL
eb
hit
Shared W
Cellular
phone
m Applications
Gr
yste
S
id c
eb Service ro
W
e
l
k
i
r
o
uting
om
F
w
t
e
n
p
P)
OA
(S
Sh
a
re
d
Database
File
Server
TC
IP
P
SM
P
23
UD
3
TP
H
ing
c
s
H
l
n
W
TTP
e
o co
eb
er
Application prot
f
n
Bro
w se
Co
V
/
rs Multip
A
layer game
Laptop
March 2, 2005
Workstation
Desktop
Xiaohong Qiu
8
Our approach
Explicit messaging replacing implicit messaging of traditional event listener paradigms
Key idea is to generalize MVC with model and view communicating by messages with the
messaging providing control mechanism
Message-based MVC (M-MVC) paradigm integrates distributed, Web, and desktop applications
SMMV and MMMV for general collaboration paradigms
Prototyping monolithic SVG collaborations


Shared SVG browser
Share online chess game
Decomposed SVG experiments and detailed performance measurements to test viability of loose
coupling services message-based
Specifically investigate




M-MVC and MVC
M-MVC and Web Applications (Services)
M-MVC and collaboration (SMMV and MMMV paradigms)
M-MVC and messaging infrastructure (NaradaBrokering middleware)
March 2, 2005
Xiaohong Qiu
9
Related Technologies
Batik SVG browser (an open source project from
Apache that supports SVG 1.0)
 A presentation style application is representative and complex in nature (we
experiments with multiplayer-online game with high interactivity and compelling
time constraints)
 Similar applications includes Microsoft PowerPoint, Adobe Illustrator,
Macromedia Flash
SVG (W3C specifications for Scalable Vector Graphics)
 A language for describing 2D vector and mixed vector/raster graphics in XML.
DOM (W3C specifications for Document Object Model)
 Programmatic interfaces for access and manipulate structured document object
 All modern browsers (approximately) support the W3C DOM
 DOM event model specifies event semantics and how to register event handlers
and describe event flow through a tree structure
March 2, 2005
Xiaohong Qiu
10
Model-View-Controller (MVC) model
Model
Controller
Mouse event
Keyboard events
March 2, 2005
View
Xiaohong Qiu
Display
11
Double-linked multiple-stage Web Services
pipeline model of Web applications
Object
Or WS
March 2, 2005
Object’
Or WS’
Object’’
Or WS’’
Xiaohong Qiu
Object
Or View
Object
Or Display
12
Architecture of Message-based MVC
M-MVC is a general approach for building applications with a
message-based paradigm
It emphasizes a universal modularized service model with
messaging linkage
Converges desktop application, Web application, and Internet
collaboration
MVC and Web Services are fundamental architectures for desktop and Web
applications
Web Service pipeline model provides the general collaboration architecture for
distributed applications
M-MVC is a uniform architecture integrating the above models
M-MVC allows automatic collaboration, which simplifies the
architecture design
March 2, 2005
Xiaohong Qiu
13
Message-based MVC model
Model
Web Service
Sematic
High Level UI
Input port
Events as
messages
Output port
Rendering as
messages
Raw UI
Display
User Interface
View
Messages contain control information
March 2, 2005
Xiaohong Qiu
14
A comparison of MVC and pipeline model in a
case of SVG application
Model View Controller
Decomposition of SVG Browser
Semantic
Model
Events as
messages
Rendering as
messages
Controller
High Level UI
View
Input port
Output port
Events as
messages
Rendering as
messages
Raw UI
Display
Display
Messages contain control information
a. MVC Model
b. Three-stage pipeline
Reformulation of SVG to message-based MVC in a Web Service Model
March 2, 2005
Xiaohong Qiu
15
Monolithic SVG Experiments
Collaborative SVG Browser
Teacher-Students scenario
Static Shared SVG contents
Dynamic Share SVG contents
 Hyperlink
 Interactivity and animation (JavaScript binding)
Collaborative SVG Chess game
Two players-multiple observers scenario
Complex interactivity with game intelligence
March 2, 2005
Xiaohong Qiu
16
Collaborative SVG Chess Game
Players
March 2, 2005
Xiaohong Qiu
Observers
17
Making SVG collaborative by sharing of intercepted events via
messaging broker with Publish/Subscribe scheme
Set up an event
class (topic)
Subscribe to
the topic
Broker
Publish
an event
to collaborative
clients
Facing
Facing
Facing
Model
Model
Application as Web Service
Application as Web Service
JavaScript
JavaScript
SVG DOM
SVG DOM
Facing
Facing
Output port
Rendering as
messages
Input port
Output port
Rendering as
messages
Input port
Event as messages
GVT
GVT
Renderer
Renderer
View
View
Participating client
Master client
March 2, 2005
Xiaohong Qiu
18
Collaborative SVG Event processing chart
Raw UI
events
(e.g. Mouse
and key
events)
High Level UI
events
(e.g. SVG/DOM
events)
Semantic
events
Collaborative
events
(e.g. Application
events such as
“capture” in
chess game)
(e.g. Master
Events which has
context information
of collaboration and
information from
previous stages)
Classes of Events in SVG
Around 60 detailed Events
March 2, 2005
Xiaohong Qiu
19
Architecture of collaborative SVG browser on PC
Data to
other clients
R
Master client
SVG browser 1
Session control
Server
Control to/from
all SVG browsers
in the collaborative
session
Control to/from
XGSP
I
Data from
master client
R
O
Other client
SVG browser 2
F
Control to/from
XGSP
I
Data from
master client
R
O
•••
Event (Message) Service Infrastructure
XGSP
NaradaBrokering
F
Other client
SVG browser n
F
Control to/from
XGSP
I
O
This is monolithic SVG example
Shows potential use of XGSP from GlobalMMCS project to
collaborative applications
March 2,control
2005
Xiaohong Qiu
20
Architecture of multiplayer game with SVG
Control to/from
SVG WS1,2, …, n
Rendering to
SVG display 2
SVG WS 2
SVG WS n
Internet
Game
Control to/from
SVG display 1
Rendering from
SVG WS 2
SVG display 2
Control to/from
SVG display 2
•••
•••
Control to/from XGSP,
SVG display 2
NaradaBrokering
SVG WS 1
Event (Message) Service Infrastructure
XGSP
Session control
Server
SVG display n
SVG WS1,2, …, n
This is decomposed SVG example
March 2, 2005
Xiaohong Qiu
21
Decomposed SVG Experiments
Convert a standalone application into
distributed system by splitting Model and
View.
Where to split?
How to split?
How difficult to split?
Is performance acceptable?
March 2, 2005
Xiaohong Qiu
22
Three MVC approaches based on different communication mechanism
and interactive pattern between model and view
Broker
View
Control
Pub/Sub
Model
a) classic
(method-based)
March 2, 2005
View
Messages
Model
b) request/response
(method-based or message-based)
Xiaohong Qiu
View
Model
c) publish/subscribe
(message-based)
23
Method-based MVC vs. message-based MVC
Broker
register call back method
B
A
A
B
invoke call back method
with event
message based
method based
What we are doing when we move from classic MVC (monolithic model)
to M-MVC (decomposed model)
March 2, 2005
Xiaohong Qiu
24
Decomposition of SVG browser into
stages of pipeline
Decomposition
Point
View
GVT tree’
Output (Renderer)
(GraphicsNode changes )
Model
DOM tree’
(after mutation)
SVG parser
(update image buffer)
JavaScript
GVT tree
Input (UI events)
(GraphicsNode events)
DOM tree
(before mutation)
(DOM events)
(access and
manipulate DOM
element)
(e.g. Mouse and
key events)
We analyzed flow of events in Batik to see where best to decompose into
Model and View. There was no clear separation in original code
March 2, 2005
Xiaohong Qiu
25
Important principals
One should split at points where the original method based linkage
involved serializable Java objects.
Serialization is needed before the method arguments can be transported and this
is familiar from Java RMI.
“Spaghetti” classes implied that additional state information would
need to be transmitted if we split at points where classes spanned
interfaces from different modules.
Batik often involved large classes that implemented many different interfaces.
These interfaces often came from different parts of the program and crossed the
possible stages mentioned above.
Message-based MVC paradigm tends to force a more restrictive
programming model
All data are shared explicitly and not implicitly via interfaces crossing splitting
lines.
March 2, 2005
Xiaohong Qiu
26
Implementation of Decomposed SVG Browser
batch processing
rendering request
JSVGCanvas
EventProcessor
NB
NB
Subscriber
GVT 2
Subscriber 2
client
client
Rendering
NB
NB
NB
NB event
event
client
client
Subscriber
DOM 2
Subscriber
JavaScript
2
JSVGCanvas
Subscriber
GVT 2
Subscriber 2
Input
NB
NB
client
client
NB
NB event
event
vector events/event
compression
NB
NB
Subscriber
DOM 2
client
client
EventProcessor
Figure 6.5 Decomposed SVG Browser in M-MVC paradigm
March 2, 2005
Xiaohong Qiu
27
Implicit State
Broker
A
A
Broker
B
View
A
B
Shared state
Separated component/service model
Conventional shared state model
Implicit state needs to be serialized and integrated into the
service model.
March 2, 2005
Xiaohong Qiu
28
The changes bring up issues that
cause a challenge to the system
Timing becomes a compelling issue
With the separation of client and Web Service server, original assumption and
design principle break
The time scope drastically increases from tens of microsecond level (e.g. a Java
method call) to a few milliseconds level (network latency plus system overhead).
Object serialization is a must have toolkit
Messages, as a linkage vehicle, contains component information from
both sides and keep context same
Synchronization is a factor to consider for context
consistency
March 2, 2005
Xiaohong Qiu
29
Performance and Analysis
Experiments with decomposed Batik SVG browser based on MMVC model.
The decomposed Model and View interact with event-based
message via messaging broker provided by NaradaBrokering.
Many variables are set for testing scenarios, which including
locations of Model, View and event broker
runtime environment (e.g. OS and network connection)
Analysis
Relationship of user interactions and structure of mouse events
Performance of fine-grained mouse events
Factors (network latency and computation overhead, thread
scheduling etc.) that affect overall system performance
March 2, 2005
Xiaohong Qiu
30
Definition of typical events of distributed applications
Applications
MacroEvent
MicroEvent
writing an email
a key stroke
writing one line of message
a key stroke
downloading a file
n/a
Distributed Simulation
messaging passing
(exchanging a message between components)
n/a
Internet TV Broadcast
(Streaming Media)
one-way buffering
inter-frame delay
multi-way buffering (interactivity)
inter-frame delay
loading a new URL
a mouse click on a hyperlink
drawing a new graphics component (e.g. a
rectangle, a line, a path)
a mouse movement
moving a piece
a mouse movement
updating a region held in a single node
message passing
(exchanging a message between
components)
Email
Instant Messenger
Shared File System (P2P)
Video/Audio
Conferencing
Shared Browser
Shared Whiteboard
Multiplayer Online Game
(e.g. chess)
Parallel Computing
March 2, 2005
Xiaohong Qiu
31
Summary of typical distributed applications and characteristics
Content
Application
type
avg. min level of
interactivity
Rendering
complexity
network connectivity features
Macro
Event
Micro
Event
bandwidth
latency
tolerance
level
reliabili
ty
connectivit
y type
Email
text, image
low
min
milli sec
low
minutes
or above
no
point-topoint
Instant Messenger
text
low
sec
milli sec
low
second
no
multicast
Shared File System (P2P)
byte stream
n/a
min
n/a
high
minutes
or above
yes
multicast
Distributed Simulation
byte
message
n/a
sec
n/a
high
100’s
millisecs
yes
point-topoint
Internet TV/Broadcast
image,
sound
high
sec
.033 sec
high
second
no
broadcast
Video/Audio Conferencing
image,
sound
high
sec
.033 sec
high
100’s
millisecs
no
multicast
Shared Whiteboard
text, image
high
sec
milli
sec
low
10’s
millisecs
yes
multicast
Multiplayer Online Game
text,
image,
sound
high
sec
milli
sec
low
10’s
millisecs
yes
multicast
Parallel Computing
byte
message
n/a
large
> 10
microsec
high
10
microsecs
yes
point-topoint
March 2, 2005
Xiaohong Qiu
32
Performance Testing and timing points
Notification service
(NaradaBrokering)
View (Client)
T4
Output
(Rendering)
GVT tree’
T3 DOM tree’ T2
(mirrored)
Event
Processor
Model (Service)
Event
Processor
T1
DOM tree’
(after mutation)
JavaScript
Broker
Input
(UI events)
GVT tree
DOM tree
(mirrored)
T0
Event
Processor
Event
Processor
T0
Machine A
Machine B
DOM tree
(before mutation)
Machine C
 T0: A given user event such as a mouse click that is sent from View to Model.
 T1: A given user event such as a mouse click can generate multiple associated DOM change
events transmitted from the Model to the View. T1 is the arrival time at the View of the first of these.
 T2: This is the arrival of the last of these events from the Model and the start of the processing of
the set of events in the GVT tree
 T3: This is the start of the rendering stage
 T4: This is the end of the rendering stage
March 2, 2005
Xiaohong Qiu
33
Average Performance of Mouse Events
Mousedown
events
Test
Test scenarios
Average of all mouse events (mousedown, mousemove, and
mouseup)
First return –
Send time: T1-T0
(milliseconds)
First return –
Send time: T1-T0
(milliseconds)
Last return –
Send time: T’1T0 (milliseconds)
End Rendering
T4-T0 (microseconds)
No
distance
NB
location
mean ±
error
Stdd
ev
mean ±
error
stdde
v
mean ±
error
stdd
ev
mean ±
error
stddev
1
Switch
connects
Desktop
server
33.6 ±
3.0
14.8
37.9 ±
2.1
18.7
48.9±
2.7
23.7
294.0±
20.0
173.0
2
Switch
connects
Highend
Desktop
server
18.0 ±
0.57
2.8
18.9 ±
0.89
9.07
31.0 ±
1.7
17.6
123.0
± 8.9
91.2
3
Office
area
Linux
server
14.9 ±
0.65
2.8
21.0 ±
1.3
10.2
43.9 ±
2.6
20.5
414.0
± 24.0
185.0
4
WithinCity
(Campus
area)
Linux
cluster
node
server
20.0 ±
1.1
4.8
29.7 ±
1.5
13.6
49.5 ±
3.0
26.3
334.0
± 22.0
194.0
5
Inter-City
Solaris
server
17.0 ±
0.91
4.3
24.8 ±
1.6
12.8
48.4 ±
3.0
23.3
404.0
± 20.0
160.0
6
Inter-City
Solaris
server
20.0 ±
1.3
6.4
29.6 ±
1.7
15.3
50.5 ±
3.4
26.0
337.0
± 22.0
189.0
34
Immediate bouncing back event
Bouncing back
event
Test
Test scenarios
Average of all mouse events (mousedown, mousemove, and
mouseup)
Bounce back –
Send time:
(milliseconds)
First return –
Send time: T1-T0
(milliseconds)
Last return –
Send time: T’1T0 (milliseconds)
End Rendering
T4-T0 (milliseconds)
No
distance
NB
location
mean ±
error
Stdde
v
mean ±
error
stdd
ev
mean ±
error
stdd
ev
mean ±
error
stddev
1
Switch
connects
Desktop
server
36.8 ±
2.7
19.0
52.1 ±
2.8
19.4
68.0 ±
3.7
25.9
405.0 ±
23.0
159.0
2
Switch
connects
High-end
Desktop
server
20.6 ±
1.3
12.3
29.5 ±
1.5
13.8
49.5 ±
3.1
29.4
158.0 ±
12.0
109.0
3
Office area
Linux
server
24.3 ±
1.5
11.0
36.3 ±
1.9
14.2
54.2 ±
2.9
21.9
364.0 ±
22.0
166.0
4
Within-City
(Campus
area)
Linux
cluster node
server
15.4 ±
1.1
7.6
26.9 ±
1.6
11.6
46.7 ±
2.9
20.6
329.0 ±
25.0
179.0
5
Inter-City
Solaris
server
18.1 ±
1.3
8.8
31.8 ±
2.2
14.5
54.6 ±
4.9
32.8
351.0 ±
27.0
179.0
6
Inter-City
Solaris
server
21.7 ±
1.4
9.8
37.8 ±
2.7
19.3
55.6 ±
3.4
23.6
364.0 ±
25.0
176.0
35
Basic NB performance in 2 hops and 4 hops
Test
2 hops
(View – Broker – View)
4 hops
(View – Broker – Model –
Broker – View)
milliseconds
milliseconds
mean ± error
stddev
mean ± error
stddev
1
7.65 ± 0.61
3.78
13.4 ± 0.98
6.07
2
4.46 ± 0.41
2.53
11.4 ± 0.66
4.09
3
9.16 ± 0.60
3.69
16.9 ± 0.79
4.85
4
7.89 ± 0.61
3.76
14.1 ± 1.1
6.95
5
7.96 ± 0.60
3.68
14.0 ± 0.74
4.54
6
7.96 ± 0.60
3.67
16.8 ± 0.72
4.47
No
March 2, 2005
Xiaohong Qiu
36
Observations I
This client to server and back transit time is only 20% of the total processing time in
the local examples.
The overhead of the Web service decomposition is not directly measured in tests
shown these tables
The changes in T1-T0 in each row reflect the different network transit times as we
move the server from local to organization locations.
This overhead of NaradaBrokering itself is 5-15 milliseconds depending on the
operating mode of the Broker in simple stand-alone measurements. It consists
forming message objects, serialization and network transit time with four hops (client
to broker, broker to server, server to broker, broker to client).
The contribution of NaradaBrokering to T1-T0 is about 30 milliseconds in preliminary
measurements due to the extra thread scheduling inside the operating system and
interfacing with complex SVG application.
We expect the main impact to be the algorithmic effect of breaking the code into two,
the network and broker overhead, thread scheduling from OS.
March 2, 2005
Xiaohong Qiu
37
Comparison of performance results to
highlight the importance of the client
Message transit time in M-MVC Batik browser
all events
mousedown event
All Events
mouseup event
mousemove event
Mousedown
Mouseup
Mousemove
14
12
10
8
6
Events per
40
5 ms bin
20
15
Configuration:
2
5
0
10
20
30
40
50
60
minimum T1-T0 in milliseconds
70
80
90
100
NB on View ; Model and View on tw o desktop PCs;
local sw itch netw ork connection;
NB version 0.97; TCP blocking protocol;
normal thread priority for NB;
JMS interface; no echo of messages from Model;
0
10
20
30
40
50
60
minimum T1-T0 in milliseconds
70
80
90
Time T1-T0 milliseconds
NB on Model; Model and View on
two desktop 1.5 Ghz PCs; local
switch network connection.
March 2, 2005
All Events
Mousedown
Mouseup
Mousemove
25
10
0
all events
mousedown event
mouseup event
mousemove event
30
4
0
Message transit time in M-MVC Batik browser
35
number of events in 5 millisecond bins
Events per
ms bin
165
NB on View; Model and View on two
desktop PCs with “high-end” graphics
Dell (3 Ghz Pentium) for View; 1.5 Ghz
DellQiu
for model; local switch network 38
Xiaohong
connection.
100
Comparison of performance results with
Local and remote NB locations
Events per
ms bin
Events per
15
5 ms bin
Message transit time in M-MVC Batik browser
20
5
Message transit time in M-MVC Batik browser
all events
mousedown event
All Events
mouseup event
mousemove event
Mousedown
Mouseup
Mousemove
all events
mousedown event
mouseup event
mousemove event
16
14
number of events in 5 millisecond bins
All Events
Mousedown
Mouseup
Mousemove
18
12
10
8
6
10
5
Configuration:
NB onsw
View
Model
and
View on tw o d
local
itch;netw
ork
connection;
NB
version
0.97;
TCP for
blocking
normal
thread
priority
NB; protocol
JMS interface; no echo of messages fr
4
2
0
0
0
10
20
30
40
50
60
minimum T1-T0 in milliseconds
70
80
90
100
0
10
20
30
40
50
60
minimum T1-T0 in milliseconds
70
80
90
Time T1-T0 milliseconds
NB on 8-processor Solaris server
NB on local 2-processor Linux
ripvanwinkle; Model and View on
server; Model and View on two 1.5
two 1.5 Ghz desktop PCs; remote
Ghz desktop PCs; local switch
network connection through routers.
network
connection.
March 2, 2005
Xiaohong Qiu
39
100
Observations II
One usually gets better performance moving the NaradaBrokering broker off the
desktops; the better broker performance (there are no scheduling overheads) outweighs the
increasing network overhead.
The performance of NB on desktop server is not as good as that in fig 7.5 with NB on
“gridfarm1” machine running Linux server.
The results in fig. 7.7 (“ripvanwinkle” with 100 miles round trip distance) generates similar
pattern as in fig. 7.5 (local connection) except with a slightly lower performance
corresponding to the greater network delay for “ripvanwinkle”.
Our results show that use of windows desktops to run NaradaBrokering is never good
even when one uses a machine running the model and view with no network delay.
Windows scheduling introduces delays of 10-20 millisecond overhead that is much
larger than the 1-2 millisecond delays coming from network transit within the extended
university campus and the similar intrinsic processing time needed by NaradaBrokering on
a clean Linux/UNIX machine.
We have not looked at a Windows server (which has a different scheduling algorithm
from desktop Windows) for NaradaBrokering; this could be better than the desktop
Windows used in tests.
March 2, 2005
Xiaohong Qiu
40
Message transit time in M-MVC Batik browser
20
all events
mousedown event
mouseup event
mousemove event
18
This illustrates that
this type of HPC
engine can be used in
Web Server mode
with each node
running different
services. We are only
using one node and
so this is not a
parallel computing
application
number of events in 5 millisecond bins
16
14
12
10
8
6
4
2
0
0
10
20
30
40
50
60
minimum T1-T0 in milliseconds
70
80
90
100
NB on one node of HPC Linux cluster; Model and View on two desktop PCs; routers
network
connection.
A few events withXiaohong
timing greater
than 100 milliseconds are not
March 2,
2005
Qiu
41
shown on the plot
Comparison of performance results on 2
remote NB locations
Events per
5 ms bin
30
Events per
15
5 ms bin
Message transit time in M-MVC Batik browser
Message transit time in M-MVC Batik browser
all events
All Events
mousedown event
mouseup event
mousemove event
Mousedown
Mouseup
Mousemove
all events
mousedown event
mouseup event
mousemove event
25
20
number of events in 5 millisecond bins
All Events
Mousedown
Mouseup
Mousemove
15
10
10
5
Configuration:
NB
View
Model
and
View on tw o de
localonsw
itch;netw
ork
connection;
5
NB version
0.97;
TCP for
blocking
normal
thread
priority
NB; protocol;
JMS interface; no echo of messages fro
0
0
10
20
30
40
50
60
minimum T1-T0 in milliseconds
70
80
90
100
0
0
10
Time T1-T0 milliseconds
NB on 8-processor Solaris server
complexity; Model and View on
two desktop PCs; remote network
March 2, 2005
connection
through routers.
20
30
40
50
60
minimum T1-T0 in milliseconds
70
80
90
NB on 8-processor Solaris server
ripvanwinkle; Model and View on two
desktop PCs; remote network
Xiaohong Qiu
42
connection through routers.
100
Distribution of the mean of mousemove events
Distribution of the mean of mouseup events
6
4
NB on Model
NB on View
NB on ripvanwrinkle
NB on Model
NB on View
NB on ripvanwrinkle
3.5
5
number of events in 0.5 millisecond bins
Mean Mouseup
3
2.5
2
1.5
1
Mean Mousemove
4
3
2
1
0.5
38
40
42
44
46
milliseconds
8
Events
Per 0.5 ms
Mean ms
March 2, 2005
48
50
52
54
56
0
15
Distribution of the mean of mousedown events
6
5
20
25
30
milliseconds
NB on Model
NB on View
NB on ripvanwrinkle
7
number of events in 0.5 millisecond bins
0
36
Mean Mousedown
NB on Ripvanwinkle
NB on View
NB on Model
4
15 runs each
split over
3 days
3
2
1
0
Xiaohong Qiu
43
Distribution of the standard deviation of mouseup events
Distribution of the standard deviation of mousemove events
4
7
NB on Model
Standard
Deviation
NB on View
NB on ripvanwrinkle
Mouseup
6
number of events in 0.5 millisecond bins
3.5
NB on Model
3
2.5
2
1.5
1
5
4
3
2
1
0.5
8
9
10
11
12
13
milliseconds
14
15
16
17
18
0
4
6
8
10
12
milliseconds
14
16
Distribution of the standard deviation of mousedown events
6
Events
Per 0.5 ms
Mean ms
NB on Model
NB on View
NB on ripvanwrinkle
Standard
Deviation
Mousedown
5
number of events in 0.5 millisecond bins
0
NB on View
Standard
Deviation
NB on ripvanwrinkle
Mousemove
4
NB on Ripvanwinkle
NB on View
NB on Model
3
15 runs each
split over
3 days
2
1
March 2, 2005
Xiaohong Qiu
0
2
4
6
8
10
44
12
14
18
Observations III
Ripvanwinkle ALWAYS Better
Means and Standard Deviations do not vary much from run to run
Mouse Down has larger standard deviation when NB on Model
Note Mouse Down has least model processing
NB-Model and NB-View similar except for Mouse Down where NB-View
better
In an exploratory run with NB running over the local network on a Dell PC
with Window XP (heavy loaded), we found very poor performance. For
example, the mean of the mousedown event was 92 milliseconds compared
to 16 milliseconds on ripvanwinkle
March 2, 2005
Xiaohong Qiu
45
Summary of message-based MVC
Provision of a universal paradigm with a service model converging
desktop applications, Web applications, and Internet collaboration
Web applications built on messages can achieve important features
such as scalability
The message-based approach is an indispensable part of the big
picture of system design with a separate intermediate messaging
layer
Reduce deployment overhead of applications
Increase portability of application by decoupling application architecture
with underlying platforms
It conforms to service oriented architecture with loosely coupled
messages linkage, which we expect to have an increasingly
important role for reusability, interoperability, and scalability
March 2, 2005
Xiaohong Qiu
46
SMMV vs. MMMV as MVC interactive patterns
Model 1
Model 2
Model m-1
Model m
View 1
View 2
View n-1
View n
Model
View 1
View 2
View n-1
View n
b) Multiple Model Multiple View
a) Single Model Multiple View
 SIMD– A single control unit dispatches instructions to each processing unit.
 MIMD– Each processor is capable of executing a different program independent of the other
processors. It enables asynchronous processing.
 SMMV generalizes the concept of SIMD
 MMMV generalizes the concept of MIMD
 In practice, SMMV and MMMV patterns can be applied in both asynchronous and synchronous
applications, thus form general collaboration paradigms.
March 2, 2005
Xiaohong Qiu
47
Collaboration Paradigms
Monolithic Collaboration
All participating components are formed as replications of an existing application without
explicit break up into a separate Model and View component as required by the Web service
architecture.
Works through interception of the events on a master application and allows messaging
broker to multicast them to the collaborating clients.
 CGL applications of PowerPoint, OpenOffice and data visualization
Web Service Collaboration framework
Shared input port ─ replicated Web Service
 CGL applications including A/V conferencing, shared whiteboard, text chats and SVG chess
Shared output port
 CGL shared display application
SMMV and MMMV collaboration model (integration of desktop and distributed
models)
SMMV ─ decomposed Model and View with multiple clients sharing a single Model
component.
 Instructor led learning
MMMV ─ decomposed Model and View with multiple models each driving its own separate
View. It enables ubiquity with the customization done from the Model at server side.
 Participatory learning
March 2, 2005
Xiaohong Qiu
48
Monolithic collaboration
NaradaBrokering
SVG
browser
master
client
SVG
browser
master
other
client
SVG
browser
master
other
client
SVG
browser
master
other
client
Identical programs receiving identical events
Collaboration paradigms deployed with M-MVC model
NaradaBrokering
Model
as Web Service
Model
as WS
Model
as WS
Broker
Broker
Model
as WS
Model
as WS
NaradaBrokering
Broker
Broker
View
View
View
View
View
View
View
View
master
client
other
client
other
client
other
client
master
client
other
client
other
client
other
client
March 2, 2005
SMMV
MMMV
Xiaohong Qiu
49
Summary of Contributions
Proposing an “explicit Message-based MVC” paradigm (MMVC) as the general
architecture of Web applications
Demonstrating an approach of building “collaboration as a Web service” through
monolithic SVG experiments.

As an example, we present architecture for three types of collaboration ─ monolithic, thin
client, and interactive client.
Bridging the gap between desktop and Web application by leveraging the existing
desktop application with a Web service interface through “MMVC in a
publish/subscribe scheme”.

As an experiment, we convert a desktop application into a distributed system by modifying
the architecture from method-based MVC into message-based MVC.
Proposing Multiple Model Multiple View and Single Model Multiple View collaboration
as the general architecture of “collaboration as a Web service” model.
Identifying some of the key factors that influence the performance of messagebased Web applications especially those with rich Web content and high client
interactivity and complex rendering issues.
March 2, 2005
Xiaohong Qiu
50
Questions Answered
Can MVC be implemented in a message-based fashion?
What principles are there to govern the decomposition of a given application
into M-MVC components?
What is the performance of the message-based MVC and what factors
influence it?
How does M-MVC depend on the operating system, the application,
machines and network?
What is the relationship of collaboration and Web services with M-MVC
paradigm?
What is the way to define state and state changes in collaborative
applications?
How easy is it to convert an existing application to message-based MVC?
What are the architectural and implementation principles to be used in
building applications from scratch in a message-based MVC paradigm?
March 2, 2005
Xiaohong Qiu
51
Future Work
Analyze performance in other cases (Linux clients, Windows
servers)
Optimize Performance with closer integration with NaradaBrokering
and cleaner data structures
What is best publish-subscribe architecture for M-MVC?
Apply M-MVC to other applications (e.g. OpenOffice)
Use of Web Service specifications (WSRP, WS- Management) to
define M-MVC
Use of XGSP in Collaborative SMMV and MMMV
March 2, 2005
Xiaohong Qiu
52
Reference
Thesis for download
http://grids.ucs.indiana.edu/~xqiu/dissertation.html
Thesis project
http://grids.ucs.indiana.edu/~xqiu/research.html
Publications and Presentations
http://grids.ucs.indiana.edu/~xqiu/publication.html
NaradaBrokering Open Source Messaging System
http://www.naradabrokering.org
Information about Community Grids Lab project and publications
http://grids.ucs.indiana.edu/ptliupages/
March 2, 2005
Xiaohong Qiu
53
Download