Skip to main content

Liteset

Async port of Apache Superset — the same BI platform, rebuilt from Flask/WSGI onto Litestar/ASGI.

License Python Litestar SQLAlchemy Docs Based on Apache Superset

Drop-in replacement for the Apache Superset 6.0.0 backend. Keep the same metadata database, the same REST API, the same WebSocket contract and the same frontend — only the web layer becomes async. Stop Superset, start Liteset on top of the same database, and keep working with the same dashboards, datasets, users and roles.


⚡ Performance

On identical hardware, against an IO-bound analytical workload (Star Schema Benchmark at Scale Factor 10, ~60 M rows, a deliberately constrained PostgreSQL), swapping the sync backend for the async one delivers:

  • 8.3× higher throughput — 10.57 vs 1.27 RPS under a 200-user dashboard fan-out
  • 29.8× lower median response time — 4.5 s vs 134 s in the same run
  • up to 10× more throughput as I/O latency grows — the regime BI platforms actually live in
  • error rate down from 32.8 % → 7.4 %, while infrastructure endpoints (login, CSRF) stay responsive instead of degrading by two orders of magnitude

Dashboard Fan-Out throughput: Liteset vs Apache Superset

Dashboard Fan-Out throughput across the run (figure from the testing report).

The cost is a modest +5 % resident memory — the async runtime keeps coroutine state and an asyncpg pool in one process instead of pre-forking workers. See the full benchmark report for all three scenarios, and the methodology for the test bench.


Table of contents


Why Liteset

Historically Apache Superset is built on Flask/WSGI and runs under Gunicorn with pre-forked processes. This model has three fundamental limitations:

  1. Blocking I/O. During long-running queries against analytical databases the worker process sits idle waiting for a response and does not serve other requests.
  2. High memory footprint. Every worker process copies the whole application and maintains its own metadata-database connection pool.
  3. Limited concurrency. The number of concurrent requests is hard-capped by processes × threads.

Liteset removes these bottlenecks by moving the entire web layer to the async ASGI model. The measured outcome on IO-bound workloads is the multi-fold throughput and tail-latency gains shown above, at a single-digit memory cost — see the benchmark report.


Target architecture

The Liteset server is designed along Clean Architecture lines. The application is split into four layers; dependencies point strictly inward — inner layers never import from outer ones.

Layer Responsibility Implementation
Presentation Controllers, DTOs, serialization, authorization predicates superset/controllers/, superset/schemas/, superset/guards/async def Litestar handlers, DTOs built on msgspec.Struct, Guards for RBAC
Business Logic Business rules (validate() → run()) superset/commands/AsyncBaseCommand, framework-independent Command classes
Data Access Data access through the SQLAlchemy 2.0 Select API superset/db/base_dao.py, superset/db/daos/BaseAsyncDAO[T] with an AsyncSession in the constructor
Infrastructure Middleware, DI, configuration, DB engine superset/middleware/, superset/dependencies.py, superset/config.py

Technology stack

Category Component Role
ASGI framework Litestar Routing, DI, OpenAPI, Guards, Middleware
ASGI server Uvicorn + uvloop libuv-based event loop
ORM SQLAlchemy 2.0 (Async) Declarative models, database queries
Metadata driver asyncpg / aiosqlite Async access to the metadata DB
Serialization msgspec DTOs + validation, replaces Marshmallow and Pydantic v1
Configuration pydantic-settings Typed configuration with backward compatibility for superset_config.py
Migrations Alembic (psycopg2, sync) DB schema is inherited 1:1 from Superset 6.0.0
Background jobs Celery Left unchanged (orthogonal to the HTTP layer)
WebSocket Native Litestar Replaces the standalone Node.js superset-websocket service
Cache Redis (redis-py async) Per-request cache, auth user cache, async events
Logging structlog Structured JSON logs

Compatibility guarantees

Liteset is a drop-in replacement for Apache Superset 6.0.0 at the backend level. Three invariants are locked in:

1. Metadata database

The schema of the metadata tables (ab_user, ab_role, dashboards, slices, tables, dbs, query, saved_query, report_schedule, etc.) is inherited from Apache Superset 6.0.0 — models, column names and types are unchanged, so an existing Superset database is read and written by Liteset as-is.

The Alembic history, however, is not carried over: upstream's 339 revisions are squashed into a single initial revision (c233f5365c9e), and Liteset adds its own on top. Two consequences:

  • The metadata database must already be at upstream head c233f5365c9e (the 2025-08-05 release). If it is older, run the upstream chain to that revision first, using a legacy Apache Superset install.
  • Once it is, alembic upgrade head is required — Liteset's own revisions apply DDL drift corrections. It is not a zero-migration swap.

See superset/migrations/README.md for the exact procedure.

2. Frontend

