> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/design/data-schema.md).

# Data Schema

Schema definitions allow full customization of data stored and used across the Rierino platform.

![Schema UI](https://1659095931-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnDk3J1AzTgg2NFrGPlh%2Fuploads%2FL4Yru6mF81B8AbB2CYYp%2FUI_Schema.png?alt=media\&token=1ab24f36-40ef-4df4-a17c-0745b9577d8c)

As the UI screen allows designing visual structure of forms and lists, the schema screen allows designing the underlying data structure. When using a schema-free no-SQL database, this is not strictly necessary, but is always recommended to have a reference for data model design.

Rierino uses [JSON schema](https://json-schema.org/) as a standard for structuring data format for different record types, with [extensions](https://docs.rierino.com/extensions/json-schema-extensions.md) for more advanced use cases. These schemas are also used for defining validation rules (e.g. required fields, minimum length), which are automatically used in UI screens to display warnings to users.

If you define a schema that has the same id as a UI screen, the screen automatically uses this schema for populating its editor labels as well as validation rules. It is also possible to select a different schema for a given UI from its design screen.

Rierino schemas also allow use of "ref" attribute, for referencing other schema names when settings can be reused across different record types. For example, if you create a multi-language string schema with "localized\_string" id, you can reuse it within the attributes of a "name" element, which will automatically copy its contents.

The structure of data schema (except for those used only for reference or customized with read only elements) always follows [aggregate data model](https://docs.rierino.com/devops/microservices/building-blocks/data-sources/state-data-structure.md) (i.e. with id, data).

{% embed url="<https://json-schema.org>" %}
Json Schema Page
{% endembed %}

{% hint style="info" %}
Schemas are used together with UI definitions to automatically populate Admin apps, and can be utilized in data validation using related condition evaluators or state manager validators.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rierino.com/design/data-schema.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
