Chevron Left

See all Community Stories

Real-time data analytics with Metabase and CrateDB

January 19, 2023

Contributed by

Matej Matkuliak

Crate

photo of Matej Matkuliak

Matej is a Technical Writer at Crate, a distributed SQL database built on top of a cloud-native architecture. Matej mainly writes about the CrateDB Cloud, a fully managed database-as-a-service product.

You can use CrateDB and Metabase to get insights from various types of data including time series, relational, geospatial, and structured/semi-structured data. In this tutorial, we’ll show you how to use Metabase with CrateDB to analyze massive amounts of data in real-time.

Getting started with CrateDB

CrateDB is an open-source, distributed SQL database for real-time data analytics. CrateDB offers easy integration with PostgreSQL compatible tools, horizontal scalability, availability, and the capability to store and analyze massive amounts of data. To get started with CrateDB, set up a running cluster in CrateDB Cloud. Please check CrateDB’s documentation on building the cluster from scratch. Once the cluster is up and running, open the Admin UI:

CrateDB cluster

Now, let’s import some sample data. Return to the overview page and click on “Learn how to import data” link. This will open a list of statements you need to execute to load NYC taxi data:

Importing sample data

Connecting CrateDB with Metabase

The first step will be adding your CrateDB cluster as a new database. Go to the Admin Settings -> Setup, and choose the Add a database option.

Adding CrateDB cluster as a new database

Database configuration requires the following fields:

  • Database type (select PostgreSQL)
  • Display name
  • Host (the URI of your cluster)
  • Database name
  • Username
  • Password

Database configuration

Finally, make sure you also select “Use a secure connection (SSL) option” (unless your cluster isn’t configured for SSL). After submitting your details, Metabase will sync with your CrateDB cluster for a few moments. When the sync completes, you will get a message saying, “Syncing complete”.

"Syncing complete" message

Asking questions

Now you’re ready to visualize your data.

Open up Metabase and click on New -> Question in the upper right corner. Then select the CrateDB database and one of the tables. For example, we could ask about the Average tip amount, sorted by the passenger count.

Metabase query builder

Metabase then provides a visualization of the results.

Metabase visualization

When you save a question in Metabase, you will also be asked if you want to add it to a dashboard. Dashboards provide an easy way to monitor your data.

Metabase dashboard

Wrap up

If you’d like to see how the other questions were configured, feel free to check out our video tutorial on this topic, or, to CrateDB Cloud Console and get started.

Contributed by

Matej Matkuliak

Crate

photo of Matej Matkuliak

Matej is a Technical Writer at Crate, a distributed SQL database built on top of a cloud-native architecture. Matej mainly writes about the CrateDB Cloud, a fully managed database-as-a-service product.

You might also like

Anticipating the next click

Ukrit Wattanavaekin

Metabase

Data driven product management

Victor Bolu

WebAutomation

You might also like

Anticipating the next click

Ukrit Wattanavaekin

Metabase

Data driven product management

Victor Bolu

WebAutomation