Skip to content

Mondrian schemas

A Mondrian schema is the model that turns raw database tables into an analytical cube — the thing that lets you slice sales by region and product category, drill into quarterly trends, or roll a hundred dimension hierarchies into a single coherent query. Every cube you query in Saiku is backed by one.

What goes into a schema

At the heart of the Mondrian-4 metamodel are four concepts:

  • Cubes — each cube maps to one or more fact tables (and their aggregates) and holds the measures you can aggregate.
  • Dimensions — the axes you slice by: time, geography, product, customer. Dimensions are built from attributes (individual keys and labels) organised into hierarchies (ordered levels you can drill through).
  • Measures — the numbers you aggregate: sum, count, distinct-count, min, max, avg. Calculated members let you compose them with MDX formulas.
  • Physical schema — the underlying table graph: which columns are primary keys, which columns are foreign-key links between tables, and any calculated columns derived from SQL expressions.

Shared dimensions can be defined once and reused across multiple cubes. Access-control roles can restrict visibility at the cube, dimension, hierarchy, or individual-member level.

Two authoring formats — one engine

Saiku supports schemas in both XML and YAML. The engine sees the same model either way.

XML is the classic Mondrian format — verbose but familiar to anyone who has worked with Mondrian before.

YAML is the modern alternative. It is more readable, easier to diff in code review, and easy to annotate with comments. The Saiku engine auto-detects any catalog file whose content starts with schema: and routes it through the converter before the rest of the loading pipeline. The conversion is lossless in both directions.

Both formats are loaded identically at runtime. You can convert between them at any time with the CLI.

The no-code path

Not ready to write schema files? The Saiku dashboard gives you two no-code entry points:

  • Schema designer — describe a cube in one sentence, let Claude propose the model, then refine it visually and save as XML.
  • Schemas — manage all your saved schemas, edit the XML directly, and connect schemas to connections.

What’s in this section

PageWhat it covers
YAML schemasThe full YAML element reference with examples
CLIConvert and lint schema files from the command line
Schema structureTop-level layout of a Mondrian-4 schema
Cubes and measuresFact tables, measure groups, aggregator types, calculated members
DimensionsAttributes, hierarchies, levels, shared dimensions
Physical schemaTables, keys, foreign-key links, calculated columns
AdvancedNamed sets, annotations, aggregation hints
Time intelligenceDeclarative YoY, PoP, YTD, and rolling calculations via <TimeCalc>
Currency conversionDeclarative effective-date FX conversion via <CurrencyConversion>
ExtensionsCustom formatters, scripted members, plug-in points
Access controlRoles, grants, rollup policies