Data Visualization Using Apache Zeppelin – Tutorial
Tags: bigdataanalytics, datavisualization, apachezeppelin, mongodb
Published: 2017-10-16 18:18:15

---
title: Data Visualization Using Apache Zeppelin – Tutorial
published: true
description: Learn how to add an Apache Zeppelin custom interpreter for MongoDB and MySQL to create powerful data visualizations and query data for insight into bi analytics
tags: Big Data Analytics, Data Visualization, Apache Zeppelin, MongoDB,
canonical_url: https://scalegrid.io/blog/data-visualization-using-apache-zeppelin/
---
<link rel="canonical" href="https://scalegrid.io/blog/data-visualization-using-apache-zeppelin/" />

In today's world, data is being generated at an exponential rate, so much so that analysts are predicting our global data creation to increase <a href="http://www.information-age.com/data-forecast-grow-10-fold-2025-123465538/" target="_blank">10x by 2025</a>. Businesses are now collecting dataÂ across everyÂ internal system and external source thatÂ impacts their company; and with it comes an ever-growing need to analyze the data to gain insight into how it can be used to improve and enhance their business decisions. Apache Zeppelin, an open source data analytics and visualization platform, can take us a long way toward meeting that goal.

In this article,Â you'll learn how to add a custom interpreter for <a href="https://www.mongodb.com/" target="_blank">MongoDB</a> and <a href="https://www.mysql.com/" target="_blank">MySQL</a> and how to use it to query and visualize collection data. First, let's start off with an overview of Apache Zeppelin and it's feature set:

<h1><span style="font-weight: 350;">What is Apache Zeppelin?</span></h1>
<a href="https://zeppelin.apache.org/" target="_blank">Apache Zeppelin</a> is an open-source, web-based “notebook that enables interactive data analytics and collaborative documents.Â The notebook is integrated with distributed, general-purpose data processing systems such as <a href="https://spark.apache.org/" target="_blank">Apache Spark</a>Â (large-scale data processing), <a href="https://flink.apache.org/" target="_blank">Apache Flink</a>Â (stream processing framework), and many others.Â Apache Zeppelin allows you to make beautiful, data-driven, interactive documents with SQL, Scala, R, or Python right inÂ your browser.

<img class="alignnone wp-image-2612 size-full" style="margin: 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0.png" alt="Apache Zeppelin Data Visualization - ScaleGrid Blog" width="600" /></a>

<h2><span style="font-weight: 400;">Features</span></h2>

<h3><span style="font-weight: 400;">Interactive Interface</span></h3>
Apache Zeppelin has an interactive interface that allows you to instantly see the results of your analytics and have an immediate connection with your creation:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-1.png"><img class="alignnone wp-image-2614 size-full" style="margin: 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-1.png" alt="Appache Zeppelin Interactive Interface - ScaleGrid Blog" width="250" /></a>


<h3><span style="font-weight: 400;">Integrations</span></h3>
Integrate with many different open source, big data tools such as Apache projects Spark, Flink, Hive, Ignite, Lens and Tajo.


<h3><span style="font-weight: 400; padding-top: 1.0em;">Browser Notebooks</span></h3>
Create notebooks that run in your browser (both on your machineÂ and remotely) andÂ experiment with differentÂ types of charts forÂ to explore your data sets:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-2.png"><img class="alignnone wp-image-2615 size-full" style="margin: 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-2.png" alt="Appache Zeppelin Integrations - ScaleGrid Blog" width="200" /></a>

<img class="alignnone wp-image-2616 size-full" style="margin: 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-3.png" alt="Appache Zeppelin Integrations - ScaleGrid Blog" width="220" />


<h3><span style="font-weight: 400;">Dynamic Forms</span></h3>
Dynamically create input forms right in your notebook.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-5.png"><img class="alignnone wp-image-2618 size-full" style="text-align:left; margin: 0px 0px 0px 30px; border: 2px solid #eeeeee;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-5.png" alt="Appache Zeppelin Dynamic Forms - ScaleGrid Blog" width="600" height="495" /></a>

<h3><span style="font-weight: 400;">Collaboration &amp; Sharing</span></h3>
A diverse and vibrant developer communityÂ gives you access to new data sources that are being constantly added and distributed through their open sourceÂ Apache 2.0 license.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-7.png"><img class="alignnone wp-image-2620 size-full" style="margin: 30px 0px 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-7.png" alt="Appache Zeppelin Collaboration &amp; Sharing - ScaleGrid Blog" width="1600" height="666" /></a>

