Skip to main content

Dashboards on any SQL database,
without copying the data.

Superset connects to almost any database that speaks SQL, builds charts without code or through SQL Lab, and gathers them into dashboards, without keeping the data itself. Follow a dashboard from the moment it opens in the browser to the drawn chart and see what is stored, what goes to the cache, and what runs in the background.

A data visualization platform is the web application where data is explored, visualizations are built, and dashboards are assembled on top of the databases that already exist.

Apache Superset is the TDP dashboard platform: it is where analyses become dashboards.

The data stays where it is

No storage of its own

Superset does not store the data it analyzes: it connects to a database that speaks SQL, such as Trino, and sends the query through that database's driver.

From dataset to dashboard

Charts without writing code

On top of a dataset, a chart is built through menus. Whoever prefers SQL writes the query in SQL Lab.

The second time, from the cache

Less load on the database

The caching layer stores the results of queries: the same chart, opened again, is served without going back to the database.

On this page

Watch a dashboard open​

Press Play or step through. The underlined names lead to the Glossary.

BrowserWho views
BrowserOpens a dashboard
SupersetWho builds the query
Superset applicationBackend, API, and web interface
Stored in SupersetDefinitions and results
Metadata databaseDashboards, charts, and datasets
Caching layerResults of queries already run
Data sourcesWhere the data lives
TrinoQuery engine
PostgreSQLRelational database
Step 1 of 6

1 The dashboard is opened

Someone opens a dashboard in the browser. The application fetches from the metadata database the definition of the dashboard and of each of its charts: the query, the visualization type, the chosen options, and the name.

  1. The dashboard is opened. Someone opens a dashboard in the browser. The application fetches from the metadata database the definition of the dashboard and of each of its charts: the query, the visualization type, the chosen options, and the name.
  2. Each chart becomes a SQL query. For each chart, the application generates the SQL statement on the chart's dataset. If there are row-level security filters that apply to the person viewing, their clauses go into the WHERE of the generated statement.
  3. First, the cache. The caching layer stores the results of queries already run. The first time the chart is opened, the result is not there yet, and the query goes on to the database.
  4. The query goes to the database. The statement goes to the database where the dataset lives, through that database's SQLAlchemy driver and dialect. Here, one chart reads from Trino and another from a PostgreSQL: Superset has no storage of its own for the data.
  5. The result becomes a visualization. The data returns to the application, the result is written to the cache, and the browser draws each chart on the dashboard.
  6. The second time, from the cache. When the same chart is loaded again, the result comes from the cache, without going back to the database: the response is faster and the database receives less load. How long the result remains valid can be set per chart, per dataset, or per database.
Figure 1 - A dashboard in Superset. The definition comes from the metadata database, the data comes from the queried database, and the result is kept in the cache for next time.

Architecture​

The application and a metadata database are enough to get started. Cache, worker, and beat enable the features that run in the background.

Apache Superset architecture: application, metadata database, cache layer and broker, results backend, worker and beat, and data sourcesThe browser accesses the Superset application, made up of the Flask backend with the API and the React interface. The application queries the data sources, such as Trino, Hive, PostgreSQL and ClickHouse, stores the definitions in the metadata database and uses the cache layer, which also serves as the broker for the worker and the beat. The worker runs background tasks on the data sources, writes the results to the results backend, which the application reads, and shares the same metadata database.BrowserSupersetapplicationFlask backendand APIReact interfaceCache layerand brokerResults backendMetadatadatabaseData sourcesTrinoHivePostgreSQLClickHouseBackgroundWorkerWorkerBeat
Figure 2 - Superset architecture: the application, the metadata database, the cache and broker layer, the results backend, the workers with the beat, and the data sources. The underlined terms lead to the Glossary.

What the figure shows:

  1. The browser accesses the Superset application.
  2. The Superset application brings together the Python (Flask) backend, the API layer, and the React web interface. It is what queries the data sources.
  3. The metadata database stores the definitions of charts and dashboards, the users, and the logs, and is not to be confused with the databases that Superset queries. The workers and the application share the same metadata database.
  4. The caching layer and broker stores the query results and also serves as the broker for the workers.
  5. The results backend receives what the workers query, and the application reads it.
  6. The background gathers the workers, which run the tasks in the background, and the beat, which tells the workers when to run each scheduled task.
  7. The data sources are the databases that Superset queries, such as Trino, Hive, PostgreSQL, and ClickHouse.

From dashboard to database​

Four levels, each built on the next. Go into each one.

Level 1 of 4

Dashboard

