Message-based MVC Architecture for Distributed and Desktop Applications

internalchildlikeInternet and Web Development

Nov 12, 2013 (3 years and 11 months ago)

78 views

March 2, 2005

Xiaohong Qiu

1

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

2

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

3

Background


General area is technology support for
Synchronous
and

Asynchronous
Resource Sharing
.





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)














e
-
learning


(e.g. video/audio conferencing)



e
-
science


(e.g. large
-
scale distributed computing)



e
-
business


(e.g. virtual organizations)



e
-
entertainment


(e.g. online game)

March 2, 2005

Xiaohong Qiu

4

Desktop
Workstation
PDA
Database
Cellular
phone
File
Server
I
B
M
Supercomputer
Laptop
Database
Classic Grid Architecture

Resources

Netsolv
e

Compositio
n

Content
Access

Computing

Security

Collaboration

Middle Tier

Brokers Service

Providers

Clients

Middle Tier becomes Web Services


Comupting
Laser Printer
Java Ring
Cellular
Phone
A centralized organization

March 2, 2005

Xiaohong Qiu

5

Desktop
Workstation
PDA
Database
Cellular
phone
File
Server
I
B
M
Supercomputer
Laptop
Database
Peer to Peer Grids


Brokers

Brokers

Event/Messag
e Brokers

Brokers

Brokers

Event/Messag
e Brokers

Service Facing Web Service Interfaces


Comupting
Laser Printer
Java Ring
Cellular
Phone
A democratic organization

User Facing Web Service Interfaces


Peers

Peers

March 2, 2005

Xiaohong Qiu

6

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

7

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

8

Architecture of network system

File
Server
Laptop
Cellular
phone
PDA
Desktop
Workstation
Database
I
B
M
Supercomputer
Shared
W
A
N
Network Core
router
router
ATM
switch
IP
TCP
UDP
HTTP
SMTP
protocols
Application
H323
FTP
WSDL
routing
(SOAP)
Service
Web
Conferencing
A/V
Streaming
Browsers
Web
Multiplayer
game
Whiteboard
Overlay
network
Applications
Messaging Infrastructure
Grid
computing
P2P
System
Shared
File
Telnet
Media
SSL
March 2, 2005

Xiaohong Qiu

9

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

10

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

11

Model

Controller

View

Mouse event

Keyboard events

Display

Model
-
View
-
Controller (MVC) model

March 2, 2005

Xiaohong Qiu

12

Double
-
linked multiple
-
stage
Web Services
pipeline model of Web applications

Object’’

Or
WS’’

Object

Or
WS

Object

Or
View

Object’

Or
WS’

Object

Or
Display

March 2, 2005

Xiaohong Qiu

13

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

14

Message
-
based MVC model

View
User Interface
Raw UI
Display
Model
Web Service
Sematic
High Level UI
Events as
messages
Rendering as
messages
Input port
Output port
M
essages contain control information
March 2, 2005

Xiaohong Qiu

15


Reformulation of SVG

to message
-
based MVC in a Web Service Model

a. MVC Model

b. Three
-
stage pipeline

Model View Controller


Controller

View

Display

Model

Messages contain control information

Decomposition of SVG Browser

High Level UI

Raw UI

Display

Rendering as
messages

Events as
messages

Semantic

Events as
messages

Rendering as
messages

Input port Output port

A comparison of MVC and
pipeline
model in a
case of SVG application

March 2, 2005

Xiaohong Qiu

16

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

17

Collaborative SVG Chess Game

Players

Observers

March 2, 2005

Xiaohong Qiu

18

Making SVG collaborative by sharing of intercepted events via
messaging broker with Publish/Subscribe scheme

Output port Input port

View

Renderer

JavaScript


Application as Web Service

Facing

Rendering
as


messages

Event
as messages

Model

Master client

Set up an event

class (topic)

Publish


an event

to collaborative
clients

Subscribe to

the topic

Facing

