Version 3.1.1
 —  Concepts  —

Event Replicator for Adabas Architecture

This document describes the architecture of the Event Replicator for Adabas and covers the following topics:


Overview

The Event Replicator for Adabas is not an application in the traditional sense. Rather, it is made up of several components that work together to replicate data to a target application without disrupting normal Adabas operations. A portion of the replication task occurs within the Adabas nucleus address space, while another portion of the task occurs within an address space known as the Event Replicator Server.

Pictured below is a diagram of the Event Replicator for Adabas architecture and the main components involved.

graphics/rep_proc.png

As depicted in the diagram, the Event Replicator for Adabas consists of the following main components:

Administration Tools

Definitions and settings required for replication can be specified in any of the following ways:

In addition, the Adabas Online System (AOS) can be used to maintain the definitions for the source Adabas database as well as the Event Replicator database used by the Event Replicator for Adabas and it can be used to activate and deactivate replication resources. For more information on how it can be used to activate and deactivate replication resources, read Managing Replication Definitions from AOS.

Adabas Nucleus

The Adabas nucleus is a set of programs that control an Adabas database and coordinate all of its work.

Event Replicator Nucleus

The Event Replicator nucleus is a set of programs that control the Event Replicator Server database and coordinate all of its work. This includes the replication server components that parse and process all replicated data received from the Adabas nucleus and receive and process inbound requests from the target application via the messaging system.

Messaging System (EntireX Communicator or MQSeries)

These intermediary systems process messages from the Event Replicator Server and send them to the target application. They also transmit requests from the target application to the Event Replicator Server.

Target Application

The target application is the outside application to which replicated data is sent.

Target Requests

Target requests are requests from the target application to the Event Replicator Server. Such requests include status requests, initial-state requests, and prior-transaction (resend buffer) requests.

Adabas Replication Pool

This buffer area contains the replication data processed by the Adabas nucleus.

Event Replicator Replication Pool

This buffer area contains transformed replication data processed by the Event Replicator Server.

Top of page

Operation and Administration

The operation and administration features of Adabas allow you to activate replication, define files to be replicated, and configure other Adabas features related to the Event Replicator for Adabas. Event Replicator for Adabas administration also involves the configuration of both the Adabas nucleus and the Event Replicator Server components.

You can perform Event Replicator for Adabas administration tasks using standard Adabas utilities and database initialization parameters, the Adabas Online System (AOS) and its Adabas Event Replicator Subsystem, or Event Replicator Administration. For more information on Adabas database administration related to replication, read Adabas Nucleus Administration; for information on Event Replicator database administration necessary for replication, read Event Replicator Server Nucleus Administration.

Top of page

Adabas Nucleus Administration

This section covers the following topics related to replication and the Adabas nucleus.

Replication Setup

The following replication setup should be performed for an Adabas database you want replicated.

The ADAREP utility provides information about the status of replication for the database and files, as well as for the Event Replicator Server.

Nucleus Processing

During session start, the Adabas nucleus performs the following tasks:

After replication is started for the Adabas nucleus, the following replication processing occurs:

  1. For each user, the nucleus tracks and places in the replication buffer information related to modifications to each record in each file selected for replication. To track modifications, the Event Replicator for Adabas captures the before and after images (compressed) of all modified data.

  2. The nucleus accumulates replication data for an entire user transaction, as follows:

  3. If any record is modified more than once during a transaction, the nucleus makes available to the outside destination only the final instance of the modification of the record. This is done by consolidating modifications to the same record within the same user transaction, as follows:

  4. The nucleus notifies the Event Replicator Server when a transaction with replicated data has been committed.

  5. The nucleus makes the replication data available to the Event Replicator Server.

  6. The nucleus discards the replication data for the Adabas replication pool after it has been fully processed by the Event Replicator Server.

Notes:

  1. The presence of the Event Replicator Server has minimal impact on any Adabas session in terms of the performance (CPU consumption, throughput, response time) of an Adabas database, in comparison to it running without replication active.
  2. In a clustered environment, the Event Replicator for Adabas supports replicated data coming from multiple Adabas nuclei that are active for the same database.

For information on the Adabas nucleus settings, see Adabas Initialization (ADARUN) Parameters and Utilities Used with Replication .

The Adabas Replication Pool

Replicated information is buffered in the Adabas nucleus in a new replication pool. The replication pool is updated solely by the code within the Adabas nucleus address space. The size of this pool is set by the ADARUN LRPL parameter.

The Adabas replication pool may become full if:

