Build a Real-Time Data Visualization Dashboard With Couchbase Analytics and Tableau

Couchbase Server is a hybrid NoSQL database that supports operational and analytical workloads. Couchbase Analytics in Couchbase Server 6.0 brings “NoETL for NoSQL,” enabling users to run ad-hoc analytical queries on JSON data in their natural form — without the need for transformation or schema design — by leveraging a massively parallel processing (MPP) query engine.

Every enterprise has already invested in a visualization tool and therefore has a critical need to leverage existing investments. This includes not only tooling but also skillsets and training of business reporting and dash-boarding teams.

I’ve always believed that the proof is in the proverbial pudding when it comes to analyzing and visualizing JSON data in real time. For more info Tableau Training

Data Model

Try It out in 5 Clicks: Setting up a Cluster With Couchbase Analytics

If you are new to Couchbase, you can download Couchbase Server 6.0 and try this on your own. You can choose to install Couchbase on single machine or install a cluster. The instructions below are for adding a new node to a cluster. If you are running everything on a single machine, please ensure that data and analytics services are running on the node.

A subset of the dataset used in the demo is available for download. You will need to download and extract the demo dataset.

Use the “cbimport” utility to import this dataset in your own Couchbase 6.0 cluster. The command to do this on the Mac is:

/Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin/cbimport json -c &lt;cluster_host_name_or_IP&gt; -u &lt;username&gt; -p &lt;password&gt; -b cars -f lines -d file://<unzipped_list.json_file> -g “#UUID#”

Now that you’ve got the readings from the cars on the road available in the operational cluster, let’s add an analytics node to the cluster to start exploring and analyzing the readings being sent in real time. You’ll need to login to the Couchbase admin console to follow the steps below. You can also follow along with the demo video mentioned above.

  1. Click on “Add Server” on the top right corner of your screen.
  2. You’ll need to provide the details in the dialog as follows:
  3. In the same dialogue, click on “Add Server” button
  4. Choose the amount of memory to assign to the Couchbase Analytics node
  5. Finally click “Rebalance”. Learn more skills from Tableau Certification

In 5 clicks, you have added a brand new service Couchbase Analytics to your cluster.

Now let’s make the operational data available for analytics by creating a shadow dataset.

create dataset on cars where `type`=”telematics”;

connect link Local;

By running the above statements in the Couchbase Analytics workbench, you have now created a shadow dataset for data analysis and exploration:

Data Exploration

Let’s start exploring the data. If I were the operations manager, I would like to know if the problem is widespread and if it affects more than one type of car.

Total # of cars with TPMS ON
select * from cars 
where TPMS="ON" 
limit 1000
Types of cars having with this condition
select ModelType, count(*) as count from cars 
where TPMS="ON"
group by ModelType
Sample result
[
  {
    "count": 1052,
    "ModelType": "Compact car"
  },
  {
    "count": 1106,
    "ModelType": "Hybrid"
  }
]

If you are a SQL developer, the queries above should be familiar. Couchbase Server enables analytics teams to bring their existing SQL skills to the schema-less and nested world of JSON data.

Are there any false positives?
select * from cars 
where TPMS="ON" 
AND (EVERY tp in cars.TirePressure  SATISFIES tp > 30)
limit 1000

Now let’s rule out a false positive. There may be a situation where the TPMS indicator may be sending a faulty reading but the actual tire pressure values might be ok. The actual tire pressure readings are being sent as a JSON array. Let’s check if they are actually low.

The above query returns those values where the TPMS indicator is “ON” but the actual tire pressure is above 30 psi which is the safe limit. In case you didn’t notice, the analytics engine is working off of the same JSON arrays modeled in the application so there is no transformation of data which is analyzed in its natural JSON form. #NoETLforNoSQL. Get more skills from Tableau Online Course

Creating a Real-Time Visualization in Tableau

Let me now walk through the steps of connecting Tableau with Couchbase Analytics.

  1. Open Tableau desktop application and choose “Connect to Other Database (ODBC)”
  2. Choose the option to connect using a DSN (data source name)
  3. Choose the DSN created in the previous step
  4. Click the “Sign In” button and navigate to the Tableau workbook interface
  5. On the left side of the screen, select “CData” as the database.
  6. Click on the “Select Schema” dropdown and click on the search icon and choose Couchbase.

Click on the search icon in the table section.

Create a workbook and choose the dimension such as model type and measure for the count of distinct VIN to create a simple graph.

Achieving real-time operational analytics is business imperative, but in doing so, organizations face obstacles, such as:

  • provisioning data in legacy data architectures taking weeks, or even months
  • a lack of skills required to modernize within their traditional IT department
  • difficulty building business cases for modernization in the absence of a fast and direct return on investment
  • limited insight due to the complexity of custom reporting and lack of operational dash-boarding.

Couchbase Analytics addresses these concerns and makes it really easy to run hybrid operational and analytical workloads in a single Couchbase cluster.

The hybrid architecture in Couchbase enables real-time analysis of JSON data generated by operational applications and avoids the heavy lifting of data lakes, data warehouses, and complex ETL processes.

To get in-depth knowledge, enroll for a live free demo on Tableau online Training

Leave a comment

Design a site like this with WordPress.com
Get started