> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What is a database schema?

> How Atoti database schemas work, including star and snowflake schema structures, table references and joins, isolated tables for lookup data, and supported field types including vectors.

The schema defines data tables and how they are are linked together.
Schemas often follow a **star schema** structure,
where multiple reference tables are connected to a central table using key fields.

* A reference table refers to tables that are joined to another table.

<Frame caption="Tables are joined to create a star schema.">
  <img src="https://mintcdn.com/activeviam/lTzImDUNm0cHRUws/images/atoti-concepts/database-schema.png?fit=max&auto=format&n=lTzImDUNm0cHRUws&q=85&s=5ea9eb03468dc8cbea473745be71dd04" alt="Database schema" width="3082" height="1777" data-path="images/atoti-concepts/database-schema.png" />
</Frame>

A schema defines how data is organized and related within a database.
Tables in a schema can be linked using references, which establish relationships between them.
A reference maps key fields from one table (the owner) to foreign key fields in another table (the target).
This allows data from different tables to be queried together.

At the center of each schema is the fact table.
This fact table typically contains the main transactional records, such as trades with fields like customer\_name.
Other tables can link to the central fact table or to each other through references. This creates a connected structure.

In a typical star schema, reference tables act as dimension tables joined to the central fact table.
This design simplifies queries and improves performance.
More complex schemas include multiple tables, resulting in a snowflake schema or other variations.
The additional tables are connected to the fact table at the center of the snowflake schema.

<Frame caption="A snowflake schema contains a single fact table and other tables.">
  <img src="https://mintcdn.com/activeviam/lTzImDUNm0cHRUws/images/atoti-concepts/database-star-schema.png?fit=max&auto=format&n=lTzImDUNm0cHRUws&q=85&s=4b05f0bbf98620717a5af936f2bd1e68" alt="Database star schema" width="3395" height="2199" data-path="images/atoti-concepts/database-star-schema.png" />
</Frame>

## How are tables joined to form a schema?

A reference table can link to other tables. For example:

* The fact table contains trade records with a `customer_name` field. There is only one fact table for each cube on the database schema.
* A reference table maps `customer_county` to `country_name`.

This setup allows users to filter or classify trades by country, even though the fact table does not contain country data directly.

<Frame caption="A reference table is joined to another reference table.">
  <img src="https://mintcdn.com/activeviam/lTzImDUNm0cHRUws/images/atoti-concepts/database-joins.png?fit=max&auto=format&n=lTzImDUNm0cHRUws&q=85&s=6416d5413245b7c0e6725e649dcb79c1" alt="Database star schema" width="2433" height="735" data-path="images/atoti-concepts/database-joins.png" />
</Frame>

A table can reference another table multiple times, as long as each reference uses a different set of fields. For example:

* The fact table contains trade records with `seller` and `buyer` fields.
* The fields `seller` and `buyer` map to the key in a table for party records.

<Frame caption="More than one record from the owner table points to one record in the target table.">
  <img src="https://mintcdn.com/activeviam/lTzImDUNm0cHRUws/images/atoti-concepts/database-more-than-one-record.png?fit=max&auto=format&n=lTzImDUNm0cHRUws&q=85&s=3cf7d9fba2aa583cf179de6f14f60411" alt="Database multiple records" width="1897" height="665" data-path="images/atoti-concepts/database-more-than-one-record.png" />
</Frame>

## Related reading

Find out more about table joins:

* [Atoti Java SDK](/engine/java-sdk/latest/copper/copper_join)
* [Atoti Python SDK](https://docs.activeviam.com/products/atoti/python-sdk/latest/api/atoti.Table.join.html#atoti.Table.join)

## Are all tables joined to the schema?

**Isolated tables** are part of the datastore but are not joined to the fact table.
They are look-up tables that enrich data. Find out more about [store look-up measures](../cube/measures.md#store-look-up-measures).
Isolated tables are useful for:

* **Lookup and reference data**: Store external values such as currency conversion rates or other market data.
* **Supporting calculations**: Provide values that support the calculation of measures.
  These values can be market reference data or other computed values stored in the isolated table.
* **Display purposes**: Help format or translate values for better readability.

<Frame caption="Isolated tables are not joined to the fact table.">
  <img src="https://mintcdn.com/activeviam/lTzImDUNm0cHRUws/images/atoti-concepts/database-isolated.png?fit=max&auto=format&n=lTzImDUNm0cHRUws&q=85&s=f1ced5ff6db68f0d663038ec789956de" alt="Database isolated tables" width="3390" height="1777" data-path="images/atoti-concepts/database-isolated.png" />
</Frame>

## Related reading

Find out more about isolated tables:

* [Atoti Java SDK](/engine/java-sdk/latest/copper/copper_join#join-types-in-copper)
* [Atoti Python SDK](https://docs.activeviam.com/products/atoti/python-sdk/latest/api/atoti.Session.add_external_table.html#atoti.Session.add_external_table)

## What kinds of fields are supported by Atoti?

Atoti supports a wide range of field types:

* **Numerical (native) types**: `int`, `double`, `float`\
  Typically used as measures and aggregated by Atoti.
* **Strings**\
  Used as classifiers, table levels, and filters.
* **Dates and times**\
  Enable Atoti to interpret and filter by date ranges.
* **Vectors** Useful for financial analytics like Value at Risk (VaR).\
  Atoti is optimized for storing and aggregating vector-based data structures efficiently.
* **Objects** Custom objects can be stored.

## Related reading

Find out more about key fields using:

* [Atoti Java SDK](/engine/java-sdk/latest/datastore/datastore_config)
* [Atoti Python SDK](https://docs.activeviam.com/products/atoti/python-sdk/latest/api/atoti.type.html)
