booking system
DESCRIPTION
Booking System. Tzu-Han Wu15524883 Yi-Chi Chiang54641046 Han-Yang Ou 59283702. Introduction – Booking System. Motivation Avoid over-booking Features Show seats status in real-time Multi-server processing in distributed environment Fully replication Load balancing - PowerPoint PPT PresentationTRANSCRIPT
Booking SystemTzu-Han Wu 15524883Yi-Chi Chiang 54641046Han-Yang Ou 59283702
Motivation◦ Avoid over-booking
Features◦ Show seats status in real-time◦ Multi-server processing in distributed environment◦ Fully replication◦ Load balancing◦ Add servers dynamically
Implementation◦ JAVA RMI◦ Mutual exclusion: altered Ricart-Agrawala algorithm
Introduction – Booking System
Client 1
Client 3
Client 2
Server 1Server 2
New Server
S1
S2
M
S3
N
Notify new server
Send other servers info and status of seats
Notify other servers new server coming
At the same time, the other server may send seat status update messages
The new server should compare the version and decide to update or ignore the messages
ID: 103
Connection RequestClient address
Ask appropriate server
New Client
S1
S2
M
S3
C101
C102
C202
C204
C205 C306
C301
C003
C001
C005
N
Reply address of S1
C103
Ask status of seatsReply status of seats
S1
S2
M
S3
C101
C102
C202
C204
C205 C306
C301
C003
C001
C005
The other server set flag 5 to trueThe other servers send OK to S2
Flag 5: True
Request Assume seat 5 is availableC204 send seat 5 request message to S2
Flag 5: false
Flag 5: false
Flag 5: false
Flag 5: false
S2 set flag 5 to trueS2 send seat request to other server
Flag 5: true
Flag 5: true
Flag 5: true
S2 sends update notification to other serversServers sends update notification to clients
Release
S1
S2
M
S3
C101
C102
C202
C204
C205 C306
C301
C003
C001
C005
Assume seat 7 is occupied by C202
Flag 7: true
Flag 7: true
Flag 7: true
Flag 7: true
C202 sends release message to S2S2 sets flag 7 to false
Flag 7: false
S2 sends update notification to other serversServers send update notifications to clients
Flag 7: false
Flag 7: false
Flag 7: false
Other servers set their flag 7 to false
CommitmentS2 sends seat 2 update notifications messages to other serversS2 sends seat 3 update notifications messages to other serversServers send seat 2 update notifications to clients
S1
S2
M
S3
C101
C102
C202
C204
C205 C306
C301
C003
C001
C005
Assume C205 has requested seat 2 and 3
Flag 2: true
Flag 2: true
Flag 2: trueFlag 3: true
Flag 3: true
Flag 3: true
Flag 2: trueFlag 3: true
C205 sends commit message to S2Servers send seat 3 update notifications to clients
5 clients 10 clients 15 clients 20 clients0
20
40
60
80
100
120
3 servers2 servers1 server
ms
Performance Measurement