Dictionaries
sxs automatically detects item schemes that are too large to keep inline in a structure and stores their items as a dictionary. This is transparent: structures and data are served exactly as before, only faster and at larger scale.
Principle
An item scheme — a codelist, a concept scheme or a category scheme — can hold thousands or even hundreds of thousands of items. Keeping every item inline in the stored structure would make that structure very large and slow to load, even when a request only needs a handful of values.
sxs therefore splits a large scheme in two:
- the structure keeps the scheme's identity and metadata;
- the items (codes, concepts or categories, with their names, descriptions and links) are kept aside as a dictionary.
The split is automatic and driven by the scheme size. You never declare a dictionary, and you never reference one in a request.
Why
- Scalability — a scheme with tens of thousands of items no longer bloats the stored structure or runs into storage limits.
- Speed — data requests read only the item values they actually use, instead of loading a whole scheme to answer a query on a few observations.
- Transparency — consumers see no difference. A full structure request still returns the complete scheme, and data responses still carry the same code identifiers and labels.
Dictionaries are one of the reasons sxs can host very large codelists while keeping ingestion and data queries fast.
Which schemes are affected
Only item schemes that carry items are concerned:
Other structural artefacts are always stored as they are.
How to use it
There is nothing to do. A dictionary is created automatically when a scheme has more items than the configured threshold.
The threshold is controlled by a single setting:
- a scheme with fewer items than the threshold is kept inline;
- a scheme with the same number or more items is stored as a dictionary.
Tuning the threshold
- Lower it to turn more schemes into dictionaries. This helps when many medium-sized schemes slow down ingestion or data queries.
- Raise it to keep more schemes inline. This helps when full structures are requested very often and loading a scheme on demand is not worth it.
The default (10000) suits most platforms. As a rule of thumb, keep the default
unless you notice large schemes affecting ingestion or query performance.
Setting it per space
At deployment, set the MAX_ITEMLIST_LENGTH environment variable (for example
in the Kubernetes manifest). To change it for a single space only, add the
property to that space in tenants.json:
A space value overrides the global default for that space only.
What happens when a scheme changes
When a scheme crosses the threshold — because it grows, or because you lowered the threshold — it is stored as a dictionary from that point on. The next structure or data request uses the new layout transparently.
There is no separate endpoint to query a dictionary, no cache to clear and no change to the API: your existing structure and data requests keep working unchanged.
See also
- Settings — how settings are resolved (environment, space, annotation).
- Configuration — full settings reference, including
MAX_ITEMLIST_LENGTH. - Unlisted components — a different optimization for component values.
