Synchronous replication control

Download Report

Transcript Synchronous replication control

DATABASE REPLICATION
DISTRIBUTED DATABASE
OVERVIEW
Replication : process of copying and maintaining
database object, in multiple database that make
up database system (Oracle docs)
 Changes applied at one site are captured and
stored locally before being forwarded and applied
at each of the remote locations
 The goal of replication is database consistency,
scalability, and availability

MOST OF THE REASON USING REPLICATION
Availability
 Performance
 Disconnected computing
 Network load reduction
 Mass deployment

MUTUAL CONSISTENCY
OVERVIEW
MUTUAL CONSISTENCY
(CONT’D)
OVERVIEW
TWO APPROACHES OF REPLICATION
CONTROL
Synchronous replication control – replica are
kept in sync at all times
 Asynchronous replication control – replica
are not kept in sync at all times

SYNCHRONOUS REPLICATION

All copies of the same data item must show the
same value when transaction access them
SYNCHRONOUS REPLICATION (CONT’D)

Solution :
Transaction is
split into three
transaction (T11,
T12, T13)
 When T1 commits,
all three copies
will have update
accordingly

ASYNCHRONOUS REPLICATION
Copies don’t have to be kept sync at all times
 One of the approaches to implementing sync is
primary copy approach / stored and forward
approach.
 Stored and forward approach :

Primary sites (publisher) : sites were updated first
 Secondary sites (subscriber)
 All transaction are run against first
 Then queued for transaction at secondary sites.

ORACLE REPLICATION

Type of oracle replication
Multimaster replication
 Materialized view replication
 Hybrid configuration (multimaster and materialized
view)

ORACLE REPLICATION (CONT’D)

Multimaster replication
Peer-to-peer or n-way replication – enable multiple
site as equal peers
 Each node is master site
 Each site communicate with the other master site
 Use Asynchronous replication method, but did not
rule to use synchronous

ORACLE REPLICATION (CONT’D)

Materialized view replication
Contains complete or partial copy at of target master
from a single point at time.
 Target master is master table or master site or
master materialized view
 The benefits :

Enable local access
 Offload queries
 Increase data security – allow replicate only
a selected subset of data

ORACLE REPLICATION (CONT’D)

Read only materialized view replication

Benefits :
Eliminate possibility of conflict
 Support complex materialized view

ORACLE REPLICATION (CONT’D)

Updatable
materialized view
Allow insert,
update, delete rows
of target master
 Benefits :

Allow user to query
and update local
replicated data
 Require fewer
resource than
multimaster
replication

ORACLE REPLICATION (CONT’D)

Writeable materialized view
 Users
can perform DML changes on materialized
view, but the changes cannot be pushed back to the
master, and lost if the materialized view refreshes.

Row and column subsetting materialized view

Enable to perform materialized view that contain a
partial copy of data at master table or master
materialized view.