Developing a Data Sync App
For Red Hat Managed Integration 1.5
1. Introducing Data Sync
An app built using the Data Sync framework comprises of two components:
- The Data Sync server is a framework for building Node.js based GraphQL API. The Data Sync server offers enterprise extensions for ensuring data security, integrity, and monitoring. It can be integrated into existing Node.js application.
The Data Sync framework uses the Apollo platform as the GraphQL implementation.
Real-time data synchronization across mobile and web clients.
- Websockets allow for real-time data synchronization across multiple Data Sync clients. Data Sync clients receive updates from the Data Sync server without having to explicitly query their local data as conflict detection is handled by the Data Sync server.
A Data Sync client can perform any operation regardless of the connectivity state.
- If network connectivity is a concern, a Data Sync client can perform any operation regardless of its connectivity state. A Data Sync client can perform the same operations when it is on-line or off-line, and this functionality ensures that you can safely use Data Sync to create business critical applications.
Offers fully customizable conflict detection and resolution to the developer.
- Data Sync enables users to detect and resolve conflicts on the Data Sync server resulting in the seamless transmission of data to various Data Sync clients. Data Sync also allows for conflict resolution on the Data Sync client should a developer want to adopt this strategy.
Instant synchronous queries provide instant feedback for developers.
- When a Data Sync client is on-line, instant queries allow a developer to quickly react to errors and display results to users when the operation is executed. Developers can retrieve an instant response or error from the Data Sync server however the Data Sync client must have a connection to the Data Sync server.
Flexible data sources.
- Data Sync can connect to various data sources, for example, cloud storage, databases such as MongoDB and PostgreSQL, and existing back-end data sources.
2. Data Sync Technical Overview
This section describes the technical aspects of Data Sync.
Table 1. Data Sync case study
The Sync Server is based on the Apollo Server framework and it performs two primary functions. It sends and retrieves data from a data source, and it syncs data across the Sync Clients. Sync Server uses GraphQL to create custom connections that in turn allow various types of Sync Clients to connect.
The data source stores data. This data is typically what is synchronized across the Sync Clients.
For more information about the Apollo Server framework, see Start here to learn about the Apollo platform.
2.1. Data Sync terminology
This section describes terminology that is associated with Data Sync.
Data Sync terms
- A query language for your API, and a server-side runtime for executing queries that use a type system. For more information, see GraphQL.
- Apollo is an implementation of GraphQL designed for the needs of product engineering teams building modern, data-driven applications. Apollo includes two open-source libraries, Apollo Server and Apollo Client. The Data Sync Framework leverages Apollo functionality.
- Sync Server
- The Sync Server is a framework for building Node.js based GraphQL API.
- Sync Client
- Data sources
- Data Sync framework is typically used in conjunction with a data source for data persistence however, an app built using the Data Sync framework works without a data source.
- Data Sync framework