Introduction
Atoti organizes cubes into catalogs and schemas, both coordinated by a top-level manager. TheStartBuilding fluent API is the entry point for defining all of these objects.
- The hierarchies defined the structure of the data.
- The analysis is done accessing measures for different locations.
- A catalog is a collection of cubes.
- A schema is a collection of cubes that have the same selection on the underlying database. It means that the cubes inside a same schema are based on the same data.
StartBuilding fluent builder.
Create selection, managers, catalogs and schemas
Create a selection
To create a selection, useStartBuilding.selection():
fromBaseStore("storeName")defines the base storewithAllReachableFields()adds all the fields reachable from the base store via the references in the database.withField("fieldName")adds one field to the selectionwithAlias("fieldName", "alias")defines a new name for a field
Create managers, catalogs and schemas
To create a selection, useStartBuilding.manager():
withSchema("schemaName")defines a schema. The name is optional if there is only one schema. The default name is ” Schema”.withSelection(selection)adds the selection created earlierwithCube(cubeDescription)adds a cube description. How to create a cube description is described below.withDistributedCube(cubeDescription)adds a distributed cube description.withCatalog("catalogName)groups the cubes into catalogs. This is optional if there is only one catalog. The default name of catalog is “Catalog”.
The catalogs names are displayed in the UI (as opposed to the managers names and schemas names).
Cube Configuration
To create a cube, useStartBuilding.cube("cubeName").
Create a minimal cube
The minimal cube only has a single level (so a single hierarchy and a single dimension) and only the native measures ( the contributors count and a timestamp).Add measures and dimensions
To add dimensions, hierarchies and levels please see the dedicated articles. To add measures, the preferred way is Copper. To add simple aggregated measures, usewithAggregatedMeasure():
- choose a common aggregation function with
sum("fieldName"),min("fieldName"),max("fieldName"),avg("fieldName") - call the aggregation function plugin key otherwise with
withAggregateFunctionFunction(pluginKey) - optional: choose a folder to visually organize the measure in with
withinFolder("folderName") - optional: choose a formatter with
withFormatter("formatter")
Optional cube configurations
Configure the aggregate provider
To add an aggregate provider, please see the dedicated article.Configure the aggregate cache
Queries can be served from an aggregate cache to avoid recomputing aggregates that have already been requested by previous queries. The cache is configured per cube, with options to control its size, the measures it caches, and the branches it covers. UsewithAggregatesCache to configure the aggregate cache:
withSize()defines the cache size (number of(location, measure)pairs)cachingOnlyMeasures("measure1", "measure2")lists the measures to keep in the cache
Configure the shared context values
The cube description can also define context values for all queries of all users. UsewithSharedContextValue to define shared context value: