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
- Architecture
- From dashboard to database
- One connection, one address
- What runs in the background
- Who sees what
- Why Superset
- In the TDP editions
Watch a dashboard open
Press Play or step through. The underlined names lead to the Glossary.
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.
In the Glossary: Superset application · Metadata database
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Architecture
The application and a metadata database are enough to get started. Cache, worker, and beat enable the features that run in the background.
What the figure shows:
- The browser accesses the Superset application.
- The Superset application brings together the Python (Flask) backend, the API layer, and the React web interface. It is what queries the data sources.
- 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.
- The caching layer and broker stores the query results and also serves as the broker for the workers.
- The results backend receives what the workers query, and the application reads it.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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 Glossarytrino://— 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.
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.
In the Glossary: SQL Lab · Superset application · Broker
- 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.
- 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.
- 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.
- 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.
- 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.
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.
All rights, including granting and revoking access for other users and altering other people's charts and dashboards.
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.
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.
Gives access to SQL Lab. Alpha and Gamma users receive access database by database.
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.
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
| Edition | Version | Documentation |
|---|---|---|
| TDP Datacenter | 4.1.2 | TDP Datacenter components |
| TDP Kubernetes | 5.0.0 · chart tdp-superset 3.0.3 | Configuration in TDP Kubernetes |
In TDP Datacenter
In TDP Datacenter, Superset is a stack service, with the Superset component, installed and managed by Ambari.
SUPERSET (master, one or more). Component category.
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.
Trino, Solr, Impala, MySQL, PostgreSQL, Pinot, Doris, Drill, Snowflake, Vertica, and Teradata, among others. Trino is the path to the lakehouse tables. See Trino.
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.
Can be enabled in the superset-ssl configuration, in SUPERSET_SSL, with the certificate in SUPERSET_CERTFILE and the key in SUPERSET_KEYFILE.
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.
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.
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).
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.
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.
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.
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
TDP Kubernetes
Superset Configuration
Metadata database, replicas, resources, and connections in the chart.
TDP Kubernetes
Superset Integrations
The connections to ClickHouse and Trino registered at installation.
TDP Datacenter
TDP Datacenter Architecture
Where the services sit in the cluster and what is enabled in Ambari.
Analytical database
ClickHouse
The columnar database that Superset can query directly in TDP Kubernetes.
Sources
Apache Superset - Introduction
Apache Superset - Architecture
Apache Superset - Creating Your First Dashboard
Apache Superset - Connecting to Databases
Apache Superset - Async Queries via Celery