What is a collaborative application? General: an application - - PDF document

what is a collaborative application
SMART_READER_LITE
LIVE PREVIEW

What is a collaborative application? General: an application - - PDF document

What is a collaborative application? General: an application designed to assist Synchronization in people engaged in a common task Collaborative Applications E-mail, video conferencing, database system, shared editor, the Web


slide-1
SLIDE 1

Synchronization in Collaborative Applications

Jonathan Munson University of North Carolina at Chapel Hill

What is a collaborative application?

◆ General: an application designed to assist

people engaged in a common task

– E-mail, video conferencing, database system, shared editor, the Web

◆ Specifically interested in collaborative

applications that involve shared data

– database system, shared editor, the Web

What is synchronization?

◆ Synchronization controls access to shared

data to prevent users from interfering with each other.

◆ To illustrate, some scenarios involving

collaborative applications

Synchronization

◆ Prevents users from editing same object

simultaneously

User A User B

Alternative policy: exclusive editing

◆ For safety, as plans

get finalized, a user may wish to get exclusive access to an entire drawing

Planner—exclusive editing policy

◆ Users can specify that certain drawings

cannot be modified concurrently, as a matter of policy.

slide-2
SLIDE 2

Group discussion tool

A’s comment B’s reply delete insert ? B’s reply

Alternative application: room scheduler

◆ Synchronization should disallow concurrent

insertions of reservations that conflict.

9:00 am 9:30 am 10:00 am 10:30 am 11:00 am Budget meeting Weekly review

Implications: (1) programmer- defined consistency criteria

◆ Notions of conflict vary from application to

application

– In drawing application, users can always insert

  • bjects concurrently

– In room scheduler, only non-conflicting inserts are allowed.

Synchronization model

Shared data User 1 User 2 Synchronization logic (BeginTransaction Operation* EndTransaction)*

➊ Users submit operations in transactions Operations are validated w.r.t. concurrent

  • perations

Schedules (interleaved transactions)

Synchronization systems

◆ Provide synchronization on behalf of applications

Shared data Application User 1 User 2 Synchronization system Consistency requirements Consistency criteria

Consistency requirements & criteria

◆ Consistency requirements:

– specify the set of ideally allowable schedules. – “Users may concurrently add room reservations (that don’t overlap), but may not concurrently change the same reservation.”

◆ Consistency criteria:

– specify the set of actually allowed schedules. – “Users must access the set of reservations one at a time.”

slide-3
SLIDE 3

Optimal synchronization

◆ The synchronization system’s consistency criteria

match the application’s consistency requirements.

consistency requirements consistency criteria all possible schedules

Traditional criteria: serializability

◆ Concurrent transactions execute as if they were

submitted one after the other.

serializable schedules all possible schedules

Programmer-specified criteria

◆ Programmers should be able to specify the

consistency criteria used for their application

serializable schedules (transactions execute as if

  • ne after the
  • ther)

Consistency criteria for application X Consistency criteria for application Y

User-specified consistency criteria

◆ Users cannot use low-

level mechansisms (code, predicates)

int IsCompatibleLockToLock(lock_requested, lock_held) LockType* lock_requested; LockType* lock_held; { char* lock_table; int row_index, col_index, num_cols; /* check if owned by self */ if (!strcmp(lock_requested->owner, lock_held->owner)) return 1; switch (lock_requested->kind) { case symtab_kind_record: lock_table = record_lock_table; row_index = lock_requested->mode; num_cols = NUMRECORDLOCKS; break; case symtab_kind_sequence: lock_table = sequence_lock_table; if (lock_requested->index == lock_held->index) row_index = lock_requested->mode; else row_index = lock_requested->mode + 4; num_cols = NUMSEQUENCELOCKS; break; default: lock_table = generic_lock_table; row_index = lock_requested->mode; num_cols = NUMGENERICLOCKS; } col_index = lock_held->mode; return lock_table[row_index*num_cols + col_index] == ’Y’; }

◆ …but can use high-

level mechanisms (tables, buttons)

Dictionary Put Remove Modify Null Put Column Row Column Row Remove Column Same Column Row Modify Column Row Merge Row Null Column Column Column

Mobile collaboration: cure in addition to prevention

◆ Users may not be at all times connected.

Some may travel and modify the drawings when disconnected.

Server Client Client Client Client

Implications: (2) late and early validation

◆ All users may be connected ◆ All users may be disconnected (mobile) ◆ Mixed

slide-4
SLIDE 4

Early validation

T C

Update Validation Op ET

◆ Operations are

validated w.r.t. concurrent operations at time of submission

◆ Examples: locking,

multiversion timestamp ordering

Late validation

◆ Operations are

validated w.r.t. concurrent operations at commit time