Gathers charts on a grid, where each one can be resized and positioned. Whoever does not edit the dashboard sees it according to the permissions on the datasets behind the charts.

  • Alerts and reportsA dashboard or a chart can be sent by email or to a Slack channel: at a scheduled time, as a report, or when a SQL condition is met, as an alert.
  1. Dashboard. Gathers charts on a grid, where each one can be resized and positioned. Whoever does not edit the dashboard sees it according to the permissions on the datasets behind the charts.
    • Alerts and reports. A dashboard or a chart can be sent by email or to a Slack channel: at a scheduled time, as a report, or when a SQL condition is met, as an alert.
  2. Chart. A visualization on a dataset: the chart type, the temporal column, the metrics, and the appearance. When saved, Superset stores everything needed to draw it again: the query, the type, the options, and the name.
    • Explore. The screen where the chart is built without code, by choosing the dataset, the visualization type, and the options.
  3. Dataset. The table chosen to be exposed to Superset, by database, schema, and name. It can be physical, backed by a table or view, or virtual, defined by a SQL query. Each column states whether it is temporal, filterable, or dimensional.
    • Semantic layer. Virtual metrics, which aggregate columns in SQL, and calculated columns, which adjust a column, defined once on the dataset and used in all charts.
    • Row Level Security. Filters assigned to the dataset that restrict the rows each user, role, or group sees.
  4. Database. The connection to a database that speaks SQL: a name and a SQLAlchemy URI. The data stays in the database. The connection can be shared with other Superset users.
    • SQL Lab. The web SQL editor that queries the connection directly, to clean, join, and prepare data before it becomes a chart.
Figure 3 - Each level is built on the next: the dashboard gathers charts, each chart is drawn on a dataset, and each dataset comes from a connection to a database.

One connection, one address​

At the innermost level, the connection to Trino is a single line.

Click each part of the address.

Dialect

States which SQLAlchemy dialect and which driver Superset uses to talk to the database. For Trino, the driver is the trino package, installed in the Superset environment.

See in the Glossary
trino:// — Dialect
States which SQLAlchemy dialect and which driver Superset uses to talk to the database. For Trino, the driver is the trino package, installed in the Superset environment.
{username}:{password}@ — Credentials
The user and password with which Superset identifies itself to the database. It is with this identity that the chart queries reach Trino.
{hostname}:{port} — Address
The host and port of the Trino Coordinator, which receives the queries.
/{catalog} — Catalog
The Trino catalog that holds the tables that become datasets: it states which data source is behind them.

Each database has its own address format and its own driver. Through Trino, a single connection reaches all the sources that its catalogs describe. See Trino.

What runs in the background​

Long queries, reports, and alerts do not fit in a web request: they go to the workers.

SQL LabWho asks
SQL LabLong query
SupersetWho receives
Superset applicationHands over the task
Queue and resultsWhat waits and what stays
BrokerTask queue
Results backendQuery results
BackgroundWho runs
WorkerRuns the task
BeatSchedules the tasks
Outside SupersetDatabase and destinations
TrinoRuns the query
Email or SlackReceives the report
Step 1 of 5

1 A query that does not fit in the request

On large analytic databases, a query can take minutes or hours, beyond the time limit of a web request. With asynchronous execution enabled on the connection, SQL Lab submits the query, and the application hands it to the broker as a task.

  1. A query that does not fit in the request. On large analytic databases, a query can take minutes or hours, beyond the time limit of a web request. With asynchronous execution enabled on the connection, SQL Lab submits the query, and the application hands it to the broker as a task.
  2. A worker picks up the task. A worker, implemented as a Celery worker, takes the task from the queue and runs the query on the database.
  3. The result is stored. The result returns to the worker, which writes it to the results backend: that is where the results of asynchronous queries are kept.
  4. At the scheduled time, the beat signals. The beat is the scheduler: at the time of a report, or at the check of an alert, it puts the task in the queue for the workers.
  5. The report goes out. The worker captures the dashboard or the chart and sends it by email or to a Slack channel, as PDF, PNG, or, for a chart, also with the data. The alert goes out when a SQL condition is met. The report, at the scheduled time.
Figure 4 - In the background in Superset. The application hands long work to the broker. A worker runs it, and the beat triggers what has a scheduled time.
Only one beat

Across the whole installation, a single instance of the beat runs. With more than one, scheduled tasks can be triggered in duplicate, and the same report arrives twice.

Who sees what​

Roles decide what each person can do. Row-level filters decide which data they see.

Admin

All rights, including granting and revoking access for other users and altering other people's charts and dashboards.

Alpha

Access to all data sources, which it can add and alter. It alters only the objects it owns and does not grant access to others.

Gamma

Consumes the data from the sources to which another complementary role gives access, and sees only the charts and dashboards built on them. It can create charts and dashboards.

sql_lab

Gives access to SQL Lab. Alpha and Gamma users receive access database by database.

Public

The most restrictive role, for those who view dashboards without authenticating: read access to dashboards and charts and use of the interactive filters.

Roles state what each person can do in Superset. Which rows they see is another layer: Row Level Security.

A row-level security filter is assigned to a dataset and to a set of users, roles, or groups, and its clause goes into the WHERE of the generated statement. Filters with the same group key are combined with OR. Different groups, with AND:

(department = 'Finance' OR department = 'Marketing') AND (region = 'Europe')

A regular filter applies to those among the assigned subjects. A base filter applies to everyone except those subjects. In SQL Lab, the filters apply when the RLS_IN_SQLLAB feature flag is enabled. Authentication and authorization across the whole platform are covered in Security.

Why Superset​

No code

Charts built through menus

