Visualizing Your Data With MongoDB Charts

Having data stored in a database is practically a given for today’s businesses. Customer information, order history, product pricing, IoT sensor data, and much more is being recorded for future use. However, just having the data stored isn’t enough to form a competitive market advantage. We must be able to analyze the data as well. There are many options to do so and in a variety of ways. If you have data that needs to be visually analyzed in MongoDB, MongoDB Charts is a terrific option.

Prior to MongoDB Charts, there were really three ways to visualize your MongoDB Data.

  1. Leverage the MongoDB Business Intelligence (BI) Connector in conjunction with third-party BI tools,
  2. Perform Extract-Transform-Load (ETL) operations and leverage third-party tools, or
  3. Write custom code and use charting libraries such as D3.js or Bokeh.

MongoDB Charts Benefits

MongoDB Charts, currently in Beta, provides an easy way to visualize your data living in MongoDB. You don’t need to move your data to a different repository, write your own code, or purchase third-party tools. MongoDB Charts knows and understands the richness of the Document Data Model and allows for easy data visualization.

Further, MongoDB Charts allows for a secure way to create and share visualization dashboards with everyone, or just targeted team members. Similarly, the data source being used behind the scenes can be shared securely as well. For example, data for the Sales Department doesn’t have to be made available to Marketing unless needed. Very powerful and follows MongoDB’s design of security being a top priority.

After downloading the MongoDB Charts Docker image and following the installation instructions, we’re able to connect to a data source stored in MongoDB Atlas and start making visualization dashboards. Once connected to the MongoDB Charts server, there are three steps we need to take:

  1. Add a data source
  2. Create a dashboard
  3. Create our charts

Analyzing Airbnb Data with MongoDB Charts

I have set up a database with some Airbnb data from various cities. We’ll be exploring the dataset from Seattle, WA here, but feel free to explore others on your own. We need to get the connection string from the Atlas Cluster that has our data and connect to it in Charts.


Get URI From MongoDB Atlas for MongoDB Charts
Get URI from MongoDB Atlas

Add a Data Source

