IBM Cloud Docs
MongoDB Enterprise Edition Analytics Add-On

MongoDB Enterprise Edition Analytics Add-On

The Databases for MongoDB EE (Enterprise Edition) Analytics Add-On allows you to run long-running analytical queries or provision a MongoDB Connector for business intelligence(BI) to make your query data compatible with BI tools, such as Tableau.

The Databases for MongoDB EE Analytics Add-On is made up of two components:

What problems does the Databases for MongoDB EE Analytics Add-On solve?

  1. Most BI tools do not work with the MongoDB document data model.

    MongoDB's document data model is made up of complex documents with arbitrary, nested data. This schema makes storing data flexible, easy, and scalable. However, most BI tools require data to be in tabular format, which is rigidly defined and stored in tables, not documents. The Databases for MongoDB EE Analytics Add-On converts MongoDB document data into SQL-readable tabular data that can be queried and displayed by BI tools.

  2. BI queries are expensive and can degrade database performance.

    Long-running queries can negatively impact the operational workflow of your deployment. The Databases for MongoDB EE Analytics Add-On introduces an extra data member, which isolates analytics workloads from operational workloads. The Analytics Node data is kept in sync with the other nodes, so any queries run against it produce the same results.

The Analytics Node

The Analytics node isolates analytics from operational workload, allowing for long-running queries that do not impact operational workflow performance. You can use the Analytics node directly by using MongoDB queries, or through the BI Connector if you want to run SQL queries.

Enabling the Analytics node without engaging the connector for BI allows you to run document-type MongoDB queries or test a query on production data without affecting your application.

You can access your Analytics node directly through a connection string, for example:

mongodb://$USERNAME:$PASSWORD@host-0:30783,host-1:30783,host-2:30783/?readPreference=secondary&readPreferenceTags=nodeType%3AANALYTICS&replicaSet=replset

The connector for BI

Traditional BI tools are designed to work with tabular, row-and-column data. The Databases for MongoDB EE Analytics Add-On connector for BI allows you to query MongoDB data with SQL using tools, such as Tableau, by connecting to the Analytics node and providing an SQL interface.

You can access your BI Connector through the ODBC connector of your BI tool by using your username and password and the host URL, which look like:

xyz1234-scfr5rer-496hjgo6ghtg-biconnector.abc12345deft7.databases.appdomain.cloud:32757

The Databases for MongoDB EE Analytics Add-On connector for BI cannot be enabled without the Analytics node.

MongoDB EE Analytics Add-On Considerations

Before taking advantage of the Databases for MongoDB EE Analytics Add-On, consider the following:

  • The add-on is available only for Databases for MongoDB EE.

  • Once enabled, you cannot deprovision the analytics node.

  • You cannot scale the disk space of the Analytics member.

  • An Analytics node is priced as a data member. For more information on Databases for MongoDB EE, see Pricing.

    Scaling the disk space of the main database members results in proportional scaling of the Analytics member.

Provisioning an Analytics Node and BI Connector

Provision using Terraform

Analytics Node and BI Connector are group attributes that can be added to a Terraform script. You can see an example here:

data "ibm_resource_group" "test_acc" {
  is_default = true
}

resource "ibm_database" "mongodb_enterprise" {
  resource_group_id = data.ibm_resource_group.test_acc.id
  name              = "test"
  service           = "databases-for-mongodb"
  plan              = "enterprise"
  location          = "us-south"
  adminpassword     = "password12"
  tags              = ["one:two"]

  group {
    group_id = "member"

    memory { 
      allocation_mb = 24576
    }

    disk { 
      allocation_mb = 122880
    }

    cpu {
      allocation_count = 6
    }
  }

  group {
    group_id = "analytics"

    members { 
      allocation_count = 1
    }
  }

  group {
    group_id = "bi_connector"

    members { 
      allocation_count = 1
    }
  }

  timeouts {
    create = "120m"
    update = "120m"
    delete = "15m"
  }
}

data "ibm_database_connection" "mongodb_conn" {
  deployment_id = ibm_database.mongodb_enterprise.id
  user_type     = "database"
  user_id       = "admin"
  endpoint_type = "public"
}

output "bi_connector_connection" {
  description = "BI Connector connection string"
  value       = data.ibm_database_connection.mongodb_conn.bi_connector.0.composed.0
}

output "analytics_connection" {
  description = "Analytics Node connection string"
  value       = data.ibm_database_connection.mongodb_conn.analytics.0.composed.0
}

For more information, see our Terraform documentation.

Remember that the Analytics Node must be scaled before the BI Connector or your request will fail.

Provisioning through the IBM Cloud Databases API

Provisioning via the API is a two-step process:

  1. Create a Databases for MongoDB EE deployment.
  2. After that you can add the Analytics Node and BI Connector group to your deployment by using the Scale Group method.

Example for Analytics Node:

curl --request PATCH \
  --url https://api.{region}.databases.cloud.ibm.com/v5/ibm/deployments/{id}/groups/analytics \
  --header 'Authorization: Bearer <> \
  --header 'Content-Type: application/json' \
  --data '{
    "group": {
        "members": {
            "allocation_count": 1
        }
    }
}'

Example for BI Connector:

curl --request PATCH \
  --url https://api.{region}.databases.cloud.ibm.com/v5/ibm/deployments/{id}/groups/bi_connector \
  --header 'Authorization: Bearer <> \
  --header 'Content-Type: application/json' \
  --data '{
    "group": {
        "members": {
            "allocation_count": 1
        }
    }
}'

Remember that the Analytics Node must be scaled before the BI Connector or your request will fail.

To get the connection strings to connect to the Analytics Node and/or BI Connector, follow the instructions here.

Connect using BI tools

To connect to the MongoDB Connector for BI using popular BI tools, see: