Architecture Overview
Olytix Core is built on a modern, cloud-native architecture designed for scalability, performance, and extensibility. This page provides a technical overview of the key components and how they interact.
- Core architectural components and their roles
- How semantic queries are translated to SQL
- The query optimization pipeline
- Warehouse adapter interface
High-Level Architectureβ
Olytix Core Architecture
Click any component to explore its details
Core Componentsβ
API Layerβ
The API layer provides multiple interfaces for consuming the semantic layer:
| Interface | Use Case | Protocol |
|---|---|---|
| REST API | General integrations, BI tools | HTTP/JSON |
| GraphQL API | Flexible queries, frontend apps | GraphQL |
| DAX API | Power BI native integration | XMLA/DAX |
Semantic Layerβ
The semantic layer is the heart of Olytix Core:
- Cubes: Define analytical entities with measures and dimensions
- Measures: Aggregation expressions (SUM, COUNT, AVG, etc.)
- Dimensions: Categorical and temporal attributes
- Metrics: Business KPIs composed from measures
- Joins: Relationships between cubes
Query Engineβ
Built on Apache DataFusion and Apache Arrow:
- Query Planner: Translates semantic queries to optimized SQL
- Optimizer: Applies automatic optimizations
- Executor: Manages query execution and result streaming
Deep Dive: Query Executionβ
Semantic Query to SQLβ
The Query Planner translates semantic queries into optimized SQL:
{
"metrics": ["total_revenue"],
"dimensions": ["order_date.month", "customer.region"],
"filters": [{"dimension": "order_date.year", "operator": "equals", "value": 2024}]
}
SELECT
DATE_TRUNC('month', o.order_date) AS "order_date.month",
c.region AS "customer.region",
SUM(o.total_amount) AS "total_revenue"
FROM fct_orders o
JOIN dim_customers c ON o.customer_id = c.customer_id
WHERE EXTRACT(YEAR FROM o.order_date) = 2024
GROUP BY 1, 2
ORDER BY 1, 2
Query Optimizationβ
The optimizer applies several techniques automatically:
| Technique | Description | Benefit |
|---|---|---|
| Predicate Pushdown | Filters pushed to warehouse level | Reduced data transfer |
| Join Elimination | Removes unnecessary joins | Faster execution |
| Pre-aggregation Matching | Uses cached aggregates when available | Sub-second responses |
| Subquery Flattening | Simplifies nested queries | Cleaner execution plans |
Enable pre-aggregations for frequently queried measure/dimension combinations to achieve sub-second response times on large datasets.
Adapter Interfaceβ
Olytix Core uses a pluggable adapter architecture for warehouse connectivity:
class WarehouseAdapter(ABC):
"""Abstract interface for warehouse implementations."""
async def execute(self, sql: str) -> pa.RecordBatch
async def execute_iter(self, sql: str) -> AsyncIterator[pa.RecordBatch]
async def get_schema(self, table: str) -> dict[str, str]
def get_dialect(self) -> SQLDialect
Supported Warehousesβ
| Warehouse | Adapter | Status |
|---|---|---|
| PostgreSQL | postgresql | Production |
| Snowflake | snowflake | Production |
| BigQuery | bigquery | Production |
| DuckDB | duckdb | Beta |
This abstraction allows Olytix Core to support multiple data warehouses while maintaining a consistent query execution model based on Apache Arrow.
Data Flowβ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Client ββββββΆβ API ββββββΆβ Query β
β Request β β Layer β β Planner β
βββββββββββββββ βββββββββββββββ ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Response βββββββ Result βββββββ Warehouse β
β (Arrow) β β Processor β β Adapter β
βββββββββββββββ βββββββββββββββ βββββββββββββββ