# hystax/optscale architecture

> Architecture diagram of the GitHub repository hystax/optscale, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hystax/optscale
- Repository: https://github.com/hystax/optscale

## Overview

OptScale is a multi-cloud FinOps platform. Its main workflow connects cloud and data-platform accounts, ingests billing and usage data, analyzes consumption, and presents cost visibility and optimization recommendations for teams to act on. The graph preserves documented governance, budgeting, power-management, and workload-analytics capabilities alongside that flow. The README documents the product-level workflow; sampled source excerpts are limited, so several subsystem links use only that documented relationship rather than asserting internal call wiring.

Main entry points: [`rest_api/rest_api_server`](https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server) (Billing and usage data), [`diworker/diworker/main.py`](https://github.com/hystax/optscale/blob/integration/diworker/diworker/main.py) (Ingestion worker), [`diworker/diworker/importers`](https://github.com/hystax/optscale/tree/integration/diworker/diworker/importers) (Cloud importers), [`bi_exporter/bumblebi/exporter`](https://github.com/hystax/optscale/tree/integration/bi_exporter/bumblebi/exporter) (BI data export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data ingestion"]
  node_importers["Cloud importers"]
  node_ingestion_worker["Ingestion worker<br/>[main.py]"]
  node_scheduler["Import scheduler<br/>[main.py]"]
end

subgraph group_analysis["Cost analysis"]
  node_cost_data[("Billing and usage data")]
  node_cost_visibility["Cost allocation and dashboards"]
  node_workload_analytics["Data workload analytics"]
  node_bi_export["BI data export"]
end

subgraph group_optimize["Optimization"]
  node_recommendation_worker["Recommendation analysis"]
  node_recommendations_ui["Optimization recommendations"]
  node_power_management["R&amp;D power management"]
  node_commitments["Commitment utilization"]
end

subgraph group_governance["FinOps governance"]
  node_budgets_alerts["Budgets and cost alerts"]
  node_ownership["Tagging and ownership"]
  node_policy_controls["Governance controls"]
end

subgraph group_platform["Platform access"]
  node_rest_api["Platform API<br/>[server.py]"]
  node_web_ui["FinOps dashboards"]
end

node_teams(("Engineering and finance teams"))
node_clouds{{"Cloud accounts and clusters"}}
node_data_platforms{{"Data platforms"}}
node_export_storage[("S3 or Azure storage")]

node_clouds -->|"provide account data"| node_importers
node_data_platforms -.->|"provide workload data"| node_importers
node_scheduler -->|"schedule imports"| node_ingestion_worker
node_ingestion_worker -->|"select provider importer"| node_importers
node_ingestion_worker -->|"ingest usage data"| node_cost_data
node_cost_data -->|"analyze spend"| node_cost_visibility
node_cost_data -->|"analyze workload use"| node_workload_analytics
node_cost_data -->|"analyze consumption"| node_recommendation_worker
node_cost_visibility -->|"serve cost views"| node_rest_api
node_recommendation_worker -->|"surface findings"| node_recommendations_ui
node_rest_api -->|"serve product data"| node_web_ui
node_web_ui -->|"show dashboards"| node_teams
node_recommendations_ui -->|"show recommendations"| node_teams
node_cost_data -->|"analyze utilization"| node_commitments
node_teams -->|"configure schedules"| node_power_management
node_teams -->|"manage budgets"| node_budgets_alerts
node_teams -->|"review attribution"| node_ownership
node_teams -->|"manage controls"| node_policy_controls
node_cost_data -->|"export cost data"| node_bi_export
node_bi_export -->|"write export"| node_export_storage

click node_importers "https://github.com/hystax/optscale/tree/integration/diworker/diworker/importers"
click node_ingestion_worker "https://github.com/hystax/optscale/blob/integration/diworker/diworker/main.py"
click node_scheduler "https://github.com/hystax/optscale/blob/integration/bumischeduler/bumischeduler/main.py"
click node_cost_data "https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server"
click node_rest_api "https://github.com/hystax/optscale/blob/integration/rest_api/rest_api_server/server.py"
click node_web_ui "https://github.com/hystax/optscale/tree/integration/ngui/ui/src"
click node_cost_visibility "https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server"
click node_workload_analytics "https://github.com/hystax/optscale/tree/integration/diworker/diworker/importers"
click node_recommendation_worker "https://github.com/hystax/optscale/tree/integration/bumiworker/bumiworker/modules/recommendations"
click node_recommendations_ui "https://github.com/hystax/optscale/tree/integration/ngui/ui/src/containers/RecommendationsOverviewContainer"
click node_power_management "https://github.com/hystax/optscale/tree/integration/docker_images/power_schedule"
click node_commitments "https://github.com/hystax/optscale/tree/integration/bumiworker/bumiworker/modules/recommendations"
click node_budgets_alerts "https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server"
click node_ownership "https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server"
click node_policy_controls "https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server"
click node_bi_export "https://github.com/hystax/optscale/tree/integration/bi_exporter/bumblebi/exporter"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_importers,node_ingestion_worker,node_scheduler toneBlue
class node_cost_data,node_cost_visibility,node_workload_analytics,node_bi_export,node_export_storage toneAmber
class node_recommendation_worker,node_recommendations_ui,node_power_management,node_commitments toneMint
class node_budgets_alerts,node_ownership,node_policy_controls toneRose
class node_rest_api,node_web_ui,node_teams,node_clouds,node_data_platforms toneIndigo
```

## Components

### Data ingestion

- [Cloud importers](https://github.com/hystax/optscale/tree/integration/diworker/diworker/importers): `diworker/diworker/importers`
- [Ingestion worker](https://github.com/hystax/optscale/blob/integration/diworker/diworker/main.py): `diworker/diworker/main.py`
- [Import scheduler](https://github.com/hystax/optscale/blob/integration/bumischeduler/bumischeduler/main.py): `bumischeduler/bumischeduler/main.py`

### Cost analysis

- [Billing and usage data](https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server): `rest_api/rest_api_server`
- [Cost allocation and dashboards](https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server): `rest_api/rest_api_server`
- [Data workload analytics](https://github.com/hystax/optscale/tree/integration/diworker/diworker/importers): `diworker/diworker/importers`
- [BI data export](https://github.com/hystax/optscale/tree/integration/bi_exporter/bumblebi/exporter): `bi_exporter/bumblebi/exporter`

### Optimization

- [Recommendation analysis](https://github.com/hystax/optscale/tree/integration/bumiworker/bumiworker/modules/recommendations): `bumiworker/bumiworker/modules/recommendations`
- [Optimization recommendations](https://github.com/hystax/optscale/tree/integration/ngui/ui/src/containers/RecommendationsOverviewContainer): `ngui/ui/src/containers/RecommendationsOverviewContainer`
- [R&D power management](https://github.com/hystax/optscale/tree/integration/docker_images/power_schedule): `docker_images/power_schedule`
- [Commitment utilization](https://github.com/hystax/optscale/tree/integration/bumiworker/bumiworker/modules/recommendations): `bumiworker/bumiworker/modules/recommendations`

### FinOps governance

- [Budgets and cost alerts](https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server): `rest_api/rest_api_server`
- [Tagging and ownership](https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server): `rest_api/rest_api_server`
- [Governance controls](https://github.com/hystax/optscale/tree/integration/rest_api/rest_api_server): `rest_api/rest_api_server`

### Platform access

- [Platform API](https://github.com/hystax/optscale/blob/integration/rest_api/rest_api_server/server.py): `rest_api/rest_api_server/server.py`
- [FinOps dashboards](https://github.com/hystax/optscale/tree/integration/ngui/ui/src): `ngui/ui/src`

### Other components

- **Engineering and finance teams**
- **Cloud accounts and clusters**
- **Data platforms**
- **S3 or Azure storage**

## Connections

- Cloud accounts and clusters → Cloud importers: provide account data
- Data platforms → Cloud importers: provide workload data
- Import scheduler → Ingestion worker: schedule imports
- Ingestion worker → Cloud importers: select provider importer
- Ingestion worker → Billing and usage data: ingest usage data
- Billing and usage data → Cost allocation and dashboards: analyze spend
- Billing and usage data → Data workload analytics: analyze workload use
- Billing and usage data → Recommendation analysis: analyze consumption
- Cost allocation and dashboards → Platform API: serve cost views
- Recommendation analysis → Optimization recommendations: surface findings
- Platform API → FinOps dashboards: serve product data
- FinOps dashboards → Engineering and finance teams: show dashboards
- Optimization recommendations → Engineering and finance teams: show recommendations
- Billing and usage data → Commitment utilization: analyze utilization
- Engineering and finance teams → R&D power management: configure schedules
- Engineering and finance teams → Budgets and cost alerts: manage budgets
- Engineering and finance teams → Tagging and ownership: review attribution
- Engineering and finance teams → Governance controls: manage controls
- Billing and usage data → BI data export: export cost data
- BI data export → S3 or Azure storage: write export