◆ Examples: optimistic

concurrency control, copy-modify-merge software development

T C

Update Op ET Validation

Early validation vs. late validation

Early validation

L Per-operation

  • verhead

Late validation

J No per-operation

  • verhead

Early validation vs. late validation

Early validation

L Per-operation

  • verhead

J Conflict blocks only

single operation Late validation

J No per-operation

  • verhead

L Conflict may cause

loss of all operations

Early validation vs. late validation

Early validation

L Per-operation

  • verhead

J Conflict blocks only

single operation

K For tight coupling,

with safety Late validation

J No per-operation

  • verhead

L Conflict may cause

loss of all operations

K For parallel develop-

ment of alternatives

Early validation vs. late validation

Early validation

L Per-operation

  • verhead

J Conflict blocks only

single operation

K For tight coupling,

with safety

L Not functional if

network is down Late validation

J No per-operation

  • verhead

L Conflict may cause

loss of all operations

K For parallel develop-

ment of alternatives

J Functional when

disconnected

slide-5
SLIDE 5

Conclusion: need flexibility!

◆ Programmer-specified consistency criteria ◆ Early and late validation ◆ And many others...

A simple solution to flexibility:

◆ Programmers write the synchronization

code themselves

– Rover (late validation) – Prospero (early validation)

Our goal: a balance

Ease of specification Flexibility Our goal Existing systems

Incremental Specification

◆ Support varying levels of “synchronization

awareness” in applications

– no awareness: inherit default policies – medium-level awareness: specify policy – high-level: implement policy

◆ Awareness can be incrementally increased ◆ Constraint: Co-exist with existing

infrastructure

Incremental Specification

◆ Policy

inheritance

◆ Policy

specification

◆ Policy

implementation

➨ Merge- and locking-

aware types

➨ Merge matrices and

lock tables

➨ Subclassing, new

types

Scenarios and requirements

◆ Requirements varied

from application to application

◆ Users added their own

requirements

◆ Groups included both

connected and disconnected users

◆ Specification was

incremental

➨ Programmer-

specified consistency criteria

➨ User-specified

consistency criteria

➨ Early and late

validation

➨ Incremental

Specification

slide-6
SLIDE 6

Three aspects of solution

◆ Merging ◆ Locking ◆ Integration (coexistence)

Co-existing with Existing Infrastructure

◆ Suite Collaboration System

– Sharing of C Types – Assumes Connected Operation – Provides and Assumes C-based User- Interface Generator

◆ Java + “MVC”

Sync Suite Merge Tool

Suite Merge Tool

– Users work without coupling between their views, and then synchronize before committing – Interactive selection of alternatives – Merge policy selected at merge time, by users

Sync framework

◆ Uses asynchronous merging to serve

disconnected, mobile users

◆ No predefined user interface, so may extend

to applications with arbitrary user interfaces

◆ Basis in object-oriented programming

language (Java), more extendible than Suite’s C basis—method overriding, user- defined abstract data types

◆ Fully automated merging.

Synchronous Vs Asynchronous Merging

A1, B1, C1 A2 B2 A3, B3, C2 Merge B2 A1, B1, C1 A2 B2, C2 Merge A3, C3 Merge

Synchronous Asynchronous

Connected Merging in Suite

Application Object Suite Dialogue Manager Suite Dialogue Manager Merge ◆ Assumes connected system User interface User interface ◆ Users must “meet” to merge

slide-7
SLIDE 7

Disconnected Merging in Sync

External Resources User Interface Java Object

  • bject methods

Other clients Replicated Object Sync Replication Server Sync protocol (TCP/IP) Server Client Sync Replication Client Sync methods Replicated Object

Merge process—overview

X X´´

Changes(X→X´) Changes(X→X´´)

◆ Create change sets

Merge process—overview

X X´´

Merge Algorithm

Changes(X→X´) Changes(X→X´´)

◆ Create change sets ◆ Merge them

Merge process—overview

◆ Create change sets ◆ Merge them ◆ Apply results

X X´´

Y X´´

Merge Algorithm

Changes(X→X´) Changes(X→X´´) Changes(X´´→Y) Changes(X´→Y)

Dictionary Put(key) Remove(key) Modify(key) null Put(key) Resolve Row Resolve Row Remove(key) Column Same Column Row Modify(key) Resolve Row Merge Row Null Column Column Column

Merge process—overview

◆ Create change sets ◆ Merge them ◆ Apply results ◆ Table-driven algorithm

X X´´

Y X´´

Merge Algorithm

Changes(X→X´) Changes(X→X´´) Changes(X´´→Y) Changes(X´→Y)

Type-Based Merge Algorithm

◆ Mergeable versions of

– Record – Sequence – Dictionary – Integer, Float, String