The frontend code (superset-frontend/) must not be modified. Liteset is obliged to reproduce every endpoint, JSON response shape, session cookie format (Flask-signed session cookies are decoded natively), CSRF tokens (X-CSRFToken), rison request parameters and the /superset/welcome SPA template.

3. HTTP API

All REST controllers reproduce the Superset contract 1:1 — URL routes, response codes, field names (dual camelCase/snake_case lookup is supported on the msgspec side), pagination shape, SIP-40 errors, Swagger spec layout. OpenAPI docs are auto-generated at /swagger/v1.


Project layout

liteset/
├── superset/                       # Async backend on Litestar
│   ├── app.py                      # Litestar application factory
│   ├── config.py                   # SupersetSettings (pydantic-settings)
│   ├── dependencies.py             # DI Provide's (session, user, security_manager)
│   ├── exceptions.py               # SIP-40 hierarchy + handlers
│   ├── controllers/                # Presentation layer — 45 controllers
│   │   ├── base.py                 # RISON helpers, pagination, serialization
│   │   ├── chart.py, dashboard.py, database.py, dataset.py, …
│   │   └── sqllab.py, report.py, security.py, user.py, …
│   ├── commands/                   # Business Logic layer
│   │   ├── base.py                 # AsyncBaseCommand (validate/run)
│   │   └── chart.py, dashboard.py, database.py, …
│   ├── db/
│   │   ├── session.py              # AsyncEngine, async_sessionmaker
│   │   ├── base_dao.py             # BaseAsyncDAO[T]
│   │   ├── daos/                   # Data Access layer
│   │   │   ├── chart.py, dashboard.py, database.py, …
│   │   │   └── security.py, user.py, …
│   │   └── engine_specs/           # Async DB adapters
│   │       ├── base.py             # BaseAsyncEngineSpec
│   │       ├── postgres.py         # Native asyncpg
│   │       ├── mysql.py            # Native asyncmy
│   │       ├── clickhouse.py       # aiochclient
│   │       ├── trino.py            # aiotrino
│   │       └── sync_fallback.py    # Wrapper for other DBs via conn.run_sync()
│   ├── guards/                     # RBAC Guards
│   ├── middleware/                 # Auth, CSRF, locale, security headers, proxy fix
│   ├── schemas/                    # DTOs on msgspec.Struct
│   ├── security/                   # AsyncSecurityManager (FAB port)
│   ├── async_events/               # Redis-streams-based async events
│   ├── websocket/                  # Native Litestar WebSocket
│   ├── common/                     # QueryContext/QueryObject
│   ├── models/                     # SQLAlchemy 2.0 declarative models
│   ├── migrations/                 # Alembic (psycopg2, sync)
│   ├── db_engine_specs/            # Sync BaseEngineSpec (for SQL dialects)
│   ├── sql/                        # SQL parser, Jinja templating
│   ├── viz.py                      # Legacy viz engine (explore_json)
│   └── static/, templates/         # SPA bundle, Jinja templates
├── superset-frontend/              # React frontend (not modified)
├── tests/                          # pytest
├── requirements/                   # base.in, development.in, …
└── pyproject.toml

Installation and running

See the Liteset quickstart guide or explore the production deployment options.


License

Liteset is distributed under the Apache License 2.0, inherited from Apache Superset. All files carried over from Apache Superset 6.0.0 preserve their original ASF headers. See LICENSE.txt in the repository root.


Liteset is an academic port; the author may have missed important details that cause regressions relative to Apache Superset 6.0.0. For production installations, keep using apache/superset.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

liteset-1.0.0.tar.gz (47.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liteset-1.0.0-py3-none-any.whl (48.1 MB view details)

Uploaded Python 3

File details

Details for the file liteset-1.0.0.tar.gz.

File metadata

  • Download URL: liteset-1.0.0.tar.gz
  • Upload date:
  • Size: 47.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for liteset-1.0.0.tar.gz
Algorithm Hash digest
SHA256 877d163c47480c547a7f317401667b1c3f2f90d461e08546de3ff015852c48a8
MD5 6e3ce6d5ff55f9930e02cbcf73f773be
BLAKE2b-256 5b2af512eebcbfd008bd5785fc4536f21dbb1e5539f685b48691d948db459742

See more details on using hashes here.

Provenance

The following attestation bundles were made for liteset-1.0.0.tar.gz:

Publisher: tag-release.yml on happykust/liteset

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file liteset-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: liteset-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 48.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for liteset-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a7a81ebf6973dfa8d07d1a4254a6c3fb29b6e9b5152f9bbff985944e03de795
MD5 1c19e4ec385c5437e6abc589ca10f9ce
BLAKE2b-256 6fc706a0021d76d47856bf6266772b75970924da46884b6d3e52e2229138d20d

See more details on using hashes here.

Provenance

The following attestation bundles were made for liteset-1.0.0-py3-none-any.whl:

Publisher: tag-release.yml on happykust/liteset

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page