# ClickHouse: Free Open Source Real-Time Analytics at Scale

Source: https://www.youtube.com/watch?v=Z1Mko6feRJs
Recap page: https://rapidrecap.app/video/Z1Mko6feRJs
Generated: 2025-11-11T13:02:09.453+00:00

---
## Quick Overview

The video demonstrates how to deploy and use a free, open-source ClickHouse analytical database instance on Elestio's platform, covering setup via the web UI, cost estimation, and basic SQL queries using the Tabix tool, concluding with an example of integrating ClickHouse with a Node.js application.

**Key Points:**
- The presenter deploys a ClickHouse instance using the Elestio platform, which offers managed DevOps services for deploying code and open-source software on any cloud or on-premise.
- The deployment process involves selecting ClickHouse from the service catalog on Elestio, choosing a cloud provider (Netcup in the demo), region (Germany/Nuremberg), and service plan (Medium-2C-4G), with an estimated starting cost around $53 per month.
- After deployment, the user accesses the database via the Tabix UI, creates a `web_analytics` table using a specific `MergeTree` engine, and inserts sample data.
- Basic SQL queries are executed successfully in Tabix, such as counting event types (`click` vs. `page_view`) and calculating average page load times per country, showcasing ClickHouse's speed.
- The video provides instructions for integrating ClickHouse with a Node.js application, including installing the `@clickhouse/client` package via npm and using connection details (host, user, password) retrieved from the Elestio email notification.
- The final Node.js example demonstrates connecting, creating a table, inserting data, and executing a query to retrieve page visit statistics, confirming the database is functional and fast for analytical workloads.

![Screenshot at 00:05: The ClickHouse landing page highlights its capability as the "fastest analytical database for ML & GenAI" and displays logos of trusted companies like Meta, Spotify, and Microsoft.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-00-05.png)

**Context:** This video serves as a tutorial demonstrating the ease of setting up and utilizing ClickHouse, a high-performance, open-source, column-oriented database ideal for real-time analytics and OLAP scenarios, specifically hosted and managed through the Elestio DevOps platform. The presenter guides viewers through the entire workflow, from initial provisioning to basic querying and back-end integration using Node.js.

## Detailed Analysis

The tutorial begins by showing the Elestio platform, which offers fully managed DevOps to deploy code and open-source software. The user navigates to deploy a ClickHouse instance, selecting Netcup as the cloud provider in the Europe/Germany/Nuremberg region under the Medium-2C-4G plan, estimated at approximately $0.0192/hour or about $53 per month. Once deployed, the user accesses the service dashboard to retrieve credentials and then moves to the Tabix SQL editor. A sample web analytics table (`web_analytics`) is created using the `MergeTree` engine, populated with sample data via `INSERT` statements, and then queried to demonstrate performance, such as grouping page views by event type and retrieving average duration per country. The video then shifts to Node.js integration, showing the necessary steps: initializing a project with `npm init`, installing the `@clickhouse/client` via `npm install @clickhouse/client`, and updating `index.js` with the connection details (host, username 'root', and password) provided in the initial setup email. The final step is running the Node.js script, which successfully executes SQL commands (table creation, data insertion, and a complex analytical query) and outputs the results, confirming the successful integration and fast query execution time (e.g., 20ms for the final query).

### ClickHouse Value Proposition

- The fastest analytical database for ML & GenAI
- Unlocks faster queries without skyrocketing costs
- Trusted by Meta, eBay, Spotify, and others.

### Elestio Deployment Process

- Select service (ClickHouse)
- Choose provider (Netcup selected) and region (Germany/Nuremberg)
- Select service plan (Medium-2C-4G selected)
- Estimate monthly cost ($0.0192/hour or ~$53/month).

### Database Setup and Initial Querying (Tabix)

- Create `web_analytics` table with `MergeTree` engine
- Insert 10 rows of sample web traffic data
- Run query to count event types (4 clicks, 16 page views) and group by country for average duration.

### Node.js Integration Setup

- Install client using `npm install @clickhouse/client`
- Configure client instance using host URL, username ('root'), and password from the Elestio email notification.

### Node.js Query Execution

- Code defines a query to select page URL, count visits, and average duration, filtering for 'page_view' events and grouping by page URL. Running the script successfully returns the aggregated data in milliseconds.

![Screenshot at 00:05: The ClickHouse landing page highlighting its primary claim as the "fastest analytical database for ML & GenAI" and showcasing major corporate users.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-00-05.png)
![Screenshot at 00:17: The Tabix SQL editor interface connected to the ClickHouse server, showing the structure view with the newly created 'default' database.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-00-17.png)
![Screenshot at 00:38: The Elestio pricing calculator showing the Basic plan starting around $53 per month for the selected configuration.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-00-38.png)
![Screenshot at 00:44: The Elestio documentation page presenting installation guides for various platforms, with the user selecting the Docker option.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-00-44.png)
![Screenshot at 01:05: The Elestio service creation screen where the user searches for and selects the ClickHouse database service.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-01-05.png)
![Screenshot at 01:20: The service configuration step in Elestio, showing cloud provider selection \(Netcup highlighted\), region selection \(Germany/Nuremberg\), and service plans.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-01-20.png)
![Screenshot at 02:31: The SQL query in Tabix used to create the web\_analytics table using the MergeTree engine.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-02-31.png)
![Screenshot at 02:52: The output in Tabix after inserting data, showing the raw rows successfully loaded into the web\_analytics table.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-02-52.png)
![Screenshot at 03:35: The result of the first analytical query showing average page load time per country, sorted descendingly.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-03-35.png)
![Screenshot at 05:22: The Node.js code \(index.js\) showing the structure for creating a client instance and defining the query to fetch page view statistics.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-05-22.png)
![Screenshot at 06:17: The final execution result in the terminal after running node index.js, displaying the aggregated web analytics data retrieved successfully from ClickHouse.](https://ss.rapidrecap.app/screens/Z1Mko6feRJs/00-06-17.png)
