Back to Blog
    supersetvisualizationanalyticsopen-sourceclickhouse

    Visualizing Real-Time Data with Apache Superset

    Aivena Engineering2026-02-112 min read

    Visualizing Real-Time Data with Apache Superset

    For years, the BI landscape was dominated by expensive, proprietary tools like Tableau and Looker. While they were excellent for static reports on data warehouses that updated once a day, they struggle in the era of Real-Time Analytics.

    When your data is landing in ClickHouse every millisecond, you need a visualization layer that can keep up. Enter Apache Superset.

    The Scalability Architecture

    A professional Superset deployment isn't just a single web server. To handle hundreds of concurrent users, it requires a distributed architecture.

    graph TD subgraph LB [Load Balancer] Ingress[Traefik / Ingress] end subgraph App [Superset Cluster] S1[Web Server 1] S2[Web Server 2] end subgraph Workers [Async Execution] C1[Celery Worker] C2[Celery Worker] end subgraph State [State & Cache] Redis[(Redis: Metadata & Results)] PG[(Postgres: Config)] end subgraph Databases [Data Sources] CH[(ClickHouse)] Trino[(Trino)] end Ingress --> App App --> Redis App --> PG App --> Workers Workers --> Redis Workers --> Databases App --> Databases style App fill:#f5f7ff,stroke:#4a6cf7 style Workers fill:#f0fff4,stroke:#22c55e style State fill:#fff9f0,stroke:#f59e0b

    1. Dynamic Dashboards with Jinja Templating

    One of Superset's most "expert-level" features is its support for Jinja templating in SQL Lab. This allows you to build dashboards that react to user attributes or complex filters.

    Example: User-Based Row-Level Security

    sql

    SELECT * 

    FROM transactions

    WHERE region_id IN (

    {{ current_user_metadata('region_ids') }}

    )

    AND timestamp > '{{ from_dttm }}'

    AND timestamp < '{{ to_dttm }}'

    Note: This is pre-configured on Aivena Data OS, where Keycloak user metadata is automatically injected into the Superset session.

    2. Embedded Analytics: Superset in Your App

    If you are building a SaaS product, you likely want to show analytics to your customers. Aivena supports Superset Embedded SDK.

    1. Generate a Guest Token: Use the Aivena API to request a token for a specific user and dashboard.
    2. Embed via SDK:

    javascript

    import { embedDashboard } from "@superset-ui/embedded-sdk";

    embedDashboard({

    id: "dashboard-id",

    supersetDomain: "https://superset.aivena.io",

    mountPoint: document.getElementById("my-dashboard"),

    fetchGuestToken: () => fetch("/api/get-guest-token"),

    dashboardUiConfig: { hideTitle: true, hideTab: true }

    });

    3. Performance Tuning: Pushdown Everything

    The secret to sub-second dashboards is ensuring that Superset does zero computation.

    * Aggregating in SQL: Never pull raw rows into Superset. Use the "Group By" features in the Explore UI, which pushes the SUM(), COUNT(), and GROUP BY down to ClickHouse.

    * Result Caching: Aivena pre-configures a Redis-based results cache. If two users look at the same dashboard, the second one gets the result in under 10ms without even hitting the database.


    Ready to modernize your BI? Deploy Apache Superset on Aivena Data OS today.