How to Connect Azure IoT Hub and CrateDB Cloud to Ingest IoT Sensor Data

This article will describe how to launch a CrateDB cluster on Azure, connect it to Azure IoT Hub, and test it by ingesting simulated sensor data using an Azure IoT Solution Accelerator.

Step #1: Simulating Sensor Data

It’s necessary to first understand the type of data your IoT application will produce in order to accurately mimic this information for testing purposes. Smart factories, for example, will have myriad sensors that collect data in a variety of structures. CrateDB makes it possible to model different data structures in a single table through the use of dynamic objects, which can be queried to an arbitrary depth (this is not a recommended practice for production, but is helpful within the simple confines of this demonstration).

Setting Up a CrateDB Cluster With Kubernetes to Store and Query Machine Data

Because of its horizontally scalable shared-nothing architecture, the CrateDB open source database is well-suited for working with Kubernetes. Setting up a CrateDB cluster with Kubernetes can be done in just a few steps, and scaling up and down is straightforward – making the cluster particularly flexible. This step-by-step tutorial will show you how to get CrateDB and Kubernetes working together.

CrateDB is used for real-time machine data processing, monitoring, and analytics. The open source database is suited for applications with high volumes of machine data (like anomaly detection), log data (like ecommerce), network data (like capacity planning), and IoT/IIoT data (like smart manufacturing, smart home products, and fitness gear). However, this database is probably not what you want to use if you require strong (ACID) transactional consistency or highly normalized schemas with many tables and joins.

How to Get Started Using CrateDB and Grafana to Visualize Time-Series Data

Grafana, the open platform for time-series data visualization and monitoring that is quite useful for time-series analytics, makes a pretty compelling team when paired with CrateDB, the open-source distributed SQL database that simplifies the real-time storage and analysis of massive quantities of machine data.

Getting started using Grafana and CrateDB together is a relatively simple process, which this article will walk you through (these instructions pertain to macOS, but can be adapted for other platforms quite easily).