With our MongoDB Charts server running on localhost:80, we can log in and head to the Data Sources tab. We use the URI from Atlas (mongodb+srv://airbnbdemo:airbnb@airbnb-rgl39.mongodb.net/test?retryWrites=true) and select Connect. We’re next asked which data source we want to use from that cluster, I’ll select the seattleListingAndReviews from the airbnb database for this example. For permissions, I just want to keep everything private so I’ll accept the defaults and select Publish Data Source. Once published I can add an alias to the data source. I’ll call it Airbnb Seattle.

Note: The URI above contains a sample URI. You should connect to your own Atlas Cluster and use an authorized username and password.

Create a Dashboard

Next up is to create an actual dashboard to house our visualizations. In the Dashboards section choose New Dashboard and give it a name and description, like Ken’s Airbnb Dashboard. This will take me to where I can add charts to my dashboard.

Create a Chart

After clicking on the Add Chart button we can start building our visualization. We’ll want to choose the Airbnb Seattle data source from the drop-down. MongoDB Charts automatically determines which fields are available for exploration. For this exercise, I’d like to see which neighborhoods in Seattle have the most Airbnb properties and split them by property type. We’ll use the Stacked Bar chart for the type.

    1. For the X-Axis then, we’ll want the id field, aggregated by count.

Assign X-Axis value in MongoDB Charts
Assign X-Axis value to a MongoDB Chart
    1. Along the Y-Axis we’ll look at the address and the suburb. Notice that address is a subdocument here and that MongoDB Charts natively knows how to handle this type of data. I’d like to sort the suburb by aggregated value, in descending order, and limit our results to the top 20 suburbs.

Assign Y-Axis value to a Stacked Bar in MongoDB Charts
Assign Y-Axis value to a Stacked Bar chart
    1. Let’s add the property_type field as our series

Assign a Series value to a Stacked Bar chart in MongoDB Charts
Assign a Series value to a Stacked Bar chart

Now we can name our chart, Properties by Location and save it. We’re then taken back to our dashboard where we can add other visualizations for further exploration.

Have a look at this short video to see some other visualizations being created from this same data source.

Conclusion

MongoDB Charts is an excellent new tool to visually explore your data. It has some great features for specific use cases, such as:

  • Ad hoc analysis of your data
  • Natively understands the benefits of the Document Data Model
  • Collaboration on projects is easy with user-based sharing and permissions
  • It’s intuitive enough for non-developers to use allowing for self-service data analysis

MongoDB Charts is the fastest way to build visualizations over your MongoDB data. I’d encourage you to download it and try it out today. Let me know what visualizations you come up with from the Airbnb dataset. I always enjoy seeing how people explore their data.


This post was first published on the MongoDB blog.

Facebooktwitterredditlinkedinmail

MongoDB World 2018 a Review and Retrospective

Every year MongoDB hosts a conference called MongoDB World. 2018 saw the conference return to New York City and the Midtown Hilton on the 26th and 27th of June. There were a lot of exciting announcements made, sessions to attend, and people to meet.

I had a slightly different experience than many of the over 2,000 attendees at the conference. I received invitations to a few different events and presented in a couple of different sessions. I’d like to spend this post talking about my experience at MongoDB World 2018. Hopefully, it provides you with some motivation to attend the event next year. Or, if New York is too far to travel, to attend a local MongoDB community event.

MongoDB World Day 1 – 26 June 2018

The first day of the conference had a few different offering. First, there were hands-on full-day workshops. These allowed people to get some detailed, hands-on exposure to MongoDB. Topics ranged from data modeling to security. While I didn’t attend any of these sessions I heard great things about them from others.
 
So how did I spend day one of MongoDB World 2018? The developer advocacy team at MongoDB put on an amazing day of learning. It also provided access to some key team members. Jay Gordon was our host for Developer Advocacy Day and did a great job on the agenda. There was a nice mix of MongoDB team access along with career-oriented talks.

Developer Advocacy Day at MongoDB World

Several MongoDB employees were there for the majority of the day including Michael Lynn (Global Director of Developer Advocacy), Joe Drumgoole (Director, Developer Advocacy, EMEA), and Aydrian Howard (Developer Advocate). They were around to answer questions from the 60 or so developers in this invite only session. Additionally, several MongoDB Masters in attendance that were a joy to talk with. Additionally seeing, and meeting, people from around the country and world was exciting.

Technical

There were sessions coving many of MongoDB’s product offerings, such as Stitch and Atlas. Francesca Krihely provided some excellent information on the MongoDB Accelerator Program, which was great to learn about.

We had the opportunity to have MongoDB Co-Founder and CTO Elliot Horowitz joined us for a Q&A session. He answered several questions about MongoDB past, present, and future. This was the day before many big announcements so many answers were pretty broad in scope. But, having access to Mr. Horowitz in this close-knit environment was awesome.
 
Another great session was the panel discussion of MongoDB product and engineers. This provided another rare opportunity to get questions answered about specific product features. Further, it allowed us to get an idea about some of the internals of the various products MongoDB offers.

Career Oriented Discussions

Taking Care of your Engineering Manager

Jenna Zeigen from Slack provided a nice talk about things to think about as an individual contributor in an engineering department. It was great to hear her insights as a former manager. Check out her slides here.

Branding

There was a very informative talk by Brandy Morgan on social media marketing. She covered things to do and consider for managing business and personal branding. She did a nice job of walking through some techniques to increase one’s social media presence. If doing so is of interest to you, she is launching a new company and site in September 2018 to provide advice. Sign up for creatorscode.co now to get on the waitlist, or view her talk here.

Community Involvement

I presented a talk to this group of developers. The topic was Getting Involved in Community to Advance Your Career. I talked about my journey in the MongoDB community, some ways to get involved, and how that involvement can benefit your career. Including personal examples from my own life. The slide deck is available here, and I’d be happy to answer any questions on how to get started.

MongoDB World Day 2 – 27 June 2018

Sessions

Mr. Lynn and I presented a talk during the first session on Wednesday. The talk was MongoDB & NodeJS: Zero to Hero in 80 Minutes. There were some unplanned technical issues during the talk making us have to change presentation plans mid-way. However, we made it through and received some positive feedback for the session overall. If you’re interested, you can explore the GitHub repository here to learn more about Node.js and MongoDB.

Video Interview

Jay Gordon grabbed me again for a quick sit down interview to discuss my thoughts on the event.

MDBW18 Interview
Jay Gordon (left) & Ken W. Alger Interview
Innovation Awards

Wednesday night after the conference ended, the 2018 Innovation Award ceremony occurred. MongoDB recognized companies “who are using MongoDB to dream big and deliver incredibly bold, innovative solutions that are moving forward industries and changing lives for the better.”

Companies like accenture, Charles Schwab, and Coinbase, among others, received awards for their creative and innovative development solutions backed by MongoDB. It was great to be in the room with them. Learning how MongoDB is being leveraged is always interesting.

Learning about how 7-Eleven is utilizing Atlas was fascinating. Medical device provider, Humana, won for their implementation for the Internet of Things category. As someone who is interested in IoT, I found that interesting

Zola Award at MongoDB World 2018
2018 William Zola Award for Community Excellence. Ken W. Alger (left) with Michael Lynn (right), Global Director of Developer Advocacy, MongoDB

Wrap Up

MongoDB World 2018 was a spectacular event. They haven’t announced yet where MongoDB 2019 will be. Wherever it is, I would highly recommend you attend.

Facebooktwitterredditlinkedinmail