Trino or Kyuubi for 100 analysts on Iceberg: what I measured, not what the docs say

The warehouse was fine. The analysts were the problem, or rather, the way they reached it.

The setup is one I keep meeting: an Apache Iceberg lakehouse built by a data engineering team for ETL, running Spark on YARN, 20 TB across a few hundred tables. The pipeline works. Then the business asks for self-service SQL, a hundred analysts arrive with notebooks and BI tools, and every one of them opens a private Spark application against the same cluster. Twenty of those sessions take the memory the nightly pipeline needs, and the 8-hour ETL starts finishing at lunchtime.

I wanted an answer that rested on runs rather than on vendor pages, so I built a proof of concept with both serious options wired to the same catalog and the same data, and measured them. The repository is public: iceberg-analyst-platform. The client in it is a synthetic retail warehouse, scaled down a thousandfold so the whole thing runs on a laptop.

The three options

There are only three honest candidates for "SQL for many people on Iceberg without each of them owning a Spark driver":

  • Spark Thrift Server. One SparkContext, one driver, everyone shares it. It is the baseline, and it explains what the other two add: it has no per-user isolation (one bad query kills every session), no admission control beyond the FAIR scheduler, and no authorization worth the name.
  • Apache Kyuubi. A multi-tenant gateway in front of Spark. Users connect over the Hive JDBC protocol; Kyuubi launches Spark engines per user or per group (share levels CONNECTION, USER, GROUP, SERVER), pools them, times them out, and can enforce Ranger policies inside each engine. The SQL dialect is exactly the ETL's Spark SQL.
  • Trino. A separate MPP engine with an Iceberg connector. Always warm, every query split across workers, admission controlled by resource groups, authorization through file rules, Ranger or OPA. A different SQL dialect from Spark.

The brief most teams write at this point says "Trino is faster, Kyuubi is more compatible" and stops. I wanted to know how much faster, what the compatibility actually costs, and what each one does when forty people hit it at once.

One catalog, one store, same users, same queries

The only way the comparison means anything is if nothing else differs. So both engines sit behind one Iceberg REST catalog (Lakekeeper, Postgres-backed) and one object store, read the same thirteen tables that Spark created and seeded, authenticate the same six users, and enforce the same role model: admins see everything, analysts see gold marts and non-PII silver tables, restricted analysts additionally see a customer PII table with masked columns and a row filter.

AnalystsJDBC / BI / CLI Trino 484HTTPS 8443, rules.jsonresource groups Kyuubi 1.12 + Spark 3.5Thrift 10009, JDBC authengine per group (GROUP)Ranger AuthZ in each engine Lakekeeper REST catalogno credential vending Object store (S3 API)Parquet + metadata.json Spark ETL (owns writes)bronze → silver → gold
The primary path is solid, the alternative is dashed, and everything downstream of the engines is shared. Spark is the only writer.

The workload is the eight representative queries a retail analyst actually runs: daily revenue by region from a gold mart, top categories for a month, a funnel from a daily event mart, customer look-ups, store look-ups, and two deliberately heavier silver queries (a fact-to-dimension join and a seven-day event scan). Eighty percent of the mix hits gold marts, because that is what a serving layer is for.

What the numbers said

Each benchmark worker is one analyst identity running the mix twice. I ran concurrency 5 and 10 against each engine, one engine at a time, on a Docker VM with 7.5 GiB of memory. Kyuubi was restarted before its run so its engine start-up would be in the measurement rather than hidden.

engineconcurrencyok / failedthroughput q/sp50 sp95 sconnect p95 s
Trino 4845170 / 05.400.542.220.43
Trino 48410340 / 09.830.683.680.59
Kyuubi 1.125170 / 01.551.178.0337.98
Kyuubi 1.1210340 / 06.091.095.145.29

Zero failures on both. That matters: neither engine fell over, queued anything for long, or returned a wrong row. The difference is where the time goes.

Warm-up is the whole Kyuubi story

Look at the connect column. At concurrency 5, the benchmark user's first sessions had to launch Kyuubi's engine pool, and the p95 connect time was 38 seconds. Those sessions then ran their queries at roughly 1.2 s median, which is respectable. At concurrency 10 the engines were already running, connect fell to 5 s (session set-up on a busy engine), and throughput quadrupled.

This is not a flaw in Kyuubi. It is the trade the GROUP share level makes on purpose: one Spark application per group, warm for as long as kyuubi.session.engine.idle.timeout allows, then gone. Keep engines alive and the warm-up disappears at the cost of memory held by idle JVMs. Let them expire and the first analyst back from lunch waits half a minute. On a YARN cluster where the ETL needs that memory at night, you will want them to expire.

Trino has no equivalent cost because there is nothing to launch. The cluster is the engine. Connect time is TLS plus password check.

In steady state, at concurrency 10, Trino was about 1.6x faster at the median and about 1.4x at p95, and pushed 60% more queries per second. On the heavy silver join both engines took 5 to 6 seconds; the dimension is small in the POC, so that query does not yet separate them. The staging benchmark with the 12-million-row dimension is where that line will be drawn, and I wrote the plan for it rather than pretending the laptop could answer it.

Where Kyuubi still wins

I picked Trino as the primary engine, and I would do it again for this workload: short, bursty, BI-shaped queries from people who do not care what Spark SQL is. The warm cluster, admission control that queues instead of failing, and a memory budget that lives outside YARN (so the ETL queues are untouched) all point the same way.

Kyuubi is the better choice when:

  • analysts must run Spark SQL as written: ETL views, UDFs, notebook code. Trino's dialect is close but not the same, and porting a library of views is real work;
  • the organisation wants one engine technology and one operations model (Spark on YARN) rather than a second stack with its own HA story;
  • the workload is few, long, heavy queries over silver rather than many short ones. Spark's shuffle, spill and dynamic allocation scale those better once memory is not starved;
  • Ranger is already the policy store for Hive and Spark, and one plugin family is worth a lot to the security team.

Both paths stay fully implemented in the repository, each with its own tests and benchmarks, precisely so that the next person can rerun the comparison on their hardware instead of inheriting my conclusion.

What I took from it

  1. Benchmark the serving layer with the same catalog, tables, users and queries, or you are benchmarking your own setup differences.
  2. Measure connect time separately from query time. For gateway-style engines it is the number that decides the user experience.
  3. Zero failures at low concurrency tells you nothing about forty concurrent users; it only tells you the plumbing is right. Write the ramp plan and run it where the memory exists.
  4. Ship the losing path. A comparison is only evidence if it can be rerun.