Title: Data Replication in Mobile Ad Hoc Networks
1Data Replication in Mobile Ad Hoc Networks
- Project Group PaMANet
- December 18, 2003
- Marcel Tiemeyer
2Overview
- Replication
- Broadcasting Invalid Reports (IR)
- Advanced broadcasting Hybrid Predicate Invalid
Reports (HPIR) - Performance of HPIR-Broadcasting
- Outlook
3Replication Why?
- Advantages
- Local availability of data
- Fast local access
- No permanent connection to master-database
- Limited bandwidth and broken connections only
smaller problem - Less workload on server
- Disadvantages
- Transferring updated data from one database to
all other databases
4Symmetric/Asymmetric replication
- Symmetric
- All copies are equal in all respects
- Asymmetric
- Designated copy (master) might have very
different role than other copies (replicas)
5Single/Floating/Multi Master
- Single master
- Only one master can perform updates
- Replicas read-only
- Floating master
- Like single master
- Master goes down ? one replica chosen to be new
master - Multi master
- Multiple master copies with read/write access
- Conflict resolution strategies/transactions
necessary
6Classification
- If users have access to inconsistent data, they
may possibly make wrong decisions ? classified
by latency - Synchronous replication data must be totally
consistent at all times - latency is zero
- Asynchronous replication data must have
acceptable level of inconsistency for short
period of time - latency is greater than zero
7Synchronous replication
- Can be achieved by two-phase-commit
- Coordinator issues update-statement to clients
- Clients begin updating
- Coordinator asks for commit
- Clients answer commit or rollback
- If all clients answer commit coordinator
notifies clients of successful updateElse
coordinator sends rollback to all clients - Clients notify coordinator
8Voting
- Can also be achieved by voting (quorum)
- coordinator asks all clients to vote OK or not
OK for current operation - if enough clients (e.g. half of the clients for
write-operations, one third for
read-operations) vote OK operation is
performed - weighted voting (e.g. master has five votes,
clients only one) possible - Make sure, that
- Qw(A) Qw(A) gt W(A) (only one write-operation)
- Qr(A) Qw(A) gt W(A) (no read- and
write-operation)
9Snapshots
- Snapshot is simple example for asynchronous
replication - Read-only-copy of master is taken
- Snapshot only consistent from moment of
snapshot-taking to first update on master
10Broadcasting IR-messages
- Ruling principles
- Server sends broadcast-messages to all clients
(e.g. every 10 minutes) including all updated/new
records (since last broadcast) - Clients request and download changed records
- New disadvantages
- Many messages not necessary for all clients
- Clients do not know, if they can satisfy a query
locally - Waste of bandwidth
11Hybrid Predicate Invalid Report (HPIR)
- Server still sends broadcast-messages containing
changed records to all clients - Clients still request and download changed records
- but
- HPIR contains more information
- Clients can decide whether they need updated
records or not - Clients know, if they can satisfy a query locally
12Schematic diagram
Server
Clients
HPCD
PR-Tree
Cache
data
update
Update-queue
Broadcast-queue
HPIR-Item
13(Non-)Location Dependent Attribute (LDA/NLDA)
- Strategy based on Location Dependent Data (LDD)
- Relation divided into
- LDAs Location Dependent Attributes (e.g.
x-position, y-position) - NLDAs Non-Location Dependent Attributes
14Example traffic information system
somewhere the distance (e.g. at
x-position150 and y-position70)
free parking space??
- every parking space has the following attributes
- x-position
- y-position
- full
- name
Location Dependent Query (LDQ) Give me all free
parking lots within 10 km which are not full
represented as Q(fullfalse) and
(140x-position160) and (60y-position80)
LDAs
NLDAs
15Hybrid Predicate Invalid Report (HPIR)
- Hybrid Predicate Invalid Report is broadcasted
and contains - Hybrid Predicate Representation (HPR)
- Operation (PU, RU)
- Timestamp
- RecordID (only for PU)
16Hybrid Predicate Representation (HPR)
- Hashed LDAs
- Hashed by multi-attribute hashing functions (Ax ?
ax, Ay ? ay ) - Each LDA hashed separately
- Additional string to indicate exact range value
(ax, ay) - NLDAs not hashed (they stay a3,,an)
- Predicate for LDQ axay,ax,ay,a3,,an
17Example (continued)
Hybrid Predicate of LDQ Q(fullfalse) and
(140ltx-positionlt160) and (60lty-positionlt80)
denoted as 001000,4060,6080,0,
Hashing function
- 000 xlt100
- 001 100xlt200
- 010 200xlt300
- 011 300xlt400
- 100 400xlt500
- 101 500xlt600
- 110 600xlt700
- 111 700x
H(x)
18Operations
- Point Update Operation (PU)
- Only one record is updated
- Range Update Operation (RU)
- Set of records (depending on range predicate) is
updated
19R-Tree
- Data is stored in a PR-Tree which is based on
R-Trees - Tree-structure designed for spatial searches
- Height balanced
- Dynamic index structure
- n-dimensional
- Leaf nodes contain index records which contain
pointers to data objects - Derivation (PR-Tree) is used on server
20PR-Tree
- Leaf node stores
- Rectangle section depending on LDAs
- Update frequency
- Query frequency
- Timestamp of last update
- Timestamp of last query
21Insertion algorithm (server)
- After Location Dependent Query (LDQ) is executed,
server may insert LDAs into PR-Tree - Compute set of hashing sections
- Update query frequency and timestamps
- If tree contains rectangle return result and
attach code n_covered - Else If update-(query-) frequency is too high
(low), do not insert into tree but return result
and code n_discarded - Else insert rectangle into tree and return code
n_cached
22HPIR-Queue
- HPIR-Queue stores HPIR-items for records affected
by update until next broadcast - Construction
- Update values
- Find affected leaf nodes
- Construct new HPIR
- Insert into HPIR-queue
23Storage on client - HPCD
- Hybrid Predicate Cache Description (HPCD)
contains - ID
- HPR of data records received from server
- Content (pointer to real data buffer)
- Update queue (records to be retrieved)
- Timestamp of last update
- Update-count
24Updating HPCD (client)
- Listen to HPIR-Broadcasting, download HPIRs which
correspond to local HPCD - Point Update
- If recordID is in cache update
- If not cached and all attributes satisfy
predicate of HPCD insert into update queue - Range Update
- Update values which are in the cache
- Find records which would satisfy predicate of
HPCD after the update. Insert conditions into
update queue
25Example (continued)
1. No relevant HPIR received
somewhere the distance
free parking space??
- Local cache is queried
- no records in update queue
- 4 free parking spaces nearby
26Example (continued)
2. HPIR received
somewhere the distance
A parking lot
free parking space??
- Local cache is queried
- Records in update queue ? download data from
server - Only 2 free parking spaces nearby
27Performance
- 200 clients
- 2000 records in database
- 10 minute broadcast interval
- 600 hot records
- Probability of accessing hot data 80
28Benefits of this approach
- Client queries server only if query uses records
stored in update queue - Client can update some cache content locally
instead of downloading modified data - Decision whether query can be satisfied locally
is easy - ? HPIR can reduce transmission
29Outlook
- No LDD but some kind of partitioning
- Broadcasting e.g. per access-point is not too
expensive - Intelligent broadcasting could be solution for us
30- Thank you for your attention!
- Any questions?