<h3><span style="font-weight: 400;">Interpreter</span></h3>
Apache Zeppelin interpreter concept allows any language/data-processing-backend to be plugged into Zeppelin. Currently, Apache Zeppelin supports many interpreters such as Apache Spark, Python, JDBC, Markdown, and Shell.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-8.png"><img class="alignnone wp-image-2623 size-medium" style="float: left; margin: 0px 0px 0px 30px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-8-300x274.png" alt="Appache Zeppelin Interpreter - ScaleGrid Blog" width="200" height="274" /></a>

Now, let's get started creating your custom interpreter for MongoDB and MySQL.

&nbsp;
<h1><span style="font-weight: 400;">Add a MySQL Interpreter</span></h1>
In the Apache Zeppelin platform, go to the drop-down menu in the top-right andÂ click on Interpreter:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-9.png"><img class="alignnone wp-image-2624 size-full" style="float: right; margin: 75px 0px 0px 30px; border: 2px solid #eeeeee;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-9.png" alt="Add a MySQL Interpreter Appache Zeppelin - ScaleGrid Blog" width="250" height="175" /></a>

Here's where you can find a list of all interpreters. We need to create a new one for MySQL, so click on the "Create" button in the upper right-hand corner:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-10.png"><img class="alignnone wp-image-2625 size-full" style="margin: 30px 0px 30px 0px; border: 2px solid #eeeeee;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-10.png" alt="Create a New Interpreter Appache Zeppelin - ScaleGrid Blog" width="1600" height="275" /></a>

Enter a recognizable name for the interpreter (e.g. mysql) and choose group as JDBC:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-11.png"><img class="alignnone wp-image-2626 size-full" style="float: right; margin: 0px 0px 30px 30px; border: 2px solid #eeeeee;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-11.png" alt="Create a New Interpreter Appache Zeppelin - ScaleGrid Blog" width="350" height="351" /></a>

Keep all the default options, but enter the required details and make sure that a connection to your MySQL server is established:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-12.png"><img class="alignnone wp-image-2627 size-full" style="border: 2px solid #eeeeee; margin: 30px 0px 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-12.png" alt="Enter Interpreter Details Appache Zeppelin - ScaleGrid Blog" width="1025" height="226" /></a>

We also need to add a custom artifact to the MySQL connector JAR so Zeppelin knows where to execute it from. Download the connector <a href="https://dev.mysql.com/downloads/connector/j/3.1.html" target="_blank">here</a>, place it in the interpreter/jdbc folder and then provide the exact path to the artifact:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-13.png"><img class="alignnone wp-image-2628 size-full" style="border: 2px solid #eeeeee; margin: 30px 0px 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-13.png" alt="Dependencies Appache Zeppelin - ScaleGrid Blog" width="742" height="183" /></a>

And that’s it! To test our interpreter, we need to create a new note. But first, lets set up our MongoDB interpreter as well.

<h1><span style="font-weight: 400;">Add a MongoDB Interpreter</span></h1>
Go back to your Interpreter page and click the "Create" button. We're going to use this open sourceÂ <a href="https://github.com/bbonnin/zeppelin-mongodb-interpreter/releases" target="_blank">MongoDB interpreter</a>, soÂ you'll next need to download the .zip file and rename it to .jar.

After that, go to interpreters/, create a mongodb/ folder, and paste the .jar into the folder.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-14.png"><img class="alignnone wp-image-2630 size-full" style="float: right; margin: 30px 0px 30px 0px; border: 2px solid #eeeeee;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-14.png" alt="Create a New Folder Appache Zeppelin - ScaleGrid Blog" width="986" height="135" /></a>

You'll now have a new Interpreter group called mongodb. Go to your Interpreter page, enter a friendly name such as mongodb, and then choose mongodb under the Interpreter group dropdown.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-15.png"><img class="alignnone wp-image-2631 size-full" style="float: right; border: 2px solid #eeeeee; margin: 0px 0px 0px 30px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-15.png" alt="Create a New Interpreter Appache Zeppelin - ScaleGrid Blog" width="350" height="384" /></a>

Now,Â let'sÂ enter the details of our newly created ScaleGrid MongoDB cluster in "Properties"Â found in the Overview/Machines section of the Cluster Details page.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-16.png"><img class="alignnone wp-image-2632 size-full" style="border: 2px solid #eeeeee; margin: 30px 0px 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-16.png" alt="Cluster Properties Appache Zeppelin - ScaleGrid Blog" width="1580" height="402" /></a>

And we're done! Now it is time to test out our newly created interpreters.

<h1><span style="font-weight: 400;">Create a Zeppelin Note</span></h1>

To run queries that will help visualize our data, we need to create notes. From the Zeppelin header pane, click "Notebook", and then "Create a new note":

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-17.png"><img class="alignnone wp-image-2633 size-full" style="float: right; border: 2px solid #eeeeee; margin: 0px 0px 0px 30px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-17.png" alt="Create a New Note Appache Zeppelin - ScaleGrid Blog" width="325" height="85" /></a>

