Free Newsletters:
DatabaseJournal  
DBANews
Database Journal
Search Database Journal:
 
HOME News MS SQL Oracle DB2 Access MySQL PostgreSQL PHP SQL Etc Scripts Links Discussion
internet.com

» HOME
» NEWS
» FEATURES
» SERIES
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Products
Scripts
Links
» DISCUSSION
» TECH JOBS

Marketplace Partners
Be a Marketplace Partner




internet.commerce
Be a Commerce Partner
Promote Your Website
Logo Design
Server Racks
Memory
Baby Photo Contest
Promos and Premiums
Boat Donations
Promotional Gifts
PDA Phones & Cases
GPS
Desktop Computers
Dental Insurance
Shop Online
Promotional Products




MySpace Joins eBay, Yahoo in Open Profile Push

News Corp. Unit Under Fire for Ties to Hacker

Are Non-PC Devices Hurting 'Net Innovation?

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Linked Data Planet Conference & Expo

CA ERwin® Data Modeler Proven database design and modeling. Efficiently analyze, design and deploy effective database solutions. Whitepaper: Manage SQL Server Deployments
Try it free: CA ERwin® Data Modeler


Solaris 8 Migration Assistant
Rapidly move your Solaris 8 application environments to new systems running Solaris 10 with the Solaris 8 Migration Assistant. Reduce migration risk while taking advantage of increased performance, reliability and security of the latest SPARC hardware platforms and Solaris 10 OS. »

 
Sun Eco Innovation: Good for Business, Good for the Environment
A complete solution to help you optimize and refresh your datacenter while properly recycling equipment and eliminating eWaste, including money-saving promotions to lower hardware acquisition costs. »

 
Sun Eco Innovation: Power Calculators
Power consumption has increasingly become a priority in customer's minds when purchasing new systems or storage. Sun's Power Calculators provide data on power consumption of Sun products allowing IT managers to better plan the power requirements in the datacenter to achieve better energy and cost savings. »

 
Optimize the Web Tier: Consolidate to Get More Performance in Less Space and Lower Power Consumption
Expansion in the Web tier is generally accomplished by adding more servers whenever extra capacity is needed. As the pool of servers grows larger, however, the complexity of the environment can grow exponentially. »

Production Manager (hands on)
Aquent
US-MA-Cambridge

Justtechjobs.com Post A Job | Post A Resume
Sybase
March 4, 2008
A High Availability Data Synchronization Architecture

by Joshua Savill

Introduction

Data synchronization has become an important part of many corporate information systems. Synchronizing high availability databases and setting up synchronization systems without single points of failure are two challenges that organizations face as they bring synchronization systems to the 24/7 requirements of modern data systems.

Data Synchronization

In data synchronization environments, there is a transport mechanism to facilitate data transfer from the remote database to the consolidated database and vice-versa.


Figure 1 – Synchronization Process

Each database management solution has different mechanisms to resolve data synchronization. Sybase iAnywhere’s MobiLink Synchronization software provides a highly scalable session-based synchronization system that allows bi-directional synchronization between a main database, called the consolidated database, and many remote databases. The consolidated database can be one of several ODBC-compliant databases, including SQL Anywhere, Sybase Adaptive Server Enterprise, Oracle, Microsoft SQL Server, and IBM DB2.


Figure 2 – Sybase iAnywhere’s MobiLink Synchronization System

To create a synchronization system without a single point of failure, redundancy must be built in to each component of the system.

Database Mirroring

As corporations move towards always available data and occasionally connected applications, it is increasingly important to ensure enterprise database management systems remain functional and online in 24/7 environments. Database mirroring is an availability and disaster-recovery technology for database management systems to ensure data and data synchronization is available anytime.

A database mirroring system is a configuration of either two or three database servers, each running on separate computers, which cooperate to maintain copies of a database. Database mirroring consists of a primary server, mirror server, and arbiter server. The primary server and mirror server each maintain a copy of the database files while the arbiter server helps determine which of the other two servers can take ownership of the database. The arbiter server does not maintain a copy of the database.


Figure 3 – Database Management System Configured with High Availability

High Availability for Consolidated Database

Database mirroring builds high availability into the consolidated database. The dotted line in figure 4 represents the failover of the synchronization server if a role switch occurs in the database mirroring environment.


Figure 4 – High Availability for Consolidated Databases

High Availability for Synchronization Servers