Input port Output port

View

Renderer

JavaScript


Application as Web Service

Rendering
as
messages

Model

Participating client

Facing

Facing

Facing

Broker

GVT

GVT

SVG DOM

SVG DOM

March 2, 2005

Xiaohong Qiu

19

Raw UI
events


(e.g. Mouse
and key
events)

High Level UI
events


(e.g. SVG/DOM
events)

Semantic
events



(e.g. Application
events such as
“capture” in
chess game)


Collaborative
events


(e.g. Master
Events which has
context information
of collaboration and
information from
previous stages)

Collaborative SVG Event processing chart

Classes of Events in SVG

Around 60 detailed Events

March 2, 2005

Xiaohong Qiu

20

XGSP

Session control
Server

NaradaBrokering

Event (Message) Service Infrastructure

• • •



Master client

SVG browser 1

F

I

R

O


Other client

SVG browser 2

F

I

R

O


Other client

SVG browser n

F

I

R

O

Control to/from

all SVG browsers
in the collaborative
session

Data from
master client

Control to/from
XGSP

Data to
other clients

Control to/from
XGSP

Data from
master client

Control to/from
XGSP

Architecture of collaborative SVG browser on PC

This is monolithic SVG example

Shows potential use of XGSP from GlobalMMCS project to

control collaborative applications

March 2, 2005

Xiaohong Qiu

21



NaradaBrokering

Event (Message) Service Infrastructure

• • •


XGSP

Session control
Server


SVG WS 1

Internet
Game


SVG WS 2


SVG WS n

• • •


SVG display 1

SVG display 2

SVG display n

Control to/from

SVG WS1,2, …, n

Control to/from XGSP,
SVG display 2

Rendering to
SVG display 2

Control to/from

SVG WS1,2, …, n

Rendering from
SVG WS 2

Control to/from
SVG display 2

Architecture of multiplayer game with SVG

This is decomposed SVG example

March 2, 2005

Xiaohong Qiu

22

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

23

Three MVC approaches based on different communication mechanism


and interactive pattern between
model

and
view

View

Model

Control

Messages

View

Model

View

Model

Broker

Pub/Sub

a) classic

(method
-
based)

b) request/response

(method
-
based or message
-
based)

c) publish/subscribe

(message
-
based)

March 2, 2005

Xiaohong Qiu

24

Method
-
based MVC vs. message
-
based MVC

B

A

Broker

message based

A

B

register call back method

invoke call back method
with event

method based

What we are doing when we move from classic MVC (monolithic model)

to M
-
MVC (decomposed model)

March 2, 2005

Xiaohong Qiu

25

Decomposition of SVG browser into
stages of pipeline

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

SVG parser

Output (Renderer)

(update image buffer)

Input (UI events)

(e.g. Mouse and
key events)

JavaScript

(access and
manipulate DOM
element)

DOM tree


(before mutation)

(DOM events)

DOM tree’

(after mutation)

GVT tree’

(GraphicsNode changes )

GVT tree

(GraphicsNode events)

Decomposition
Point

View

Model

March 2, 2005

Xiaohong Qiu

26

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

27

Figure
6
.
5
D
ecomposed SVG Browser in M
-
MVC paradigm
NB
client
NB
client
NB event
NB event
NB event
NB event
batch processing
rendering request
Subscriber 2
JSVGCanvas
Input
Subscriber 2
JSVGCanvas
Rendering
Subscriber 2
GVT
NB
client
NB
client
Subscriber 2
DOM
NB
client
NB
client
Subscriber 2
DOM
NB
client
NB
client
Subscriber 2
GVT
vector events/event
compression
EventProcessor
EventProcessor
Subscriber 2
JavaScript
Implementation of Decomposed SVG Browser

March 2, 2005

Xiaohong Qiu

28

Implicit State

A

B

Broker

Separated component/service model

A

View

B

Broker

Conventional shared state model

Shared state

A

Implicit state needs to be serialized and integrated into the
service model.

March 2, 2005

Xiaohong Qiu

29

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

30


Experiments with decomposed Batik SVG browser based on M
-
MVC 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

Performance and Analysis

March 2, 2005

Xiaohong Qiu

31

Definition of typical events of distributed applications


Applications

MacroEvent

MicroEvent

Email

writing an email

a key stroke

Instant Messenger

writing one line of message

a key stroke

Shared File System (P2P)

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

Video/Audio
Conferencing

multi
-
way buffering (interactivity)

inter
-
frame delay

Shared Browser

loading a new URL

a mouse click on a hyperlink

Shared Whiteboard

drawing a new graphics component (e.g. a
rectangle, a line, a path)

a mouse movement

Multiplayer Online Game
(e.g. chess)

moving a piece

a mouse movement

Parallel Computing

updating a region held in a single node

message passing

(exchanging a message between
components)

March 2, 2005

Xiaohong Qiu

32

Summary of typical distributed applications and characteristics



Application

Content

avg. min level of
interactivity

network connectivity features

type

Rendering
complexity

Macro

Event

Micro

Event

band
-
width

latency
tolerance
level

reliabili
ty

connectivit
y type

Email

text, image

low

min

milli sec

low

minutes
or above

no

point
-
to
-
point

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
-
to
-
point

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
-
to
-
point

March 2, 2005

Xiaohong Qiu

33

Performance Testing and timing points



T
0

Machine B

Output


(Rendering)

Input


(UI events)

GVT tree’

GVT tree

Machine A

Event


Processor

JavaScript

DOM tree


(before mutation)

DOM tree’

(after mutation)

Machine C

Event


Processor

T
3

T
1

T
4

T
2

Broker

Notification service
(NaradaBrokering)


Model

(Service)


View

(Client)

Event


Processor

Event


Processor

DOM tree’

(mirrored)

DOM tree

(mirrored)

T
0



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

34

Test

Test scenarios

Mousedown
events

Average of all mouse events (mousedown, mousemove, and
mouseup)

First return


Send time: T
1
-
T
0

(milliseconds)

First return


Send time: T
1
-
T
0
(milliseconds)

Last return


Send time: T’
1
-
T
0
(milliseconds)

End Rendering