When the Adabas replication pool becomes full, the replication system will deactivate replication for a file and a message is issued indicating which file was deactivated. When replication is inactive for a file, Adabas does not collect any further replicated updates for the file. Deactivated files may be explicitly reactivated via the ADADBS REPLICATION function once pool storage becomes available.

You can request warning messages when the replication pool usage exceeds a threshold that you specify using the ADARUN parameter RPWARNPERCENT. An initial message will be generated when this value, expressed as a percentage of replication pool usage, is exceeded. Additional messages will be generated when usage increases or decreases by the value you specify with ADARUN parameter RPWARNINCREMENT.

To avoid flooding the console with warnings, you can specify ADARUN parameters RPWARNMESSAGELIMIT and RPWARNINTERVAL. If more than RPWARNMESSAGELIMIT warnings are issued within the number of seconds specified by RPWARNINTERVAL, further warnings will be suppressed for the duration of the interval. When the interval expires, you will receive a message showing how many warning were suppressed, and warning messages can then resume.

Top of page

Event Replicator Server Nucleus Administration

The Event Replicator Server parses all replicated data received from the Adabas nucleus and receives inbound initial-state requests from the target application through the messaging system. This section covers the following topics related to the Event Replicator for Adabas and the Event Replicator Server:

Replication Setup

The following replication setup should be performed for an Event Replicator Server database.

The ADAREP utility provides information about the status of replication for the Event Replicator database and files, as well as for the Adabas database.

Event Replicator Server Processing

The following description summarizes the processing performed by the Event Replicator Server:

  1. The Event Replicator Server establishes contact with Adabas nuclei for the related database IDs. If an Adabas nucleus is not yet active, the nucleus contacts the Event Replicator Server during nucleus initialization.

  2. The Event Replicator Server processes the received modified data according to the subscriptions defined in the replication definition parameters.

  3. After processing the data, the Event Replicator Server may apply user-customizable logic to the replication process (for example, filtering, conversion, or transformation). The Event Replicator Server then delivers the replicated data to the messaging system destination for replication to the target application.

    Each replicated transaction delivered to a target is assigned a unique sequence number. This sequence number is generated for each unique subscription-destination combination of the replicated transaction. In other words, if the same replicated transaction is delivered to two different destinations by a subscription, that transaction may have two different sequence numbers (one for each destination).

    Initial-state requests may be needed to resolve an ambiguous state incurred by the target application; the request can contain requests for a single record, a set of records, or an entire file.

  4. The Event Replicator Server notifies the appropriate Adabas nucleus when transaction replication is completed and then removes all information aobut the completed transaction from the Event Replicator Server replication pool.

An Event Replicator Server may process data from multiple databases. Replication data for one Adabas file must be processed by a single Event Replicator Server. No two Event Replicator Servers handle the same set of files from the same database.

The Event Replicator Replication Pool

A replication pool (separate from the Adabas replication pool) is allocated in the address space of the Event Replicator Server. The size of this pool is set by the ADARUN parameter LRPL. This pool is used by the replication code running in the Event Replicator Server address space. It is used to store the decompressed and transformed data, along with other information.

The Event Replicator replication pool may become full if:

When the Event Replicator replication pool becomes full, the replication system may deactivate its resources, including destinations, subscriptions, files, or databases. The replication system determines and deactivates the resource having the greatest impact on the Event Replicator replication pool usage.

You can request warning messages when the replication pool usage exceeds a threshold that you specify using the ADARUN parameter RPWARNPERCENT. An initial message will be generated when this value, expressed as a percentage of replication pool usage, is exceeded. Additional messages will be generated when usage increases or decreases by the value you specify with ADARUN parameter RPWARNINCREMENT.

To avoid flooding the console with warnings, you can specify ADARUN parameters RPWARNMESSAGELIMIT and RPWARNINTERVAL. If more than RPWARNMESSAGELIMIT warnings are issued within the number of seconds specified by RPWARNINTERVAL, further warnings will be suppressed for the duration of the interval. When the interval expires, you will receive a message showing how many warning were suppressed, and warning messages can then resume.

Top of page

The Messaging System Destinations

The Event Replicator Server sends replicated data to a messaging system (for example, EntireX Communicator or MQSeries) for delivery to the target application.

The target application may send initial-state requests, status requests, and prior-transaction (resend buffer) requests to the messaging system for delivery to the Event Replicator Server.

For information on integrating the message system with your target application, read Integrating the Messaging System with the Target Application.

Top of page

About Initial-State Data

Normally, only changed data is replicated. However, this presumes that the target system has the same data that the source had before the change. If this is not the case, you need to get an initial version of the data to the target. This is accomplished using an initial-state request.

