# Data Mart

<figure><img src="/files/PoRwJxaBBtxfN4d7M5Lk" alt=""><figcaption></figcaption></figure>

## Project Overview

To build a **modular and scalable Data Mart** within **Gaio DataOS**, organizing operational data by domain (Customers, Orders, Products, and Order Items), enabling descriptive, operational, and predictive analytics.

***

## Development Stages

### 1.  Validation and Process Trigger

<figure><img src="/files/etcZrydYtxM3ukyEHncr" alt=""><figcaption></figcaption></figure>

* The project starts with an automatic data update check.
* SQL Control Table creates tmp\_tb\_control\_data\_update.
* Flow:
  * `tmp_tb_control_data_update`: checks for updates
  * `tb_control_data_update`: stores execution status
  * If new data is detected, the main extraction flow is triggered automatically.

***

### 2.  Data Extraction

<figure><img src="/files/PoRwJxaBBtxfN4d7M5Lk" alt=""><figcaption></figcaption></figure>

* Data is extracted from **data sources**, **CSV files** or **APIs at Gaio**.
* Uses **Builder tasks** for:
  * Data transformation
  * Handling nulls and errors
  * Standardizing formats
* Intermediate results are stored in **temporary tables (`tmp_`)**.
* Final consolidation and versioning are done in **final tables (`tb_`)**.

***

### 3. Domain-Based Structure

Each domain follows this modular structure:

```
Source → Staging Builder → Temporary Table (`tmp_`) → Final Builder → Final Table (`tb_`)
```

***

#### 3.1  Customers Domain

<figure><img src="/files/kedsPIB0eJ3WUGPAyiFK" alt=""><figcaption></figcaption></figure>

* Source: PostgreSQL (`customers`)
* Steps:
  * Filter out invalid data
  * Normalize and enrich information
  * Build `tmp_customers`, then publish to `tb_customers`

***

#### 3.2  Orders Domain

<figure><img src="/files/B5UcWmRqCTy7xndCdrrp" alt=""><figcaption></figcaption></figure>

* Source: PostgreSQL (`orders`)
* Steps:
  * Calculate totals, shipping fees, estimated delivery
  * Status and failure normalization
  * `tmp_orders` → `tb_orders`

***

#### 3.3  Products Domain

<figure><img src="/files/6eAsqMoFjUxmAbUI2sO3" alt=""><figcaption></figcaption></figure>

* Source: PostgreSQL (`products`)
* Steps:
  * Enrich with category and availability
  * Add flags for discontinued products
  * `tmp_products` → `tb_products`

***

#### 3.4 Order Items Domain

<figure><img src="/files/uc0po7tIfWxh3YSuByGn" alt=""><figcaption></figcaption></figure>

* Source: PostgreSQL (`order_items`)
* Steps:
  * Clean up nulls and data types
  * Calculate taxes, discounts, unit values
  * `tmp_order_items` → `tb_order_items`

***

### &#x20;Technologies Used

* **Gaio DataOS** as the core platform
* **Visual ETL** with Builder, Form, Content, and SQL tasks
* **Temporary Tables (`tmp_`)** for staging and audit
* **Final Tables (`tb_`)** for downstream use
* **Dynamic Parameters** for context handling and automation
* **Conditional logic** to manage execution flow
* Ready for integration with **dashboards, AI and automation flows**

***

### Expected Outcomes

* Solid and auditable data processing pipelines
* Ability to rerun specific domains independently
* Accelerated dashboard development
* Reusable components for future projects
* Improved data trust and governance for business users
* Ready-to-use structure for **forecasting, clustering, and churn models**

***

### Download this project

{% file src="/files/sLo44bZHhwQAf61ENsJ9" %}

{% file src="/files/yyax9JXj1w2qGipF03oL" %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gaiodataos.com/use-cases/data-mart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