Make sure the notebook header shows a connected status as denoted by a green dot in the top-right corner:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-18.png"><img class="alignnone wp-image-2634 size-full" style="float: right; border: 2px solid #eeeeee; margin: 0px 0px 0px 30px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-18.png" alt="Connected Appache Zeppelin - ScaleGrid Blog" width="325" height="106" /></a>

When creating a note, you'll be presented with a dialog to enter more information. Choose the default interpreter as our newly created mysql and click “Create Note”.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-19.png"><img class="alignnone wp-image-2635 size-full" style="margin: 30px 0px 50px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-19.png" alt="New Note Name Appache Zeppelin - ScaleGrid Blog" width="765" height="381" /></a>

<h1><span style="font-weight: 400;">Run Queries on the Note</span></h1>

Before we can run any queries, we also need to mention the type of interpreter we'll be using for our note. We can do that by starting our note with “%mysql”. This will tell Zeppelin to expect MySQL queries in that note.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-20.png"><img class="alignnone wp-image-2637 size-full" style="float: right; border: 2px solid #eeeeee; margin: 0px 0px 0px 30px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-20.png" alt="Interpreter Type Appache Zeppelin - ScaleGrid Blog" width="300" height="95" /></a>

And now, we're ready to query our database. For the purpose of this example, I'll use my WordPress installation that contains a typical wp_options table to query and visualize its data.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-21.png"><img class="alignnone wp-image-2638 size-full" style="border: 2px solid #eeeeee; margin: 30px 0px 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-21.png" alt="Query Database Appache Zeppelin - ScaleGrid Blog" width="967" height="515" /></a>

It works! You can now click on the various charts to visualize the data in different graph formats.

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-22.png"><img class="alignnone wp-image-2639 size-full" style="border: 2px solid #eeeeee; margin: 30px 0px 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-22.png" alt="Graphic Formats Appache Zeppelin - ScaleGrid Blog" width="856" height="504" /></a>

Similarly, for MongoDB, make sure you have data in the MongoDB cluster. You can add some by going to the Admin Tab and running Mongo queries.

Here's an example of some MongoDB data in the note:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/Inkedpasted-image-0-23_LI.jpg"><img class="alignnone wp-image-2641 size-full" style="border: 2px solid #eeeeee; margin: 30px 0px 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/Inkedpasted-image-0-23_LI.jpg" alt="MongoDB Data Appache Zeppelin - ScaleGrid Blog" width="1182" height="336" /></a>

<h1><span style="font-weight: 400;">Share Links to your Notes</span></h1>
Now that your data ready for visualization and querying, you may want to show it off to your team. You can do this very easily by creating a shareable link to the note:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-24.png"><img class="alignnone wp-image-2643 size-full" style="float: right; border: 2px solid #eeeeee; margin: 0px 0px 30px 30px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-24.png" alt="Share Note Links Appache Zeppelin - ScaleGrid Blog" width="250" height="467" /></a>

This shareable link will be available for anyone to view, and you can also choose to share a link to a specific graph only:

<a href="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-25.png"><img class="alignnone wp-image-2642 size-full" style="border: 2px solid #eeeeee; margin: 30px 0px 30px 0px;" src="https://scalegrid.io/blog/wp-content/uploads/2017/10/pasted-image-0-25.png" alt="Shareable Link Appache Zeppelin - ScaleGrid Blog" width="1600" height="428" /></a>

<h1><span style="font-weight: 400;">Apache Zeppelin Conclusion</span></h1>
Apache Zeppelin is an immensely helpful tool that allows teams to manage and analyze data withÂ many different visualization options, tables, and shareable links for collaboration.

You can also explore other ways to visualize your data through MongoDB GUI's, including the top four: <a href="https://scalegrid.io/blog/which-is-the-best-mongodb-gui/" target="_blank">MongoDB Compass, Robomongo, Studio 3T and MongoBooster</a>.

Here are some helpful links to get you started:
<p style="padding-left: 30px;"><a href="https://zeppelin.apache.org/download.html" target="_blank">Download Apache Zeppelin</a></p>
<p style="padding-left: 30px;"><a href="https://github.com/bbonnin/zeppelin-mongodb-interpreter" target="_blank">MongoDB Interpreter</a></p>
<p style="padding-left: 30px;"><a href="https://dev.mysql.com/downloads/connector/j/3.1.html" target="_blank">MySQL Connector</a></p>
As always, if you build something awesome, do tweet us about it <a href="https://twitter.com/scalegridio">@scalegridio</a>

If you need help with Redis hosting and management, reach out to us at <a href="mailto:support@scalegrid.io">support@scalegrid.io</a> for further information.