Initial-state requests must be supported by initial-state definitions. Each request must specify the name of the initial-state definition that should be used, as well as the database ID and file number to be processed. Initial-state definitions are specified in the Adabas Event Replicator Subsystem, Event Replicator Administration, or by INITIALSTATE parameters in the Event Replicator Server startup job.

Initial-state requests are initiated either from the target application (client) to the Event Replicator Server or using the Adabas Event Replicator Subsystem. For information on how to submit an initial-state request from the target application to the Event Replicator Server, read Event Replicator Client Requests. For information on how to submit an initial-state request from the Adabas Event Replicator Subsystem, read Populating a Database With Initial-State Data.

Initial-state data can contain any subset of the data on the Adabas database, based on the specifications in the initial-state definition and parameters supplied in the initial-state request. Records can be selected for initial-state processing in one of the following manners:

Note:
Each replicated initial-state record contains the related data storage after image. No before image is replicated for an initial-state record.

During initial-state processing, the nucleus reads the selected records and passes them to the Event Replicator Server. The Event Replicator decompresses the records depending on the subscription format and sends the data to the assigned output destinations.

For more information, read about maintaining initial-state definitions using Adabas Event Replicator Subsystem or about maintaining initial-state definitions using Event Replicator Administration. For information about the DDKARTE statements required for initial-state definitions, read about the INITIALSTATE parameter .

Top of page

Submitting Requests for Data to the Event Replicator Server

Clients can send specific requests for data to the Event Replicator Server by sending messages to an Event Replicator input queue. The following requests can be made:

For more information about submitting these requests to the Event Replicator Server from the target application, read Event Replicator Client Requests.

Top of page

Replicating Adabas Utility Functions

You can request that some utility functions performed against an Adabas database be replicated to the target application. For example, if you change the field length of a field in an Adabas file, that change can be replicated to the target application. This eliminates the need for you to manually intervene to make the change in the target and eliminates the resulting errors if you do not.

Warning:
In order for this utility replication to work properly, you must ensure that your source and target files are maintained in identical manners. If a utility function is performed against the source file and replicated to a target file that cannot accommodate the utility request, errors will result and replication to the target will fail.

This section covers the following topics:

Limitations

The following limitations exist in utility replication:

  1. Not all utility functions can currently be replicated. In addition, some functions can only be replicated if they are initiated from Adabas Online System (AOS) or Event Replicator Administration. The functions that are currently replicated include:

    Note:
    Event Replicator for Adabas supports the replication of data associated with an ADALOD LOAD or ADALOD UPDATE functions. For more information on this support, read ADALOD LOAD Parameters and ADALOD UPDATE Parameters.

    For complete information on these Adabas utility functions, refer to your online Adabas utilities, Adabas Online System, or Adabas Manager documentation.

  2. Password protection on the target file or database is not supported

  3. Expanded files are not supported. Any segmentation of a file is hidden to the target. So, file deletion functions operate on the logical file.

  4. The functions defining a new FDT, adding new fields, or defining a file, are replicated to all Event Replicator Servers known to the database nucleus. This is because the Event Replicator Server ID is not yet defined for the file (ADADBS REPLICATION function), so all Event Replicator Servers are informed. The functions are only replicated if the Event Replicator Server includes the file in a subscription with appropriate destination settings.

Required Parameters

Replicating Adabas utility functions is controlled by the destination definitions associated with your subscriptions. Using the DREPLICATEUTI parameter in a destination definition, you can control whether utility functions are replicated for that destination. In addition, for Adabas destinations, you can use the DAREPLICATEUTI parameter to control whether utility functions are replicated to a specific target database and file.

For more information about the DREPLICATEUTI and DAREPLICATEUTI parameters in destination definitions, read about the Destination Parameters. For information on using the Adabas Event Replicator Subsystem or Event Replicator Administration to maintain destination definitions, read Maintaining Destination Definitions Using the Adabas Event Replicator Subsystem or Maintaining Destination Definitions Using the Event Replicator Administration

Example

Suppose you have an Adabas database with a database ID of 241. In addition, suppose Event Replicator Server 65535 destination and subscription definitions look like this:

ADARPD DATABASE ID=240,DBCONNECT=NO                                     
*                                                                       
ADARPD DESTINATION NAME=ADA240                                          
ADARPD  DREPLICATEUTI=YES                                               
ADARPD  DTYPE=ADABAS                                                    
ADARPD  DAIFILE=151,DAIDBID=241,DATDBID=240,DATFILE=51                  
ADARPD   DAREPLICATEUTI=YES                                             
*                                                        
ADARPD SUBSCRIPTION NAME=TICKER                          
ADARPD  SDESTINATION='ADA240'                            
ADARPD  SFILE=151,SFDBID=241,SFBAI='AA-ZZ.'              
*                                                        

