MongoDB Redash Integration: 2 Easy Methods

on BI, BI Tool, Data Integration, Database Management Systems, ETL, MongoDB, Redash • June 29th, 2021 • Write for Hevo

Data Analytics is one of the hottest skills that everyone is looking into. In this Data-Driven world where we are on the verge of digitizing almost everything, this data has multiplied. This enables the organization to carry out practical data analysis to generate insights from the data and make data-driven decisions. In this evolving field, a new technique of combining data from Databases to BI tools has increased. One such technique is the MongoDB Redash Integration.

MongoDB is a popular NoSQL database developed by MongoDB Inc. It is a source-available cross-platform document-oriented database program that uses JSON (JavaScript Object Notation)-like documents and optional schemas to store your data. Redash is a popular BI tool that offers collaborative visualization and dashboard platform that allows users to design unique reports and dashboards. With MongoDB Redash Integration, you can visualize your MongoDB data seamlessly using Redash.

In this article, you will learn how to set up MongoDB Redash Integration. You will also get an overview of both MongoDB and Redash to better understand these technologies individually. Read along to find out how you can integrate MongoDB and Redash for your business.

Table of Contents

Introduction to MongoDB

MongoDB Logo
Image Source

MongoDB is a document-oriented open-source NoSQL database. It stores the data in documents and supports NoSQL query language to interact with data. MongoDB is very popular among organizations due to its features. 

A NoSQL Database means it does not store the data in rows and columns compared to traditional databases but instead uses documents that collect key-value pairs to store the data. Key-Value pair allows MongoDB to store the data schemaless and scale them vertically when needed without disrupting the data model. It keeps the data into a storage format known as BSON (Binary Style of JSON document). 

MongoDB is highly elastic that lets you combine and store multivariate data without compromising on the powerful indexing options, data access, and validation rules.

Key Features of MongoDB:

MongoDB houses a wide range of services that make it a better solution when compared to other databases. Some of these features are:

  • In MongoDB, you can search by field, range query, and regular expressions. This way it adds support for ad hoc queries.
  • It is a schema-less database written in C++ that provides high performance.
  • It can index any field in a document and supports Master-Slave replication.
  • It has an automatic load configuration feature to group similar data in its database.
  • It stores files of any size easily without complicating the stack and is easy to administer in case of any failure.
  • It uses JavaScript instead of Procedures.
  • MongoDB also supports the JSON data model, auto-sharding, and built-in replication for high scalability and availability.

To learn more about MongoDB, click this link.

Introduction to Redash

Image Source

Redash is a UI-based collaborative visualization and dashboarding platform that allows users to interact with the data regardless of their technical expertise. SQL users can easily leverage Redash to explore, query, and generate insights from the data and share within the team. The analytical report and insights can be shared across the organization and help users to make data-driven decisions. 

Key Features of Redash:

Redash has a wide range of features which makes it a better choice over other BI tools. Some of these are as follows:

  • Web-Based UI: Redash provides a shareable URL that can be accessed via any browser and contains all features.
  • Query Editor: Redash has a query editor which allows you to write SQL and NoSQL queries with a schema browser and auto-complete features.
  • Excellent Graphics: Redash has terrific graphics which can create beautiful visualizations with drag and drop and combine them into a single dashboard.
  • Ease of Sharing: Redash allows users to collaborate and share their work with others, enabling peer review of reports and queries.
  • Support of Data Sources: Redash has excellent support for data sources and has a long list of SQL, NoSQL, and platform connectors.
  • REST API: Redash has an API to interact with all the UI options. So you can quickly implement Redash with your favorite programming language. 

To learn more about Redash, click this link.

Ways to Set up MongoDB Redash Integration

Method 1: Manual MongoDB Redash Integration

This method involves choosing MongoDB as a Data Source from Redash and setting up the connection between them. A Connection String, Database Name, and Host Name are required for this purpose.

Method 2: Using Hevo Data to Set up MongoDB Redash Integration

Hevo Data, provides a hassle-free solution and helps you directly transfer data from MongoDB to Redash and numerous other BI tools without any intervention in an effortless manner. Hevo is fully managed and completely automates the process of not only loading data from your desired source but also enriching the data and transforming it into an analysis-ready form without having to write a single line of code. Hevo’s pre-built integration with MongoDB along with 100+ data sources (including 30+ free data sources) will take full charge of the data transfer process, allowing you to focus on key business activities.

Get started with Hevo today! Sign up for the 14-day free trial!

Methods to Set up MongoDB Redash Integration

There are 2 methods you can use to set up MongoDB Redash Integration:

Method 1: Manual MongoDB Redash Integration

Connecting to MongoDB from Redash is straightforward. Let’s have a look at the detailed step by step guide to connecting to MongoDB from Redash:

Step 1: Choosing MongoDB as a Source

From Redash, choose MongoDB from the Data Source, and on the page displayed, provide the connection information. This is shown below:

  • Name: This should be the data source name
  • Connection String – In the format – mongodb://username:password@hostname:port/dbname?options
  • Provide the Database Name to connect directly.
  • Replica Set Name: The name of the replica set (in case your MongoDB is set up in production deployment, you should have replica sets for redundancy and high availability).

Step 2: Setting up the Connection between MongoDB and Redash

The Connection String can be made up of:

  • [Optional] – The username:password@ is optional. This will be used to authenticate the database after connection
  • The port is the default – 27017. 
  • Hostname – Hostname/IP Address or the MongoDB server for the connection. 
  • The dbname is optional. This is the database name to authenticate when the connection string consists of the database credentials.
  • ?options are connection-specific options. The options have to be specified in key-value pairs. For example, to enable SSL, the connection string will be:
mongodb://username:password@hostname:port/dbname?ssl=true&ssl_cert_reqs=CERT_NONE

The MongoDB Redash Interface is shown below.

MongoDB Redash Interface
Image Source

That’s it. Upon successful connection, you’ll see the documents and their collection on the Redash. This way you have successfully set up MongoDB Redash Integration. You can write queries to query the data from MongoDB. Some of the example queries from the Redash are as below:

  • Count
{
	"collection": "my_collection",
	"count": true
}
  • Filter Query
{
	"collection": "zipcodes",
	"aggregate": [{
		"$project": {
			"_id": "$_id",
			"city": "$city",
			"loc": "$loc",
			"pop": "$pop",
			"state::filter": "$state"
		}
	}]
}

You can get more examples here.

Method 2: Using Hevo Data to Set Up MongoDB Redash Integration

Hevo Data,  a No-code Data Pipeline helps you directly transfer data from MongoDB and 100+ data sources to Business Intelligence tools such as Redash, Data Warehouses, or a destination of your choice in a completely hassle-free & automated manner. Hevo is fully managed and completely automates the process of not only loading data from your desired source but also enriching the data and transforming it into an analysis-ready form without having to write a single line of code. Its fault-tolerant architecture ensures that the data is handled in a secure, consistent manner with zero data loss.

Hevo takes care of all your data preprocessing needs and lets you focus on key business activities and draw a much powerful insight on how to generate more leads, retain customers, and take your business to new heights of profitability. It provides a consistent & reliable solution to manage data in real-time and always have analysis-ready data in your desired destination. 

Hevo focuses on three simple steps to set up MongoDB Redash Integration:

  • Extract: Connect Hevo with MongoDB and various other data sources by simply logging in with your credentials and extract information seamlessly.
  • Integrate: Consolidate your data from several sources in Hevo’s Managed Data Warehouse Platform and automatically transform it into an analysis-ready form.
  • Visualize: Connect Hevo with your desired BI tool such as Redash and easily visualize your data to gain better insights.

Check out what makes Hevo amazing:

  • Secure: Hevo has a fault-tolerant architecture that ensures that the data is handled in a secure, consistent manner with zero data loss.
  • Schema Management: Hevo takes away the tedious task of schema management & automatically detects the schema of incoming data and maps it to the destination schema.
  • Minimal Learning: Hevo, with its simple and interactive UI, is extremely simple for new customers to work on and perform operations.
  • Hevo Is Built To Scale: As the number of sources and the volume of your data grows, Hevo scales horizontally, handling millions of records per minute with very little latency.
  • Incremental Data Load: Hevo allows the transfer of data that has been modified in real-time. This ensures efficient utilization of bandwidth on both ends.
  • Live Support: The Hevo team is available round the clock to extend exceptional support to its customers through chat, email, and support calls.
  • Live Monitoring: Hevo allows you to monitor the data flow and check where your data is at a particular point in time.

Conclusion

This article gave you a step-by-step guide on setting up MongoDB Redash Integration. It also gave you an overview of both MongoDB and Redash along with their features. Overall, MongoDB Redash Integration can be set up using either the manual method or by using Hevo, but if time and ease of use are a parameter for you, using automated data platforms like Hevo can help you to set up MongoDB Redash Integration in a smooth manner!

In case you want to integrate data from data sources like MongoDB into your desired Database/destination and seamlessly visualize it in a BI tool of your choice such as Redash, then Hevo Data

is the right choice for you! It will help simplify the ETL and management process of both the data sources and destinations.

Want to take Hevo for a spin? Sign up for the 14-day free trial! and experience the feature-rich Hevo suite first hand.

Share your experience of setting up MongoDB Redash Integration in the comments section below!

No-code Data Pipeline For Redash