◆ Shared data defined by hierarchical

composition of these types

slide-8
SLIDE 8

Composition of a drawing

Drawing (Sequence) x y color shape x y color shape x y color shape x y color shape x y color shape x y color shape DrawingObject (Record)

Merge matrix—overview

◆ Table that specifies outcome of one merge

decision

◆ Entries of table specified by programmers

and users

Merge matrix—general form

◆ Rows represent one change set, columns

represent other change set.

◆ Matrix entries (merge actions) specify how

conflicts between operations are resolved.

Type Op 1 Op 2 Op 3 Op 1 Users Op 2 Op 3 Take both

Change set 2 operations Change set 1

  • perations

Merge action—general form

◆ General form of matrix action is a function

O1, O2 → A1, A2

Name Action Meaning AcceptBoth <OPC, OPR> No conflict SameChanges <∅, ∅> Identical operations AcceptRow <∅, OPR> Row operation only AcceptColumn <OPC, ∅> Column operation only Resolve resolve(OPC, OPR) Externally resolution Merge merge(OPC, OPR) Merge at lower level

Merge matrix—Atomic, Record

Atomic Modify Null Modify Resolve Row Null Column Record Modify(field) Null Modify(field) Merge AcceptRow Null AcceptColumn

Merge matrix—Dictionary

Dictionary Put(key) Remove(key) Modify(key) Null Put(key) Column Row Column Row Remove(key) Column Same Column Row Modify(key) Column Row Merge Row Null Column Column Column

slide-9
SLIDE 9

Merge matrix—Sequence

Sequence Insert(#) Delete(#) Modify(#) Null Insert(#) Both Row Delete(#) Same Column Row Modify(#) Row Merge Row Null Column Column Column

Multiple merge policies

Sequence Insert(#) Delete(#) Modify(#) Null Insert(#) Both Row Delete(#) Same Column Row Modify(#) Row Merge Row Null Column Column Column Sequence Insert(#) Delete(#) Modify(#) Null Insert(#) Users Row Delete(#) Users Users Users Modify(#) Users Merge Row Null Column Users Column

Consolidation Reconciliation

Change sets

◆ Not linear logs ◆ Structured, mirroring structure of

data

◆ more efficient access ◆ automatic compaction ◆ computed as changes are made ◆ operations call setChanged()

Planner Application Change sets

Temporary wall here

Change sets

Temporary wall here

slide-10
SLIDE 10

Change sets

Temporary wall here

Change sets

Temporary wall here “It’s not a table, it’s a wall”

Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(drawings) Modify(discussion) Modify(“Diagram of Internet access room”) Modify(4) Modify(replies) Modify(objects) Modify(shape) Modify(23 Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(drawings) Modify(discussion) Modify(“Diagram of Internet access room”) Modify(4) Modify(replies) Modify(objects) Modify(shape) Modify(23 Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape)

Change sets

Temporary wall here “It’s not a table, it’s a wall”

Merge algorithm

➊ Pair up corresponding changes from change

sets

➋ For each pair:

– Look up action in merge matrix – If action is “merge” call merge procedure recursively on changed structure, else perform indicated action

Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape)

Merge algorithm

PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices)

Merge algorithm

Record Modify(field) Null Modify(field) Merge AcceptRow Null AcceptColumn

slide-11
SLIDE 11

Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position)

Merge algorithm

Record Modify(field) Null Modify(field) Merge AcceptRow Null AcceptColumn

Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape)

Merge algorithm

PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices)

Dictionary Put(key) Remove(key) Modify(key) Null Put(key) Column Row Column Row Remove(key) Column Same Column Row Modify(key) Column Row Merge Row Null Column Column Column

Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape)

Merge algorithm

PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices)

Dictionary Put(key) Remove(key) Modify(key) Null Put(key) Column Row Column Row Remove(key) Column Same Column Row Modify(key) Column Row Merge Row Null Column Column Column

Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape)

Merge algorithm

PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices)

Record Modify(field) Null Modify(field) Merge AcceptRow Null AcceptColumn

Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape)

Merge algorithm

PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices)

Sequence Insert(#) Delete(#) Modify(#) Null Insert(#) Both Row Delete(#) Same Column Row Modify(#) Row Merge Row Null Column Column Column

Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape)

Merge algorithm

PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices)

Atomic Modify Null Modify Column Row Null Column AtomicMergeUnit = true

slide-12
SLIDE 12

Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Record Changes Sequence Changes Modify(drawings) Modify(“Diagram of Internet access room”) Modify(objects) Modify(position) Modify(23 Record Changes Record Changes Atomic Change Position (new position) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape) Dictionary Changes Sequence Changes Record Changes Sequence Changes Sequence Changes Modify(draw ings) M

  • dify