Configuring a database mirroring environment still leaves a single point a failure in the data synchronization system. Figure 4 shows a single point of failure with the synchronization server. Using multiple synchronization servers and load balancers (failover cluster) can remove the single point of failure in the system. The dotted lines in figure 5 represent the failover of the synchronization server if a role switch occurs in the database mirroring environment or if there is a failure of synchronization server #1.


Figure 5 – High Availability Data Synchronization with No Single Failure

With the introduction of load balancers (failover cluster) and multiple synchronization servers, each component of the data synchronization environment is redundant. The data synchronization system will now function even if hardware or software failures occur in the environment.

High Availability for Remote Databases

A database mirroring environment can be used for configuring the remote database system, but initiating data synchronization is more complex. Data synchronization is initiated when the synchronization client establishes a connection with the remote database and synchronization server. However, in a database mirroring environment it is not always known which database is acting as the primary server.

The synchronization client needs to establish a connection with the primary server (or mirror server if role switch has occurred), so logically the synchronization client should be located on the same machine as the remote database. This allows the synchronization client to connect to the active database and prevents a single point of failure in the system.

High Availability for Synchronization Clients

A solution is to install the synchronization client on both the primary and mirror server machines then initiate synchronization through an external procedure.


Figure 6 – High Availability for Remote Databases

This can be accomplished with xp_cmdshell. The xp_cmdshell system procedure allows the execution of operating system commands directly to the Windows command shell via SQL code. This does not require knowing which machine is designated as the primary server, because:

  • When an application calls this external procedure, it will only be fired on the computer that is currently designated as the primary database server.
  • The synchronization client is called relative to the database server, so will not have any problem finding the database files.

Here is an example of an external procedure to initiate synchronization:

CALL xp_cmdshell( 'START dbmlsync -c dsn=MyDB -k -o c:\\out\\ml.out 
        -n MyPub -e sv=Version1', 'no_output' )

The xp_cmdshell process can be initiated through an application connection or via system process on the database server machine.

Removing Single Point of Failure with High Availability Synchronization Clients

In a database mirroring system, at least two machines must fail before the entire synchronization system fails. However, in the above solution, if the machine running the synchronization client fails then synchronization fails. To avoid this single point of failure an implementation using an external procedure called via a scheduled event that is stored in the database on both database servers will be sufficient. This prevents the need for an external application to initiate data synchronization. Scheduled events are a feature of Sybase iAnywhere’s SQL Anywhere that allows logic to be triggered based on a predefined schedule. The event will only fire on the server that is currently the primary server.

Here is an example of a scheduled event to call the external procedure:

CREATE EVENT "SyncEvent" 
HANDLER
BEGIN
     event_parameter( 'NumActive' )
     IF CAST( event_parameter('NumActive' ) AS INTEGER ) > 1 THEN RETURN;
     END IF;
     CALL xp_cmdshell( 'START dbmlsync -c dsn=MyDB -k -o c:\\out\\ml.out 
            -n MyPub -e sv=Version1', 'no_output' )
END;
ALTER EVENT "SyncEvent"
ADD SCHEDULE "daily_sync"
     EVERY 10 MINUTES BETWEEN '09:00:00' AND '22:00:00';

In this statement, the event parameter NumActive is used to ensure that an instance of synchronization is not already running. Synchronization is scheduled to occur every 10 minutes during business hours.

Summary

Corporations are going to continue to move towards always available data and occasionally connected applications. This will continue to increase the importance of enterprise database management systems to remain functional and online in 24/7 environments.

Database mirroring is an effective way to provide database availability and disaster-recovery for data synchronization environments. Failover of database mirroring environments is both fast and automatic, providing seamless, reliable service. Coupled with initiating synchronization from the remote database using the xp_cmdshell in a scheduled event will eliminate single points of failure in the mirrored architecture.

References

http://www.ianywhere.com/developer/product_manuals/sqlanywhere/

Author

Joshua Savill is a Product Manager of data synchronization technologies for Sybase iAnywhere.

Tools:
Add databasejournal.com to your favorites
Add databasejournal.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

Sybase Archives

Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers. Sponsored by HP, Citrix, and Intel.
Learn about expanding business opportunities for the reseller channel. Visit IT Channel Planet.
Five Trends for Application Development. Download Your Complimentary Report. Exclusive. Act Now.
Data Sheet: IBM Information Server Blade
Flash Demo: Learn how IBM Information Server Blade is easy to manage, highly scalable and efficient.


Latest Forum Threads
Sybase Forum
Topic By Replies Updated







JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES