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

# Architecture overview

### Components

SnowDDL consists of the following components:

* [<mark style="color:blue;">**Blueprint**</mark>](/advanced/architecture-overview/blueprints.md) - pydantic model representing the desired state of an object in Snowflake account;
* [<mark style="color:purple;">**Config**</mark>](/advanced/architecture-overview/config.md) - collection of blueprints;
* [<mark style="color:orange;">**Parsers**</mark>](/advanced/architecture-overview/parsers.md) - used to parse YAML config files into blueprints, one parser class per object type;
* [<mark style="color:green;">**Resolvers**</mark>](/advanced/architecture-overview/resolvers.md) - used to compare blueprints with existing metadata in Snowflake account and generate DDL commands to apply changes, one resolver class per object type;
* [<mark style="color:red;">**Engine**</mark>](/advanced/architecture-overview/engine.md) - initialized with Snowflake connection and SnowDDL config, used to build, format and execute commands by resolvers.

### Workflow

These components are combined into "applications" with the following workflow:

1. Initialize an empty <mark style="color:purple;">**config**</mark>.
2. Generate individual <mark style="color:blue;">**blueprints**</mark> using <mark style="color:orange;">**parsers**</mark> or custom Python code, add blueprints to <mark style="color:purple;">**config**</mark>.
3. Validate <mark style="color:purple;">**config**</mark>. If encountered any errors, display error messages and stop execution.
4. Open connection to Snowflake using [Python connector](https://docs.snowflake.com/en/user-guide/python-connector.html).
5. Initialize <mark style="color:red;">**engine**</mark> using Snowflake connection and <mark style="color:purple;">**config**</mark>.
6. Execute <mark style="color:green;">**resolvers**</mark> to generate DDL commands. Suggest or apply DDL commands, depending on settings.
7. Display statistics, close Snowflake connection and finish the application.

Default application used by [CLI interface](/basic/cli.md) is available on GitHub: [`base.py`](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/app/base.py)

You may extend the default application to build even more sophisticated automation.

For example, [Single DB mode](/single-db/overview.md) is an extension of default application, which is available in [`singledb.py`](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/app/singledb.py).

##
