> ## Documentation Index
> Fetch the complete documentation index at: https://data.wiki/llms.txt
> Use this file to discover all available pages before exploring further.

# Task 2: Real-Time Analytics

> Real-time data processing and analytics with ClickHouse and Kafka

![ClickHouse and Metabase Integration](https://clickhouse.com/uploads/metabase_clickhouse_095d5b286e.png)

## Task 2 Overview: Real-Time Analytics with ClickHouse

In this task, you'll learn how to build a real-time analytics pipeline using ClickHouse, Kafka, and Metabase. You'll deploy ClickHouse as both a server and client, ingest streaming data, and create interactive visualizations.

### Learning Objectives

* Deploy ClickHouse server and client
* Integrate ClickHouse with Kafka for real-time streaming
* Create materialized views for data processing
* Connect ClickHouse to Metabase for visualization
* Build interactive dashboards with geospatial data

## ClickHouse Installation and Setup

### Install ClickHouse

First, we need to install DuckDB to our Codespaces. DuckDB runs almost anywhere and it's very easy to install.

<Accordion title="Installation Hint">
  Visit the [ClickHouse quickstart page](https://clickhouse.com/docs/getting-started/quick-start/oss) for installation instructions.

  For Codespaces, you can typically install it using:

  ```bash theme={null}
  curl https://clickhouse.com/ | sh  
  ```
</Accordion>

### Start the ClickHouse Server

<Accordion title="Hint">
  ```bash theme={null}
  ./clickhouse server
  ```
</Accordion>

### Test the ClickHouse Client

Test that ClickHouse is working correctly.

<Accordion title="Hint">
  ```bash theme={null}
  # Connect to ClickHouse
  ./clickhouse client
  ```

  ```sql theme={null}
  -- Test basic queries
  SELECT version();
  SELECT currentDatabase();
  SHOW DATABASES;
  ```
</Accordion>
