The Sail tour · Real production code

Five stops through a
real query engine.

Sail is a Spark-compatible distributed query engine, written entirely in Rust, running both as a library and as a server. Reading Sail teaches idiomatic Rust at production scale: crate composition, DataFusion integration, async boundaries, error type design, and how to organize a real query engine. Every snippet on this tour is pulled from live source.

  1. 01
    Architecture map

    Sail at altitude. Five layers from common types to the gRPC entry points.

    36 crates, mapped
  2. 02
    DataFrame ops

    How Sail models a query plan as a 50-variant Rust enum.

    Plan enum · Box recursion
  3. 03
    Error types

    The error pattern repeated across every Sail crate.

    thiserror · #[from]
  4. 04
    Async boundaries

    A real Spark Connect handler and the async generics behind retry.

    Tokio · gRPC · retry
  5. 05
    Trait design

    One trait, many backends. The ingredients of an extension point.

    CatalogProvider · Arc<dyn>