MongoDB is one of the popular NoSQL document store that is suitable for storing huMONGOus data like logs and IOT. When it comes to doing analysis or reports on top of that, Tableau can do a great job by connecting to MongoDB and consuming the data from them thanks to the new BI Connector that was launched by MongoDB.
The MongoDB BI Connector helps in viewing the flexible schema document in a fixed schema tabular format that Tableau can consume and make use of. Internally it uses Postgres to store and transform the data as necessary.
Note: the following workarounds are unsupported, therefore Tableau Technical Support is unable to assist further.
Installing MongoDB connector
The MongoDB connector comes as separate application that you can install along with MongoDB or on a separate server. It is available only from MongoDB Enterprise 3.2 or greater and at the time of writing this, it is supported on the following platforms,
Red Hat Enterprise Linux/CentOS
6 and 7
12.04 and 14.04
The installation is straight forward and you can find more information about downloading the connector and setting it up here
The Schema is defined in PostgreSQL by the connector. Since it needs to be in fixed schema, the schema has to be defined in the connector. Document Relational Definition Language (DRDL) defines a relational view of a MongoDB schema and is defined in YAML based file for processing by the connector. More details on the schema definition can be found here
The connector comes with tools to help manage and operate the connector, these tools are installed along with the BI connector.
- mongobiuser can modify users in the MongoDB Connector for BI.
- mongodrdl generates database schema information for use with the MongoDB Connector for BI.
- mongobischema will load the resulting files into the MongoDB Connector for BI.
Consuming data from MongoDB
Tableau uses the PostgreSQL connector to connect to the database of the connector and consume the data.
- Download the PostgreSQL driver from the drivers download page. https://www.tableau.com/support/drivers. It comes by default from Tableau Desktop 9.3 and above
- Install the psqlodbc setup to get the ODBC drivers on both the Tableau Server and the Desktop
- Navigate to ODBC data source administrator to configure the PostgreSQL ODBC driver to connect to the BI connector
- Provide the following information to the ODBC connection
The hostname of the MongoDB BI Connector server
27032 by default.
The username you specified when creating your MongoDB Connector
The password for the above user
Same as your username.
- Open Tableau and connect to the configured ODBC driver by selecting ODBC from the connect screen
- You should be able to now build interactive reports in Tableau using the Data from MongoDB.
- Alternatively, you can use the In-built PostgreSQL connector from Tableau
- Provide the above connection information and you will be able to consume the data from MongoDB
NoSQL like MongoDB is becoming the future standard of data store for Applications and IOT and Tableau can now help Visualize those data in an elegant manner.