The TICKER subscription on Event Replicator Server 65535 is set up to replicate data from file 151 on database 241 using destination ADA240. However, suppose neither database file 151 or file 51 are loaded in their respective databases. The following processing can occur:

  1. Define the new FDT and file 151 using Adabas Online System or Adabas Manager on database 241.

  2. Since database 241 runs with REPLICATION=YES, the define operations for file 151 are sent to Event Replicator Server 65535.

  3. The TICKER subscription sends changes from file 151 to destination ADA240 (database 240). Because destination ADA240 has DREPLICATEUTI=YES, it replicates the utility functions it receives in general. In addition, because DAREPLICATEUTI=YES for the target database 240, file 51, the define utility function is replicated to that specific target as file 51. In other words, new file 51 is defined using the definition specifications for file 151.

    Warning:
    If a file 51 already exists on database 240, this definition will fail and so will replication to this target. Take care when specifying target specifications for such operations.
  4. You can now activate replication for file 151 (ADADBS REPLICATION FILE=151,ON,TARGET=65535). This will allow user transactions and utility functions from file 151 on database 241 to be replicated to Event Replicator Server 65535, which will, in turn, replicate them to file 51 on database 240.

Top of page

Messaging Event Replicator Server Destinations

The Adabas C5 command can be used to message Event Replicator Server destinations from your application. C5 commands are transmitted via the messaging system. For more information, read C5 Command: Write User Data to Protection Log.

Top of page

Event Replicator Server Replication Crosscheck Function

The Event Replicator Server includes functionality to check for inconsistencies between files specified in one or more subscriptions in the Event Replicator Server versus files replicated in Adabas. These inconsistencies may be caused by one of the following instances:

The Event Replicator Server replication crosscheck function executes when an Adabas database first connects with the Event Replicator Server. It can also be invoked using the RPLCHECK operator command.

Top of page

Event Replicator Server Subscription Logging Facility

The subscription logging facility, also know as the SLOG facility, can be used to ensure that data replicated to specific destinations is not lost if problems occur on those destinations. In order for this to occur, the SLOG facility must be activated for those destinations. For complete information on using the SLOG facility, read Using the Subscription Logging Facility.

Notes:

  1. Subscription logging is resource intensive and should only be used where absolutely necessary. As an alternative, you should consider using initial state processing to resynchronize replicated data in the event of a queue failure.
  2. If a destination is unavailable for a significant amount of time, a large volume of data can be generated and written to the SLOG system file.
  3. The single point of failure for the SLOG facility is that if the SLOG system file is not large enough to contain the data that must be logged, the SLOG facility fails and data will subsequently be lost.

Top of page

Transaction Logging

Event Replicator for Adabas transaction logging (TLOG) allows you to log transaction data and events occurring within the Event Replicator address space. This information can be used as an audit trail of data that has been processed by the Event Replicator Server and of state change events that occurred during Event Replicator Server operations. In addition, it can be used to assist in the diagnosis of problems when replication does not work as expected.

For complete information, read Using Transaction Logging.

Top of page

Node-to-Node Support

Event Replicator for Adabas provides node-to-node support, in which one Event Replicator Server can send replicated data to a second Event Replicator Server. The second Event Replicator Server can then, in turn, send the replicated data onto other destinations.

Consider the example depicted in the following picture:

graphics/node.png

The following processing occurs in this example:

  1. Source Adabas database 10 sends its data to Event Replicator Server 20.

  2. Event Replicator Server 20 sends the replicated data to an EntireX Communicator or MQSeries destination.

  3. Event Replicator Server 30 reads the replicated data from the EntireX Communicator or MQSeries input queue.

  4. Event Replicator Server 30 processes the replicated and sends it to Adabas database 40.

The following definitions must exist for this processing to occur correctly:

Top of page

Recovery

If Adabas terminates abnormally and restarts, it and the Event Replicator Server are usually able to recover any lost replication data and to deliver the normal stream of replication data to the target application.

This section covers the following topics:

General Recovery Processing

During normal processing, Adabas writes control information to its Work data set to keep track of which replicated transactions the Event Replicator Server has confirmed as successfully processed. If Adabas terminates abnormally and then performs the autorestart at the beginning of the next session, it uses the protection data and control information in the Work data set to rebuild the replication data that existed in its replication pool at the time of the failure.

After reconnecting to the Event Replicator Server, Adabas:

  1. deletes rebuilt replication data that the Event Replicator Server successfully processed,

  2. keeps rebuilt replication data that the Event Replicator Server fully received but has not yet successfully processed, and

  3. resends rebuilt replication data that the Event Replicator Server has not yet fully received.

Adabas marks all replication data that it recovers from the Work data set as possible resends and sends it to the Event Replicator Server (because the Event Replicator Server did not indicate it already received the data). The target application may receive such replication data twice (the second time marked as possible resend) if the Event Replicator Server did not stay active throughout the Adabas outage, because, in this case, the next instance of the Event Replicator Server does not know which replication data the previous instance had already successfully processed.

Data Loss Considerations

If the Event Replicator Server has not been able to process the replication data sent by Adabas in a timely manner, it is possible that Adabas will overwrite replication-related protection data on the Work data set that has not yet been successfully processed by the Event Replicator Server. If, in such a situation, Adabas abends, it will not be able to rebuild all replication data that existed in its replication pool at the time of the failure. In this case, Adabas prints messages detailing which replicated files may be involved in the loss of replication data.

No replication data is lost in an Adabas failure if, prior to the failure, the Event Replicator Server processed the replication data in a timely manner so that no replication-related protection data that has not been successfully processed is overwritten on the Work data set. The amount of protection data that can be held on the Work data set before it is overwritten is determined by the ADARUN LP parameter setting of Adabas. Increasing the LP parameter setting provides for a greater safety margin against the overwrite of protection data related to unprocessed replication data.

No replication data is lost in an Adabas failure if the Event Replicator Server stayed active throughout the Adabas outage even though replication-related protection data that has not been successfully processed may have been overwritten on the Work data set. This is because the replication data that Adabas is unable to rebuild from the Work data set is still present in the Event Replicator replication pool. After reconnecting to the Event Replicator Server, Adabas prints messages indicating that although the replication-related protection data that has not been successfully processed was overwritten on the Work data set, no replication data was actually lost.

Furthermore, in the case of the possible loss of replication data, the Event Replicator Server issues a status message to the target application indicating this condition for every subscription-destination related to any affected file.

Repeated Abends

If, after the session autorestart, Adabas abends again before the Event Replicator Server has received and processed all of the rebuilt replication data, Adabas will in the following second session autorestart again rebuild the relevant replication data from the information on its Work data set and, if necessary, resend it to the Event Replicator Server. This is possible as long as the protection data related to the as yet unprocessed replication data has not been overwritten on the Work data set.

If the session autorestart after an Adabas abend consistently fails for a replication-related reason, it is possible to restart Adabas with REPLICATION=NO. This makes Adabas perform the session autorestart without any attempt to recover replication data. It is an emergency measure to get Adabas back up, but disables replication processing. The replication-related parameters of the files that used to be replicated must be defined again and the original files and their replicas must be brought back in sync.

Cluster Database Considerations

In a cluster database, the cluster nucleus performing the recovery process makes the Work data sets of the other nuclei (logically) empty at the end of the recovery. Replication data originating from the other nuclei can no longer be rebuilt after successful recovery. To avoid the loss of this replication data when another failure occurs before the recovered replication data has been sent to and processed by the Event Replicator Server, the nucleus performing the recovery process writes all replication data originating from the other nuclei to its own Work data set. Then, even if the first nucleus fails before sending all recovered replication data to the Event Replicator Server, these replication data will be recovered again from where it was written in the first recovery process.

A cluster nucleus writing replication data to the Work data set during recovery incurs a greater risk of a Work data set overflow. If a Work data set overflow occurs in a cluster database and an existing peer nucleus also gets a Work data set overflow during the recovery process, use the following procedure to recover without the need to restore and regenerate the database:

  1. Define (or use) a new cluster nucleus that has not been active at the time of the Work data set overflow. Define a large LP parameter for this new nucleus. An LP value equal to the sum of the LP values of all cluster nuclei that were active at the time of the first failure should be sufficient.

  2. Start the new cluster nucleus with the large LP parameter to let it perform the recovery process. It will read the protection and replication data from the Work data sets of the failed peer nuclei and write new protection and replication data to its own Work data set. The latter one can be made as large as necessary to resolve the Work overflow condition.

This procedure of resolving a Work data set overflow applies to all cluster nuclei, with or without replication, but is especially important for cluster nuclei with replication, as they have a greater risk of Work overflow during recovery.

Top of page

Interactions With Adabas Transaction Manager

Event Replicator for Adabas can be used with DTP=RM databases that have transactions coordinated by Adabas Transaction Manager. Replication takes place near real-time in the same way as it does for DTP=NO databases.

Top of page