T
4
-
T
0
(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

High
-
end
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

Within
-
City
(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

Average Performance of Mouse Events


35

Test

Test scenarios


Bouncing back
event

Average of all mouse events (mousedown, mousemove, and
mouseup)

Bounce back



Send time:
(milliseconds)

First return


Send time: T
1
-
T
0
(milliseconds)

Last return


Send time: T’
1
-
T
0
(milliseconds)

End Rendering

T
4
-
T
0
(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

Immediate bouncing back event


March 2, 2005

Xiaohong Qiu

36

Test

2 hops

(View


Broker


View)

4 hops

(View


Broker


Model


Broker


View)

milliseconds

milliseconds

No

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

Basic NB performance in 2 hops and 4 hops



March 2, 2005

Xiaohong Qiu

37

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

38

NB on Model; Model and View on
two desktop 1.5 Ghz PCs; local
switch network connection.




NB on View; Model and View on two
desktop PCs with “high
-
end” graphics
Dell (3 Ghz Pentium) for View; 1.5 Ghz
Dell for model; local switch network
connection.

Comparison of performance results to

highlight the importance of the client



0
10
20
30
40
50
60
70
80
90
100
0
2
4
6
8
10
12
14
16
minimum T1-T0 in milliseconds
number of events in 5 millisecond bins
Message transit time in M-MVC Batik browser
Configuration:
NB on View; Model and View on two desktop PCs;
local switch network connection;
NB version 0.97; TCP blocking protocol;
normal thread priority for NB;
JMS interface; no echo of messages from Model;
all events
mousedown event
mouseup event
mousemove event
0
10
20
30
40
50
60
70
80
90
100
0
5
10
15
20
25
30
35
40
minimum T1-T0 in milliseconds
number of events in 5 millisecond bins
Message transit time in M-MVC Batik browser
Configuration:
NB on View; Model and View on two desktop PCs;
local switch network connection;
NB version 0.97; TCP blocking protocol;
normal thread priority for NB;
JMS interface; no echo of messages from Model;
all events
mousedown event
mouseup event
mousemove event
All Events

Mousedown

Mouseup

Mousemove

All Events

Mousedown

Mouseup

Mousemove

Time T
1
-
T
0

milliseconds

Events per

5 ms bin

Events per

5 ms bin

March 2, 2005

Xiaohong Qiu

39

0 10 20 30 40 50 60 70 80 90 100
0
2
4
6
8
10
12
14
16
18
20
minimum T1-T0 in milliseconds
number of events in 5 millisecond bins
Message transit time in M-MVC Batik browser
Configuration:
NB on View; Model and View on two desktop PCs;
local switch network connection;
NB version 0.97; TCP blocking protocol;
normal thread priority for NB;
JMS interface; no echo of messages from Model;
all events
mousedown event
mouseup event
mousemove event
NB

on

local

2
-
processor

Linux

server
;

Model

and

View

on

two

1
.
5

Ghz

desktop

PCs
;

local

switch

network

connection
.


0
10
20
30
40
50
60
70
80
90
100
0
5
10
15
minimum T1-T0 in milliseconds
number of events in 5 millisecond bins
Message transit time in M-MVC Batik browser
Configuration:
NB on View; Model and View on two desktop PCs;
local switch network connection;
NB version 0.97; TCP blocking protocol;
normal thread priority for NB;
JMS interface; no echo of messages from Model;
all events
mousedown event
mouseup event
mousemove event
NB on 8
-
processor Solaris server

ripvanwinkle
; Model and View on
two 1.5 Ghz desktop PCs; remote
network connection through routers.

Comparison of performance results with

Local and remote NB locations


All Events

Mousedown

Mouseup

Mousemove

All Events

Mousedown

Mouseup

Mousemove

Time T
1
-
T
0

milliseconds

Events per

5 ms bin

Events per

5 ms bin

March 2, 2005

Xiaohong Qiu

40

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

41

0
10
20
30
40
50
60
70
80
90
100
0
2
4
6
8
10
12
14
16
18
20
minimum T1-T0 in milliseconds
number of events in 5 millisecond bins
Message transit time in M-MVC Batik browser
Configuration:
NB on View; Model and View on two desktop PCs;
local switch network connection;
NB version 0.97; TCP blocking protocol;
normal thread priority for NB;
JMS interface; no echo of messages from Model;
all events
mousedown event
mouseup event
mousemove event
NB on one node of HPC Linux cluster; Model and View on two desktop PCs; routers
network connection. A few events with timing greater than 100 milliseconds are not
shown on the plot

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

March 2, 2005

Xiaohong Qiu

42

0
10
20
30
40
50
60
70
80
90
100
0
5
10
15
20
25
30
minimum T1-T0 in milliseconds
number of events in 5 millisecond bins
Message transit time in M-MVC Batik browser
Configuration:
NB on View; Model and View on two desktop PCs;
local switch network connection;
NB version 0.97; TCP blocking protocol;
normal thread priority for NB;
JMS interface; no echo of messages from Model;
all events
mousedown event
mouseup event
mousemove event
NB on 8
-
processor Solaris server
complexity; Model and View on
two desktop PCs; remote network
connection through routers.

NB on 8
-
processor Solaris server
ripvanwinkle; Model and View on two
desktop PCs; remote network
connection through routers.

0
10
20
30
40
50
60
70
80
90
100
0
5
10
15
minimum T1-T0 in milliseconds
number of events in 5 millisecond bins
Message transit time in M-MVC Batik browser
Configuration:
NB on View; Model and View on two desktop PCs;
local switch network connection;
NB version 0.97; TCP blocking protocol;
normal thread priority for NB;
JMS interface; no echo of messages from Model;
all events
mousedown event
mouseup event
mousemove event
All Events

Mousedown

Mouseup

Mousemove

All Events

Mousedown

Mouseup

Mousemove

Time T
1
-
T
0

milliseconds

Events per

5 ms bin

Events per

5 ms bin

Comparison of performance results on 2
remote NB locations


March 2, 2005

Xiaohong Qiu

43

14
16
18
20
22
24
26
28
30
0
1
2
3
4
5
6
7
8
milliseconds
number of events in 0.5 millisecond bins
Distribution of the mean of mousedown events
NB on Model
NB on View
NB on ripvanwrinkle
36
38
40
42
44
46
48
50
52
54
56
0
0.5
1
1.5
2
2.5
3
3.5
4
milliseconds
number of events in 0.5 millisecond bins
Distribution of the mean of mouseup events
NB on Model
NB on View
NB on ripvanwrinkle
15
20
25
30
0
1
2
3
4
5
6
milliseconds
number of events in 0.5 millisecond bins
Distribution of the mean of mousemove events
NB on Model
NB on View
NB on ripvanwrinkle
Mean Mousedown

Mean Mousemove

Mean Mouseup

Events

Per 0.5 ms

Mean ms

NB on Ripvanwinkle

NB on View

NB on Model

15 runs each

split over

3 days

March 2, 2005

Xiaohong Qiu

44

2
4
6
8
10
12
14
0
1
2
3
4
5
6
milliseconds
number of events in 0.5 millisecond bins
Distribution of the standard deviation of mousedown events
NB on Model
NB on View
NB on ripvanwrinkle
4
6
8
10
12
14
16
18
0
1
2
3
4
5
6
7
milliseconds
number of events in 0.5 millisecond bins
Distribution of the standard deviation of mousemove events
NB on Model
NB on View
NB on ripvanwrinkle
8
9
10
11
12
13
14
15
16
17
18
0
0.5
1
1.5
2
2.5
3
3.5
4
milliseconds
number of events in 0.5 millisecond bins
Distribution of the standard deviation of mouseup events
NB on Model
NB on View
NB on ripvanwrinkle
Events

Per 0.5 ms

Mean ms

NB on Ripvanwinkle

NB on View

NB on Model

Standard

Deviation

Mousedown

Standard Deviation


Mousemove

Standard Deviation


Mouseup

15 runs each

split over

3 days

March 2, 2005

Xiaohong Qiu

45


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

Observations III


March 2, 2005

Xiaohong Qiu

46

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

47

SMMV vs. MMMV as MVC interactive patterns



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.



View n
-
1

View n

View 1

View 2

Model

a) Single Model Multiple View

View n
-
1

View n

View 1

View 2

Model m
-
1

Model m

Model 1

Model 2

b) Multiple Model Multiple View

March 2, 2005

Xiaohong Qiu

48


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

Collaboration Paradigms

March 2, 2005

Xiaohong Qiu

49

master

client

View

NaradaBrokering

other

client

View

Model

as Web Service

other

client

View

other

client

View

Broker

master

client

View

other

client

View

other

client

View

other

client

View

NaradaBrokering

Model

as WS

Model

as WS

Model

as WS

Model

as WS

Broker

Broker

Broker


Collaboration paradigms deployed with M
-
MVC model

SMMV

MMMV

master

SVG

browser

client

other

NaradaBrokering


Monolithic collaboration

Identical programs receiving identical events

master

SVG

browser

client

master

master

SVG

browser

client

other

master

SVG

browser

client

other

March 2, 2005

Xiaohong Qiu

50

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 message
-
based Web applications

especially those with rich Web content and high client
interactivity and complex rendering issues.


March 2, 2005

Xiaohong Qiu

51

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

52

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

53


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/



Reference