Installation steps

Gluesync SQL to NoSQL for MongoDB

Prerequisites

To have Gluesync working on your MongoDB instance you will need to have:

  • valid user credentials with permission to read, and write to the target database

Due to the way MongoDB users work, the user must be created on the target database.

If you’re considering running Gluesync on a MongoDB Atlas DBaaS, please consider also looking at the specific section Deploying in MongoDB Atlas DBaaS here below on that page.

Basic configuration example

This module can be customized by using a configuration file, in JSON format. The file name to use must be specified as a parameter when launching the app, with the -f or --file tokens. The file should be composed of the union of the common configuration files (see here Installation steps) and source/destination specific configuration:

{
  ...
  "mongodb": {
    "enableRecursionProtection": false,
    "certificatesPath": "/path/to/certs/dir/cert.pem",
    "useDnsSeedList" : true,
    "timeoutSeconds": 60,
    "disableAuth": false,
    "authDatabase": "NAME_OF_AUTH_DATABASE_IF_ANY"
  }
}

MongoDB-specific configurations are listed under the mongodb property:

  • enableRecursionProtection: boolean that avoids recursion when two-way sync capability is configured on the same table. If entities are different from SQL to NoSQL configuration this field should be false to improve performance, if entities are the same this field must be set to true to avoid a recursion loop. The default value is false;

  • certificatesPath (optional): the path to the certificates that need to be used when connecting to MongoDB instance using a secure connection. If omitted, no certificates are used;

  • timeoutSeconds (optional): number of seconds to set as timeout for operations involving communication with MongoDB. The default value is 60 seconds.

  • useDnsSeedList (optional): set it to true to let the MongoDB SDK retrieve the cluster definition from the SRV record in the provided DNS address, mandatory when you are performing a connection to MongoDB Atlas (for example).

  • disableAuth (optional), defaults to false: you can set that parameter to true to disable the authentication mechanism when you’re connecting to a development instance of MongoDB,

  • authDatabase (optional), default to null: use this field when authenticating against a MongoDB server that requires you to specify a different authentication database.

Deploying in MongoDB Atlas DBaaS

Gluesync is fully compatible with working within MongoDB Atlas DBaaS. To establish a connection to a MongoDB Atlas Cluster you just need to have:

  • valid .pem certificate file;

  • The hostname of your Atlas instance, for example: cluster0.instancereferencename.mongodb.net

credentials keypair is not needed when connecting using a .pem certificate to your instance.

Looking for data modeling features or other options?

For more detailed configuration options, including the ability to perform data modeling, please have a look at the dedicated Data modeling section when sourcing from an RDBMS.

Troubleshooting

Here is the list of common errors.

  • AuthenticationFailed - Error 18: You might either have specified a wrong database name as an authentication database or the user that you’re using to connect against the source database does not belong to it, you should issue the correct authentication database where this user is defined. For more detailed info please check out official MongoDB documentation by visiting the following link: using Authentication Database.