Database Replication A Survey of Open Source and Commercial Tools
Database Replication A Survey of Open Source and Commercial Tools
Sailaja P.
Venkataswamy G.
Supriya N. Pal
Research Scientist
Centre for Development
of Advanced
Computing, Bangalore.
Staff Scientist
Centre for Development
of Advanced
Computing, Bangalore.
Associate Director
Centre for Development
of Advanced
Computing, Bangalore.
ABSTRACT
The most critical and important aspect of disaster recovery is to
protect the data from application fail over, natural disasters and
infrastructure failures. Taking frequent backups of the huge
volumes of data and storing it is also an integral part of the
disaster recovery plan. Various scenarios of database replication
strategies and techniques are provided in this survey paper
addressing the need for replication of data. A wide range of open
source and commercial tools have evolved over a period of time
to deal with the issues and challenges involved during the
process of database replication. This paper describes the general
characteristics of replication & disaster recovery. Later the
features of open source and commercial replication tools are
compared.
Keywords
Database replication, Replication strategies, Open source
replication tools, Commercial replication tools.
1. INTRODUCTION
The growing need towards decentralization in any enterprise has
created a strong necessity for database replication. This is
because businesses today are more geographically dispersed and
it is expected to provide location transparency to the employees
of an organization. Unlike centralized environments, replication
may help in availability of data by processing transactions from
remote site and later restoring the data in the event of failures.
Database replication tools can provide efficient mechanism to
replicate the data and maintain backups that can be used when a
disaster occurs.
This survey paper presents different types & characteristics of
replication. In addition the characteristics of open source and
commercial replication tools are presented and the challenges
ahead are described.
The remaining part of this paper is organized as follows: Section
2 describes the fundamentals of replication. Section 3 presents
the features and abstract architecture of open source replication
tools, and the comparison of each of these tools with respect to
different parameters of replication. Section 4 portrays the
commercial replication tools, their functionality and the
comparison of each of these tools with respect to different
parameters of replication. Section 5 describes the Issues and
Challenges in database replication aligned with multiple
replication tools and Section 6 concludes the paper.
2. REPLICATION CONCEPTS
Replication is the process of creation and maintenance of
duplicate versions of database objects in a distributed database
system [1]. Replication improves the performance and increases
the availability of applications by providing alternate data access
options. For example, users can access a local database rather
than a remote server to minimize network traffic and provide
location transparency. Furthermore, the application can continue
to function if parts of the distributed database are down as
replicas of the data might still be accessible.
Database replication is needed in the case of a system failure
where in if a primary copy of the database is failed the secondary
copy will be still there to retain the data. A replication service is
required to maintain data consistency across these diverse
environments. Distribution reduces the network costs for query
access, and it improves application availability and consistency.
2.2.1 Failover
Failover is the process of moving database, metadata and user
connections from a failed or shutdown primary site to a
secondary site so that users can still access the data thus
preserving the availability. Failover may be an implicit or an
explicit process. Full functionality of alternate site or secondary
site is to be ensured in case if disaster happens at the primary
site.
2.2.2 Failback
When the primary site resumes operations, the user performs a
failback to restore the primary site in consistent state. The
restoration process is usually initiated when the load on the
secondary server is less. Otherwise it degrades the performance
of the system.
2.2.3 Active-Active
In Active-Active mode, two servers are configured with
independent workloads [12]. They run on primary and secondary
nodes respectively until one fails. When failover occurs, the
secondary node takes over the primary and resumes activities
until primary server fails back.
2.2.4 Active-Passive
In Active-Passive mode, the services are provided either by the
primary node or by the secondary node. Initially the services are
provided by a primary node before a fail over and by secondary
node after fail over.
3.1 Postgres-R
Postgres-R is an extension to PostgreSQL database which
provides efficient database replication for clusters while
preserving the consistency [4] [10]. It is designed to be as
transparent as possible to the client, stable and secure. PostgresR is primarily used for load balancing and high availability of
database systems. The stretchy architecture of Postgres-R enables
to scale the replication process. Further compared to a
centralized system, Postgres-R is more reliable and flexible.
Postgres-R can replicate large objects and uses a store and
forward asynchronous replica engine. The use of Group
Communication System by Postgres-R helps in adding or
removing nodes, when the system is in running state. The
crashed nodes are detected and removed automatically without
affecting the operations of database system. Postgres-R uses twophase locking for concurrency control with locking at relation
level.
Transaction execution in Postgres-R uses read-one-write-all
approach and the transaction execution is divided into four
phases. In Local Phase, the transaction is executed at local
replica (local database). In Send Phase, the updates to data are
propagated to replicas. In Synchronization Phase Serializability
of the transactions is preserved. In write phase remote replicas
executes the writes and respective replicas execute the
transactions.
The basic architecture of Postgres-R is depicted in figure 1. The
functionality and interfaces supported with PostgreSQL are
available in Postgres-R. Additionally it supports replication.
Ensemble is used for Group Communication System (GCS).
3.2 Slony-I
Slony- I is a "master to multiple slaves" replication system
supporting cascading and slave promotion [6]. Slony-I is a
master-slave system capable of replicating large databases to a
limited number of slave systems. If the number of servers grows
beyond a certain specified limit (Threshold), the communication
cost may increase. The purpose of Slony-I is to maintain data
centres and backup sites where the sites are secured and
normally are available all the time. However if the nodes in
system are frequently prone to failures, Slony-I is not the better
solution for replication.
Slony-I replication system can replicate tables and sequence
numbers [7]. The objects (Tables, Sequence numbers etc.) are
logically grouped into sets. Each set is independent of other
which is originating from the same master. The tables, their
relationships and the sequences used to generate serial numbers
are grouped into their respective sets. Figure 2 describes the
replication configuration of Slony-I.
3.5 Pgpool-II
Pgpool-II is a middleware that acts as an interface between
PostgreSQL database Client and PostgreSQL servers [11]. Since
Pgpool-II is a middleware, the database application i.e. the client
feels that Pgpool-II is the actual Postgres server and the server
visualizes Pgpool-II as one of its client.
Pgpool-II manages multiple servers. The backup is taken on two
or more disks. The replication features of Pgpool-II helps to
availability of the system by providing efficient fault tolerance
mechanism in case of failures.
3.4 DB Replicator
DBReplicator is a powerful open-source & network-based multimaster heterogeneous database replication tool developed in
Java. It provides an API designed to perform asynchronous
update anywhere database replication.
Since DB Replicator is heterogeneous in nature, it synchronizes
the same database between multiple RDBMS. It supports bidirectional data synchronization between any of the supported
back ends where the synchronization process is initiated by the
subscriber. If a relation doesnt exist in the subscriber database,
it creates one to match those in publisher database.
DB Replicator provides automatic conflict detection and
resolution strategy with minimal involvement of a DBA. Basic
conflict resolution is implemented as publisher wins/subscriber
Postgres
-R
SlonyI
Escada
DB
Replicator
PgpoolII
Type
Async
Async
Async
Async
Sync
Update
anywhere
Yes
No
Yes
Yes
Yes
Work-load
partitioning
Yes
No
Yes
No
Yes
Master/
Slave
Yes
Yes
Yes
Yes
Yes
WAN
support
Yes
Yes
Yes
Yes
Yes
Conflict
managmnt
Yes
No
No
Yes
Yes
Auto
detection of
node failure
Yes
No
Yes
No
Yes
Replication
Direct
Agent
Connect
NonSybase
Sybase
Source
Replication
Non-
Server
Sybase
Sybase
Message
Capture
Queue
Apply
Target
Figure 6. Q Replication
EMP
Queue
Redo
Log
Capture
EMP
Queue
Apply
Replicatio
n Tool
Replication Strategy
IBM
Informix
Replication
DB2 Data
Propagator
QReplication
Tools
Sybase
replication
server
Oracle
stream
Recovery Process
Continuous Log
Restore [CLS]
Remote Standalone
Secondary servers
[RSS]
Distribute data to
applications in the
same or different
environments
Replicate all or a
subset of your data
to one or more
locations.
Allows multidirectional
replication
Emergency restart
(ERE) failure
recovery.
Replication server
and Replication
Agents are
responsible for
synchronization &
recovery of data
between similar or
heterogeneous
databases
Asynchronous
Master-Master Replication
Oracle Streams Replication
captures changes from a
source database stages and
propagates those changes
to one or more remote
databases
Recovery of
primary or
secondary database
is achieved with
the help of redo
logs.
6. CONCLUSION
Data base replication is the process of maintaining exact copy of
a database for high availability, recoverability and maintenance.
To achieve the fault tolerance in several applications that uses
databases many replication tools both open source and
commercial came into existence. Synchronous and Asynchronous
replication strategies have their own advantages and
disadvantages. There is a need to implement a better hybrid
replication approach in the existing tools.
The replication tools need to ensure that the database consistency
is preserved across the systems which are available at a
7
7. REFERENCES
[1] May Mar Oo, Fault Tolerance by Replication of
Distributed Database in P2P System using Agent
Approach, International Journal of Computers, Issue 1.
vol.4, 2010.
[2] Sujoy P.Paul, Pro SQL Server 2008 Replication
[3] PostgreSQL 8.4 Server Administration, Volume II- The
PostgreSQL Global Development Group, 1996.
[4] Shuqing Wu, Bettina Kemme, Postgres-R(SI): Combining
Replica Control with Concurrency Control Based on
Snapshot Isolation, ICDE, 2005.
[5] Bettina Kemme, Gustavo Alonso, Dont be lazy, be
consistent: Postres-R, A new way to implement Database
Replication, VLDB, 2000.
[6] Brad Ediger, Advanced Rails, 2007
[7] Jan Weick, Slony-I, A replication system for PostgreSQL