(discussion) M

  • dify(“Diagram of Internet access room”)

M

  • dify(4)

M

  • dify(replies)

Modify(objects) M

  • dify(shape)

M

  • dify(23

Record Changes Record Changes Insert(0) Insert(47 Record Changes Atomic Change DrawingObject (arrow) String (“It’s not a table, it’s a wall”) Shape (new shape)

Merge algorithm

PlanningApplication (Record) Dictionary Sequence Drawing (Record) Drawing (Record) Drawing (Record) Drawing (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) DrawingObject (Record) Sequence String Position (Record) Integer Integer Integer Integer Posting (Record) Posting (Record) Posting (Record) Posting (Record) Sequence String String Posting (Record) Posting (Record) Posting (Record) Posting (Record) drawings discussion (keys) (indices) title text replies subject

  • bjects

position fill_color pen_type y_pos x_pos (indices) (indices)

Sequence Insert(#) Delete(#) Modify(#) Null Insert(#) Both Row Delete(#) Same Column Row Modify(#) Row Merge Row Null Column Column Column

Suite merge tool Synchronization in Sync

User Interface Replicated Object Sync Replication Client Replicated Object Sync Replication Server

  • 1. synchronize()

2. Cr = getChange() 3. synchronizeRequest(Cr)

  • 6. applyChange(S)
  • 7. (3’s reply)
  • 5. <S,C>= mergeChanges(C0, Cr)
  • 8. applyChange(C)

C0 = changes since last synchronization 4. 1 2 3 4

Sync classes

Sync class Purpose Replicated Abstract class inherited by all replicated classes ReplicatedRecord Abstract class for programmer-defined classes with replicated fields ReplicatedAtomic For programmer-defined classes without replicated fields ReplicatedSequence Implements subset of java.util.Vector ReplicatedDictionary Implements java.util.Dictionary, subset

  • f java.util.Hashtable

Large policy space

◆ Merge matrices defined at each structural

level of shared data

◆ Structure × merge matrices = policy space

Subclassing, new types

◆ define new merge action ◆ create new merge matrix ◆ define new change types ◆ override getChanges ◆ override applyChanges

slide-13
SLIDE 13

Solution components

◆ Policy

inheritance

◆ Policy

specification

◆ Policy

implementation

◆ Early and late

validation

➨ Merge- and locking-

aware types

➨ Merge matrices and

lock tables

➨ Subclassing, new

types

➨ merge and lock

algorithms, systems

Sync applications— bibliographic database

◆ Maintains collection of bibliographic references ◆ Insertions with same key should be accepted ◆ Used to demonstrate Bayou and Prospero systems ◆ Implemented with Dictionary, special merge action

Sync applications— conference room scheduler

◆ Used for reserving conference rooms remotely ◆ Automatically blocks conflicting reservations ◆ Used to demonstrate Bayou and Rover systems ◆ Implemented with Dictionary

Sync applications—Issue-Based Information System (IBIS)

◆ Synchronization system must prevent one user

from deleting an item another is responding to

◆ Used to demonstrate flexibility of NT/PV model ◆ Implemented with Record and Sequence

Experience

◆ Several applications to demonstrate flexibility

and ease of specification of Suite and Sync

Application Source Yacc editor Myself Planner Myself Bibliographic database Bayou, Prospero Room scheduler Bayou, Rover gIBIS NT/PV

Experience—specification effort

Application Lines of code Yacc editor Planner 2 Bibliographic database 13 Room scheduler 1 gIBIS

◆ 2000+ lines of code in Sync

slide-14
SLIDE 14

Conclusion

◆ Developed a new model that fulfills more

  • f the synchronization requirements than

existing systems.

◆ Model provides balance between flexibility

and ease of specification

◆ Model used to implement five diverse

applications

◆ Can simulate almost all other systems

Future work

◆ More flexibility for merge matrix ◆ Unify merge matrices and lock tables ◆ Partial-object replication ◆ Implement for WWWNG

More flexibility for merge matrix

Sequence Insert(#) Delete(#) Modify(#) Null Insert(#) Both Row Delete(#) Same Column Row Modify(#) Row Merge Row Null Column Column Column ◆ Current form integrates conflict definition

and conflict resolution

◆ Restricts range of policies

Future work

◆ More flexibility for merge matrix ◆ Unify merge matrices and lock tables ◆ Partial-object replication ◆ Implement for WWWNG

Partial-object replication

Replicated Application data

Current Partial-object

Replicated Application data

Future work

◆ More flexibility for merge matrix ◆ Unify merge matrices and lock tables ◆ More flexible merge protocol, to utilize

  • ne-way messaging services

◆ Partial replication ◆ Implement for WWWNG