Configuration

How to

Gluesync is configured through a JSON file called config.json issued to the application to make it understand where to connect to and what to do with the source data and how.

Config file structure

The config.json file has 3 main sections:

  • Source section;

  • Target section;

  • Entities section.

Each can be configured following the examples and input that you’ll find in the specific sections of this documentation which are divided by component (like SQL to NoSQL, for example), core aspects, source and target.

Source section

Here we have an example of what a section of the source looks like:

{
  "sourceHost": "SERVER_ADDRESS_HERE",
  "sourcePort": "1234",
  "sourceName": "db-name",
  "sourceUsername": "db-user",
  "sourcePassword": "db-pwd",
}

This section is responsible for providing Gluesync connectivity details about the source host as well as user credentials needed to establish a successful connection to the source.

Target section

Like the source section the target section is responsible for the same kind of duties but this time it provides details about the target host.

{
  "targetHost": "SERVER_ADDRESS_HERE",
  "targetPort": "5678",
  "targetName": "db-name",
  "targetUsername": "db-user",
  "targetPassword": "db-pwd",
}

Source entities

This is the core section of the whole configuration file. Source entities are the section where you configure and tell Gluesync what to do when connecting to the source host and what should be done in terms of data modeling when pushing that data right to the target.

"sourceEntities": {
  // an example of virtual entity configured for Full Table, called "foo"
  "foo": {
    "table": "foo_schema",
    "schema": "foo_table",
  },
  // an example of virtual entity configured for Full Table, called "bar"
  "bar": {
    "table": "bar_schema",
    "schema": "bar_table",
    "type": "bar",
    "scope": "my_bar_scope"
  },
  // an example of virtual entity configured for Mapping, called "DocumentType3"
  "DocumentType3": {
    "mapping": {
      "id": "DRIVERID",
      "name": "DRIVERNAME",
      "surname": "DRIVERSURNAME"
    },
    "table": "DRIVERS",
    "schema": "MYSCHEMA",
    "type": "drivers",
    "scope": "myscope"
  },
  // an example of virtual entity configured for SQL query data modeling, called "locations"
  "locations": {
    "query": "SELECT ID, latitude, longiture FROM LOCATIONS INNER JOIN ... WHERE ...",
    "type": "orders",
    "scope": "myscope"
    },
    ...
}

Source entities are a single object under the "sourceEntities" key in your JSON file. Inside it, 4 different types of entities could be described: Full table, Mapping, Query and Data modeling, each of these is described under our Entities documentation section where you can find all details about how each works and how it can be used.

This object can contain as many entities as you need with the only constraint to be unique in terms of given name, as we presented here in the given example respectively with foo, bar, DocumentType3 and locations entity names.

Entities are treated as parallel processes, meaning they will run on separate threads, both when sourcing data for the initial load task as well as when it comes to sourcing real-time changes.