650 likes | 873 Views
DM206 Sybase Replication Agent for Microsoft NT and UNIX. Wanda Beck Senior Software Engineer Enterprise Solutions Division wbeck@sybase.com. e-Business & Replication Quick Replication Overview What is Replication? What are the Components of Replication? What is a Replication Agent?.
E N D
DM206Sybase Replication Agent for Microsoft NT and UNIX Wanda Beck Senior Software Engineer Enterprise Solutions Division wbeck@sybase.com
e-Business & Replication Quick Replication Overview What is Replication? What are the Components of Replication? What is a Replication Agent? Overview
SybaseReplication Agent for Microsoft NT and UNIX Architecture Specific Functions Large Object Replication Function Replication Management by RepServer Manager Heterogeneous Replication Migration from existing Replication Agents Overview (cont.)
Thin Clients PDA Mobile Customer Intelligence Customer Care Change Mgmt Wireless Xchange Self-service Patient Care Insurance Brokerage Banking Capital Mkts Asset Mgmt Investment Bkg Financial Server Other Verticals Financial Server e-Business Infrastructure Telco Server Professional Services Sybase e-Business Strategy Mobile & Wireless Vertical Solutions Enterprise Portal
Integration Availability • Access & Analysis Corporate Information • Plug’n Play with Standard Internet Technologies • Continuous Database Availability • Real-time Database Maintenance & Tuning Productivity • Portal Productivity Technologies • Web Transaction Management Portal-Ready Requirements Database Requirements
Integration Availability • Access & Analysis Corporate Information • Near Real-time Data Replication Primary Data Server Replication Server Replication Agent Productivity • Provide Corporate Data Where It’s Needed Sybase Replicatione-Business Infrastructure
Batch or Snapshot Updates Can be large amounts of data Data is not up to date Real-time Updates Application based ( e.g., 2-phase commit ) Not easily expanded Transaction Replication Sybase Replication Quick Replication Overview Replication Choices
Sybase replication maintains replicated data in multiple databases while ensuring the integrity and consistency of the data Sybase replication can replicate subsets of data at the table, data row, or column level Sybase replication supports heterogeneous data servers Sybase replication uses a basic publish-and-subscribe model Quick Replication OverviewTransaction Replication
Remote Distribution Provide immediate access to current information such as inventory, pricing Corporate Rollup Provide immediate updates to central decision support applications Acquisition Local Duplication Quick Replication OverviewAdvantages of Replication
Provides clients with local access to enterprise data Improved performance and greater data availability Replicate databases contain accurate, current copies or subsets of data from a primary database Allows slower, process-intensive queries to run against the same data without slowing mission-critical applications Quick Replication OverviewAdvantages of Replicating Local Data
Primary Database Replication’s Main ComponentsPrimary Database
The primary database is the source of the replicated transactions Transactions are replicated by table or procedure A primary table or procedure must be identified (marked) for replication so that a Replication Agent can replicate the transactions affecting the data in that table Replication’s Main ComponentsPrimary Database
Replication’s Main ComponentsReplication Agent Primary Database Replication Agent
Replication Agent transfers transactions from the primary database to Replication Server for distribution to replicate databases Accesses transactions in a transaction log Generates Log Transfer Language commands (LTL) for Replication Server Replication’s Main ComponentsReplication Agent
RSSD Replication’s Main ComponentsReplication Server & RSSD Primary Database Replication Agent Replication Server
A Replication Server may be a primary, or a replicate, or both Replication Server replicates data to one or more replicate sites Transactions are stored in stable queues Replication Server guarantees transaction delivery Replication Definitions and Subscriptions Information is stored in the Replication Server System Database (RSSD) Replication’s Main ComponentsReplication Server & RSSD
RSSD Replication’s Main ComponentsReplicate Database Primary Database Replication Agent Replication Server Replicate Database
The replicate database is any target that will hold the results of replicated transactions Sybase supports various targets, including: Direct Connect: DB2, Oracle, Informix InfoHub: DB2, VSAM, IMS, IDMS, ADABAS OmniConnect: DB2, Informix, Oracle, DEC RDB, Ingress, SQL Server Replication Driver for ODBC: Lotus Notes, Microsoft SQL Server, Microsoft Access Replication’s Main ComponentsReplicate Database
Replication’s Main ComponentsSummary Primary Sites ReplicateSites • Adaptive Servers/IQ/ Anywhere/ Enterprise Replication Agents Replication Server • DB2 • AS/400 • Oracle • ODBC • Informix • MS SQL • UDB DirectCONNECT OmniCONNECT • OS/390 DB2 • Adaptive Server Enterprise • Adaptive Server Anywhere • Replication Toolkit for MVS • Oracle • Informix • Microsoft SQL Server • IBM DB2 Universal Database Mobile Users SA SQL Remote Adaptive Server Anywhere
RepAgent - for Adaptive Server Log Transfer Manager (LTM) - for Sybase SQL Server data servers Replication Agents for foreign data servers: IBM DB2 Replication Toolkit for MVS Oracle Informix Microsoft SQL Server IBM DB2 Universal Database Which Replication Agent For Your System?
Transaction Log Application Interface Log Reader Log Transfer Interface Log Transfer Manager Architecture:What makes a Replication Agent?
RepServer Primary Data Server What makes a Replication Agent?Transaction Log Transaction Log Replication Agent
This can be a log provided by the Primary Database ( e.g., DB2 ) or can be created by the Replication Agent ( Sybase Replication Agent ) The log must contain: Transaction begin/commit boundaries Operation type ( Insert, Update, Delete ) Before and after images of the data Column metadata What makes a Replication Agent?Transaction Log
RepServer Transaction Log Reader Primary Data Server What makes a Replication Agent?Application Interface and Log Reader Transaction Log Application Program Interface Replication Agent
Application Interface The set of exposed commands that allows configuration or manipulation of the Replication Agent’s processing and selection of objects to be replicated Log Reader The Log Reader reads the Transaction Log data for changes to tables marked for replication. It retrieves all the relevant information and delivers it to the Log Transfer Interface. What makes a Replication Agent?Application Interface and Log Reader
RepServer Transaction Log Reader Primary Data Server What makes a Replication Agent?Log Transfer Interface LTL Log Transfer Interface Transaction Log Application Program Interface Replication Agent
Translates the command structures received from the Log Reader into Log Transfer Language (LTL) Batches the LTL in a buffer, and delivers the buffer to the Replication Server Replication Server translates the LTL statements into transactions to be applied at the replicate site(s) What makes a Replication Agent?Log Transfer Interface
RepServer Transaction Log Reader Primary Data Server What makes a Replication Agent?Log Transfer Manager Log Transfer Manager LTL Log Transfer Interface Transaction Log Application Program Interface Replication Agent
The Log Transfer Manager is the controlling agent Manages the interaction of the Log Reader and Log Transfer Interface Manages connections to the Primary Database and Primary Replication Server What makes a Replication Agent?Log Transfer Manager
RepServer Transaction Log Reader Primary Data Server What makes a Replication Agent?Summary Log Transfer Manager LTL Log Transfer Interface Transaction Log Application Program Interface Replication Agent
Object-Oriented model written in Java The “Write Once, Run Anywhere” promise Memory Management Speed JDBC ( Java DataBase Connectivity ) for Primary database communication Simplifying the communication topography Architecture:Sybase Replication Agent
Message and Trace Logs Configuration File Architecture:Sybase Replication Agent Sybase RepAgent
JDBC Driver Primary Data Server Primary Database Message and Trace Logs Configuration File Architecture:Connectivity to Primary Database Sybase RepAgent
JDBC Driver RepServer jConnect Primary Data Server Primary Database Message and Trace Logs Configuration File RSSD Architecture:Connectivity to Replication Server Sybase RepAgent
JDBC Driver RepServer jConnect isql isql Primary Data Server Primary Database Message and Trace Logs Configuration File Administrator RSSD Architecture:Administration - isql Sybase RepAgent
RSM JDBC Driver RepServer jConnect Primary Data Server Primary Database Message and Trace Logs Configuration File Administrator RSSD Architecture:Administration - RSM Sybase RepAgent
RSM JDBC Driver RepServer jConnect isql Primary Data Server Primary Database Message and Trace Logs Configuration File Administrator RSSD Architecture:Administration Sybase RepAgent
Triggers are added to each table Transaction information is stored in “shadow” tables and transaction logs that exist in the primary database Other tables are installed in the Primary Database for other housekeeping Stored procedures and functions to reduce network traffic and improve turnaround Architecture:Sybase RepAgent Transaction Log
Architecture:Sybase RepAgent Transaction Log (cont.) Primary Tables AUTHORS TITLES PUBLISHERS Transaction Log Tables preTRAN_LOG_ preSH_a preSH_b preSH_c shadow tables
Trigger Insert into Authors Architecture:Sybase RepAgent Transaction Log (cont.) preMARKED_OBJS_ Insert preSH_a AUTHORS preTRAN_LOG_
RepServer JDBC Driver jConnect Transaction Log Reader ChangeSet Queue Architecture:Sybase RepAgent Replication Log Transfer Manager JDBC Result Sets LTL Log Transfer Interface Sybase Replication Agent
Primary Database Impact Oracle: With Sybase Replication Agent on Oracle and logging turned on, the Oracle server takes about four times as long to complete the same transaction set Informix: With Sybase Replication Agent on Informix and logging turned on, the Informix server takes not quite three times as long to complete the same transaction set Note: These are casual comparisons Architecture:Sybase RepAgent Transaction Log (cont.)
Configurable Transaction Log Naming Configurable Transaction Log Location Optional Script Execution Object Marking Tables, Stored Procedures, Large Objects Case-sensitive names are supported Multi-part names are supported (e.g., owner.tablename) Aliases or synonyms are supported “Replicated As” Disabling Replication Individual marked objects Sybase Replication AgentSpecific Functionality
Transaction Log Management Manual or Automatic Truncation Accessing the RSSD Filter out columns not included in the Replication Definition Remove column names from the LTL Filtering Maintenance User Transaction LTL Column Compression Specific Functionality ( Cont. )
Internal Statistics Generation Logging and Tracing One installation can execute multiple instances of the Replication Agent Specific Functionality ( Cont. )
Increased Flexibility Over 100 commands and configuration options Simplified topology Improved Performance Multi-threaded Reduced Network Traffic Usability Log Management, Tracing Specific FunctionalitySummary
Large Objects ( LOB ) Character or Binary LOB columns are marked independently Performance Concerns Those highly concerned with replication performance should avoid LOB replication. Put LOBs in their own tables Logging Limitations Fetching data directly from the primary database Transaction Integrity Concerns More Features: LOB replication
Insert webdata values ( ‘Cat’, cat.jpg ) Insert operation gets current value IMAGE Id IMAGE Id IMAGE Cat cat.jpg Cat dog.jpg Update webdata set image = dog.jpg where Id = ‘Cat’ Update operation gets current value IMAGE Id IMAGE Id IMAGE Dog dog.jpg Dog dog.jpg Commit More Features: LOB replicationTransaction Integrity Concerns
Function Replication for Performance A procedure that updates 50,000 rows can be replicated to execute the same procedure at the replicate database instead of replicating 50,000 rows of update operations Supports both ‘Applied’ and ‘Request’ Function Replication Applied Function executed at the primary Request function executed at the replicate Disabling Replication More Features: Function Replication
Function ReplicationApplied Function Execute “mass_update” Execute “mass_update” Replication Agent Replication Server START