Product Documentation

FairCom Replication JSON RPC API

Previous Topic

Next Topic

Concepts

Note: The API documented in this book is subject to change.

FairCom Replication is a distributed architecture based on centralized metadata:

  • The system is distributed, with each FairCom DB database instance containing its own replication metadata and replication engine. Once a replication plan has been defined and started, it runs locally with no dependencies other than the servers it replicates from.
  • The system is centralized with a centrally installed Replication Manager gathering metadata from each distributed FairCom DB database. Replication Manager also can create replication plans and deploy them across multiple FairCom DB databases.

This means that any point on the system that can connect to the centralized metadata can access and control any part of the system.

The Replication Manager Engine provides the JSON RPC API, which allows an application to access and control replication across all registered databases. The replication API is a programmatic interface to the centralized replication metadata in the Replication Manager Database. Each FairCom DB instance can optionally register with Replication Manager. When it does, it transmits metadata about its databases, tables, files, and existing replication plans to Replication Manager. This makes it easy for Replication Manager to create and manage replication plans across all registered servers.

The Replication Manager User Interface is a browser-based application. It also uses the JSON RPC API to manage replication across all registered databases. Using this same API, developers can integrate the same functionality into their own custom applications.

Replication Manager also provides a native C++ version of this API.

API

The API defines a hierarchy of objects that represent the various components of a replication environment, such as physical hardware, operating systems, volumes, folders, and files, etc. as well as database servers, databases, etc. Detailed information about these objects and their methods can be found later in this document.

C++ Interface

The C++ interface provides:

  1. Class definitions
  2. High-level function headers

Both are documented on the header files in the following directory:

\ctreeApps\FcFatDB\source\fcRepl

File System and Database Classes

The following classes depict the file system and its hierarchy, which provides a way to uniquely represent each file:

Site - At the highest level, a site represents all database servers that are eligible for replication. A system must have a Replication Agent installed to be eligible for replication. FairCom DB V12 has a built-in Replication Agent that is enabled when it is licensed. The site includes every replication-eligible system that is registered with Replication Manager. This includes database servers on the same computer and those connected through networks: local, remote, cloud, etc.

Hardware - Each site may contain one or more physical devices, such as computers, tablets, phones, etc. These devices are referred to as hardware.

OpSystem - Each piece of physical hardware may contain one or more operating systems, referred to as OpSystem. For example, a single computer could have a virtual machine with Windows installed and another VM running Linux.

DBEngine - Each OpSystem may contain one or more database servers. In this release, only FairCom DB database servers are recognized.

Database - Each DBEngine can host one or more databases. The FairCom replication APIs recognize both c-treeDB, FairCom DB SQL, and FairCom DB databases.

Volume - Each operating system can host one or more volumes. A volume is a logical drive with a single file system. It may refer to a physical drive (fixed or removable) or a mount point within another volume.

File - A volume may contain one or more files or folders. The terms file and folder are used interchangeably in this API as files and folders are both considered to belong to the File class.

Replication

The Replication Plan is the link between two database engines: the source and the target. The FairCom replication APIs use a "publish and subscribe" metaphor for defining which files will be replicated from the source to the target. One-way and two-way replication are supported. Two-way replicates data in both directions: from the source to the target and from the target to the source. Two-way replication also provides conflict detection and provides callbacks for conflict resolution.

These classes are defined:

Publication - A Publication is a list of files, folders, or databases to be replicated. The files are defined using the hierarchy of file system classes defined above. Folders allow files to be replicated dynamically as they change in a specified folder. Databases allow tables to be replicated dynamically as they change in a specified database. A table is always stored in a file. Thus, files are always the source for replication.

Subscription - A Subscription references one Publication and indicates the Target Database Server where the published files are to be replicated.

Replication Plan - A Replication Plan contains one or more subscriptions.

The figure below summarizes these classes and their relationships:

In addition to the classes shown above, several secondary classes are defined. These classes are primarily used internally. A complete list of classes and functions is contained in all the header files in:

\repl\include\fcRepl

In This Chapter

Function Groupings

Configuration

Replication Manager option for connecting by IP Address

Action Plug-ins

TOCIndex