Building a custom front-end visualization that fetches data from a managed ClickHouse instance from Altinity.Cloud and Cube Cloud as the metrics API layer.
Join the DZone community and get the full member experience. I like counting stars. Especially stars on GitHub! Tracking the growth of popular GitHub repositories has always been interesting to me. That’s why I decided to use the public data set of GitHub events in ClickHouse to create dashboards with actionable metrics. In this tutorial, I’ll explain how to build a custom front-end visualization that fetches data from a ClickHouse instance. I’ll use a managed instance of ClickHouse from Altinity Cloud and Cube Cloud as the metrics API layer. If you would like to use a low-code solution like Apache Superset, check out this article by my co-worker Igor! Here’s what the metrics dashboard app will look like once I’m done. You can also look at a live preview. I want to use the public GitHub Events dataset that represents data from all events that are generated by GitHub since 2011. This data has more than 3 billion elements. Pretty massive, isn’t it? To handle all this data, I want to use ClickHouse. It’s a powerhouse of a database for building analytics apps. ClickHouse is also often used for metrics storage. Most commonly in conjunction with other databases to materialize views for metrics. However, I don’t want to waste time and my own nerves on running the infra myself. I’m a developer, why should I? I’d much rather have a managed ClickHouse instance configured by professionals. Altinity fits my needs perfectly. I get a managed service for ClickHouse with all the features I need without worrying about scaling the infrastructure. Even though ClickHouse is lightning-quick, I still need an API to consume the data and display it on metrics dashboards. I’ll use Cube Cloud as the metrics layer to generate queries for my analytics. Cube is an analytics API for building data apps. With all that out of the way, let me explain my reasoning behind my decisions. ClickHouse is a fast open-source column-oriented database management system that allows generating analytical data reports in real-time using SQL queries. It uses a columnar storage engine that enables it to have high performance for analytical queries. The success of ClickHouse and the huge adoption have led to a $250 million series-B investment. ClickHouse delivers high query processing speed and data storage efficiency. It’s capable of processing more than 100 PBs of data with more than 100 billion records inserted every day. There are a few different ways to run ClickHouse The simplest solution I ultimately decided to use is Altinity. Let me explain why. Altinity. Cloud is a fully managed service for ClickHouse by ClickHouse Enterprise Experts. It runs in the region where your apps are located, not the region that’s convenient for Altinity. I can pick any AWS or GCP region and the folks over at Altinity will make it work for me. Active regions are available for immediate deployment. If I need a new region, I just ask and they make it available in a couple of days. Pretty awesome! I can spin up clusters, connect, and start working right away. They provide vertical and horizontal scaling as well. High availability is also enabled by default, I get multi-AZ operation and automatic backup. I also get automatic upgrades without interrupting service. Lastly, monitoring is part of the package deal as well. Sweet deal in my book. I can focus all my effort on creating value instead of managing infrastructure. With all of that out of the way, let’s jump into creating a ClickHouse cluster on Altinity. Cloud. The signup process is simple. First, go to the test drive page on Altinity. Then, add your info and ask the Altinity team to spin up a ClickHouse cluster for you.