docs-mintlify/docs/data-modeling/dynamic/index.mdx
Cube supports authoring data models dynamically — useful for de-duplicating common patterns across cubes, generating models from a remote source, or adapting the schema per tenant at runtime.
Pick the approach that matches the language your data models are written in:
<CardGroup cols={2}> <Card title="Jinja & Python" icon="brand-python" href="/docs/data-modeling/dynamic/jinja"> Template YAML data models with Jinja, and use Python for loops, includes, and runtime generation. </Card> <Card title="JavaScript" icon="brand-javascript" href="/docs/data-modeling/dynamic/javascript"> Generate cubes and views on-the-fly from JavaScript data models using `asyncModule()`. </Card> </CardGroup>The diagrams below show how YAML and JavaScript data models are parsed and compiled before they're served by Cube.
<Frame caption="YAML data models compiled with COMPILE_CONTEXT"> </Frame> <Frame caption="JavaScript data models compiled with COMPILE_CONTEXT"> </Frame>