A no-code interface for building charts quickly, from a dataset.

SQL

A SQL editor in the browser

SQL Lab serves advanced queries and the preparation of data for the charts.

Semantic layer

Metrics defined once

Custom dimensions and metrics live on the dataset and serve all the charts built on it.

Databases

Nearly any SQL database

Any database or query engine that has a Python driver and a SQLAlchemy dialect, such as Trino, Hive, and PostgreSQL.

Visualizations

From bar chart to map

A wide variety of visualizations, from simple bar charts to geospatial visualizations.

Platform

Security, API, and scale

Extensible roles and authentication options, an API for programmatic customization, and a cloud-native architecture designed to scale.

Where it comes from

Superset entered the Apache Software Foundation incubator in May 2017 and completed incubation in November 2020, becoming an Apache top-level project. It is distributed under the Apache 2.0 license.

In the TDP editions​

Available in the TDP editions
EditionVersionDocumentation
TDP Datacenter4.1.2TDP Datacenter components
TDP Kubernetes5.0.0 · chart tdp-superset 3.0.3Configuration in TDP Kubernetes

In TDP Datacenter​

In TDP Datacenter, Superset is a stack service, with the Superset component, installed and managed by Ambari.

Service components

SUPERSET (master, one or more). Component category.

Metadata database

A database in PostgreSQL, created during the Ambari installation, with the connection configurable in the superset configuration: the type in SUPERSET_DATABASE_TYPE and the address in SUPERSET_DATABASE_HOSTNAME, SUPERSET_DATABASE_PORT, and SUPERSET_DATABASE_NAME.

Installed drivers

Trino, Solr, Impala, MySQL, PostgreSQL, Pinot, Doris, Drill, Snowflake, Vertica, and Teradata, among others. Trino is the path to the lakehouse tables. See Trino.

Authentication

The authentication mode is set in AUTH_TYPE. LDAP authentication is configurable in the AUTH_LDAP_* properties, with automatic user registration in AUTH_USER_REGISTRATION and the role assigned at registration in AUTH_USER_REGISTRATION_ROLE. Kerberos authentication can be enabled in ENABLE_KERBEROS_AUTHENTICATION. See Security in TDP Datacenter.

TLS

Can be enabled in the superset-ssl configuration, in SUPERSET_SSL, with the certificate in SUPERSET_CERTFILE and the key in SUPERSET_KEYFILE.

Catalog in OpenMetadata

Creating a Superset dashboard service in OpenMetadata can be enabled in superset.enabled, with the integration turned on in integration.enabled, in the openmetadata_integration configuration. See OpenMetadata.

In TDP Kubernetes​

In TDP Kubernetes, Superset is installed by the tdp-superset chart, which packages the Apache Superset chart and gathers its settings under tdp-superset.

What the chart brings up

The application, the Celery workers (tdp-superset.supersetWorker), and the beat, for the scheduled tasks (tdp-superset.supersetCeleryBeat.enabled). A Redis (tdp-superset.redis.enabled) plays the role of caching layer, broker, and results backend.

Metadata database

PostgreSQL, through the embedded subchart (tdp-superset.postgresql.enabled) or through an external PostgreSQL, with the address in tdp-superset.supersetNode.connections.db_host. With the external database, a chart Job creates the database and the user (TDP-Settings.externalDatabase.enabled).

Installed drivers

The TDP image brings the drivers for PostgreSQL, ClickHouse, MySQL, Trino, Druid, Hive, Impala, Doris, Drill, Kylin, Pinot, Solr, Dremio, Snowflake, Teradata, Vertica, and Google Sheets, in addition to the LDAP and Kerberos libraries.

Connections created by the chart

ClickHouse and Trino can be registered as databases at installation, in tdp-superset.datasources.*, disabled by default (tdp-superset.datasources.autoImport.enabled). On each installation or upgrade, the existing connection is updated by UUID, without duplicating. See Superset integrations.

Authentication

LDAP, including Active Directory, disabled by default: it is turned on in the tdp-superset.ldap.* block, with automatic user registration and the role assigned at registration; the LDAP filter defines who can sign in; only the bind password arrives as an environment variable, read from a Secret in tdp-superset.extraEnvRaw. The key in tdp-superset.extraSecretEnv.SUPERSET_SECRET_KEY encrypts the sensitive data. See Superset security.

Access

The interface is exposed by a Kubernetes Service. Ingress (TDP-Settings.gateway.ingress.enabled) or Gateway API (TDP-Settings.gateway.gatewayApi.enabled), one or the other, take the interface outside the cluster.

In both editions, a chart follows the same path as in Figure 1: from the dataset to the query on the database, through the driver installed in Superset. What changes is where the connection to the metadata database and the authentication are configured: in the service properties, in Ambari, or in the chart values.

Next steps​

Sources​

Apache Superset - Introduction

Apache Superset - Architecture

Apache Superset - Creating Your First Dashboard

Apache Superset - Connecting to Databases

Apache Superset - Async Queries via Celery

Apache Superset - Caching

Apache Superset - Alerts and Reports

Apache Superset - Security

Apache Superset - Incubation Status