# autobase-tech/autobase architecture

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

- Interactive diagram: https://gitdiagram.com/autobase-tech/autobase
- Repository: https://github.com/autobase-tech/autobase

## Overview

Autobase is a self-hosted PostgreSQL operations platform: users invoke its Ansible collection or platform UI to deploy and manage highly available clusters. The collection’s documented capabilities span provisioning, configuration, failover, backup/restore, upgrades, and scaling; its roles cover PostgreSQL, coordination, routing, and infrastructure. The graph preserves the sampled cloud-discovery and PgDog maintenance modules as supporting capabilities. Playbook and console internals were not sampled, so their links are limited to README-documented entry points and capabilities.

Main entry points: [`automation`](https://github.com/autobase-tech/autobase/tree/main/automation) (Ansible collection), [`automation/plugins/modules/pgdog_maintenance.py`](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/pgdog_maintenance.py) (PgDog maintenance), [`automation/plugins/modules/aws_nlb_subnets.py`](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/aws_nlb_subnets.py) (AWS zone discovery), [`automation/plugins/modules/aws_nlb_attributes.py`](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/aws_nlb_attributes.py) (AWS NLB attributes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_collection["Ansible collection"]
  node_platform_ui["Platform UI"]
end

subgraph group_operations["Cluster operations"]
  node_deploy["Deploy cluster"]
  node_configure["Configure cluster"]
  node_failover["Failover and switchover"]
  node_backup_restore["Backup and restore"]
  node_upgrade["Upgrade cluster<br/>[pg_upgrade.yml]"]
  node_scale["Scale cluster<br/>[add_node.yml]"]
end

subgraph group_platform["Cluster services"]
  node_postgres["PostgreSQL"]
  node_patroni["Patroni HA<br/>[main.yml]"]
  node_etcd["etcd coordination<br/>[main.yml]"]
  node_pooling["Connection pooling<br/>[main.yml]"]
  node_routing["PgDog routing<br/>[main.yml]"]
  node_backups["Backup services<br/>[main.yml]"]
end

subgraph group_cloud["Cloud integrations"]
  node_aws_zones["AWS zone discovery<br/>[aws_nlb_subnets.py]"]
  node_aws_attributes["AWS NLB attributes"]
  node_azure_zones["Azure zone discovery"]
  node_gcp_zones["GCP zone discovery"]
end

subgraph group_plugins["Ansible extensions"]
  node_pgdog_maintenance["PgDog maintenance"]
  node_yedit["YAML editing<br/>[yedit.py]"]
  node_json_log["JSON task logging<br/>[json_log.py]"]
end

node_operator(("Operator"))
node_aws["AWS services"]
node_azure["Azure services"]
node_gcp["Google Cloud"]
node_pgdog_service["PgDog instances"]
node_postgres_service[("PostgreSQL activity")]

node_operator -->|"runs"| node_collection
node_operator -->|"uses"| node_platform_ui
node_collection -.->|"deploys"| node_deploy
node_collection -.->|"manages"| node_configure
node_collection -.->|"manages"| node_failover
node_collection -.->|"manages"| node_backup_restore
node_collection -.->|"upgrades"| node_upgrade
node_collection -.->|"scales"| node_scale
node_pgdog_maintenance -->|"controls maintenance"| node_pgdog_service
node_pgdog_maintenance -->|"checks activity"| node_postgres_service
node_aws_zones -->|"queries"| node_aws
node_aws_attributes -->|"updates attributes"| node_aws
node_azure_zones -->|"discovers zones"| node_azure
node_gcp_zones -->|"lists zones"| node_gcp

click node_collection "https://github.com/autobase-tech/autobase/tree/main/automation"
click node_platform_ui "https://github.com/autobase-tech/autobase/tree/main/console"
click node_deploy "https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/deploy_pgcluster.yml"
click node_configure "https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/config_pgcluster.yml"
click node_failover "https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/failover_pgcluster.yml"
click node_backup_restore "https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/backup_pgcluster.yml"
click node_upgrade "https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/pg_upgrade.yml"
click node_scale "https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/add_node.yml"
click node_postgres "https://github.com/autobase-tech/autobase/tree/main/automation/roles/patroni"
click node_patroni "https://github.com/autobase-tech/autobase/blob/main/automation/roles/patroni/tasks/main.yml"
click node_etcd "https://github.com/autobase-tech/autobase/blob/main/automation/roles/etcd/tasks/main.yml"
click node_pooling "https://github.com/autobase-tech/autobase/blob/main/automation/roles/pgbouncer/tasks/main.yml"
click node_routing "https://github.com/autobase-tech/autobase/blob/main/automation/roles/pgdog/tasks/main.yml"
click node_backups "https://github.com/autobase-tech/autobase/blob/main/automation/roles/pgbackrest/tasks/main.yml"
click node_pgdog_maintenance "https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/pgdog_maintenance.py"
click node_yedit "https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/yedit.py"
click node_json_log "https://github.com/autobase-tech/autobase/blob/main/automation/plugins/callback/json_log.py"
click node_aws_zones "https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/aws_nlb_subnets.py"
click node_aws_attributes "https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/aws_nlb_attributes.py"
click node_azure_zones "https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/azure_compute_zones_info.py"
click node_gcp_zones "https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/gcp_compute_zones_info.py"

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_collection,node_platform_ui toneBlue
class node_deploy,node_configure,node_failover,node_backup_restore,node_upgrade,node_scale,node_postgres_service toneAmber
class node_postgres,node_patroni,node_etcd,node_pooling,node_routing,node_backups toneMint
class node_aws_zones,node_aws_attributes,node_azure_zones,node_gcp_zones toneRose
class node_pgdog_maintenance,node_yedit,node_json_log,node_operator,node_aws,node_azure,node_gcp,node_pgdog_service toneIndigo
```

## Components

### User entry points

- [Ansible collection](https://github.com/autobase-tech/autobase/tree/main/automation): `automation`
- [Platform UI](https://github.com/autobase-tech/autobase/tree/main/console): `console`

### Cluster operations

- [Deploy cluster](https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/deploy_pgcluster.yml): `automation/playbooks/deploy_pgcluster.yml`
- [Configure cluster](https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/config_pgcluster.yml): `automation/playbooks/config_pgcluster.yml`
- [Failover and switchover](https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/failover_pgcluster.yml): `automation/playbooks/failover_pgcluster.yml`
- [Backup and restore](https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/backup_pgcluster.yml): `automation/playbooks/backup_pgcluster.yml`
- [Upgrade cluster](https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/pg_upgrade.yml): `automation/playbooks/pg_upgrade.yml`
- [Scale cluster](https://github.com/autobase-tech/autobase/blob/main/automation/playbooks/add_node.yml): `automation/playbooks/add_node.yml`

### Cluster services

- [PostgreSQL](https://github.com/autobase-tech/autobase/tree/main/automation/roles/patroni): `automation/roles/patroni`
- [Patroni HA](https://github.com/autobase-tech/autobase/blob/main/automation/roles/patroni/tasks/main.yml): `automation/roles/patroni/tasks/main.yml`
- [etcd coordination](https://github.com/autobase-tech/autobase/blob/main/automation/roles/etcd/tasks/main.yml): `automation/roles/etcd/tasks/main.yml`
- [Connection pooling](https://github.com/autobase-tech/autobase/blob/main/automation/roles/pgbouncer/tasks/main.yml): `automation/roles/pgbouncer/tasks/main.yml`
- [PgDog routing](https://github.com/autobase-tech/autobase/blob/main/automation/roles/pgdog/tasks/main.yml): `automation/roles/pgdog/tasks/main.yml`
- [Backup services](https://github.com/autobase-tech/autobase/blob/main/automation/roles/pgbackrest/tasks/main.yml): `automation/roles/pgbackrest/tasks/main.yml`

### Cloud integrations

- [AWS zone discovery](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/aws_nlb_subnets.py): `automation/plugins/modules/aws_nlb_subnets.py`
- [AWS NLB attributes](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/aws_nlb_attributes.py): `automation/plugins/modules/aws_nlb_attributes.py`
- [Azure zone discovery](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/azure_compute_zones_info.py): `automation/plugins/modules/azure_compute_zones_info.py`
- [GCP zone discovery](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/gcp_compute_zones_info.py): `automation/plugins/modules/gcp_compute_zones_info.py`

### Ansible extensions

- [PgDog maintenance](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/pgdog_maintenance.py): `automation/plugins/modules/pgdog_maintenance.py`
- [YAML editing](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/modules/yedit.py): `automation/plugins/modules/yedit.py`
- [JSON task logging](https://github.com/autobase-tech/autobase/blob/main/automation/plugins/callback/json_log.py): `automation/plugins/callback/json_log.py`

### Other components

- **Operator**
- **AWS services**
- **Azure services**
- **Google Cloud**
- **PgDog instances**
- **PostgreSQL activity**

## Connections

- Operator → Ansible collection: runs (evidence: `README.md`)
- Operator → Platform UI: uses (evidence: `README.md`)
- Ansible collection → Deploy cluster: deploys
- Ansible collection → Configure cluster: manages
- Ansible collection → Failover and switchover: manages
- Ansible collection → Backup and restore: manages
- Ansible collection → Upgrade cluster: upgrades
- Ansible collection → Scale cluster: scales
- PgDog maintenance → PgDog instances: controls maintenance (evidence: `automation/plugins/modules/pgdog_maintenance.py`)
- PgDog maintenance → PostgreSQL activity: checks activity (evidence: `automation/plugins/modules/pgdog_maintenance.py`)
- AWS zone discovery → AWS services: queries (evidence: `automation/plugins/modules/aws_nlb_subnets.py`)
- AWS NLB attributes → AWS services: updates attributes (evidence: `automation/plugins/modules/aws_nlb_attributes.py`)
- Azure zone discovery → Azure services: discovers zones (evidence: `automation/plugins/modules/azure_compute_zones_info.py`)
- GCP zone discovery → Google Cloud: lists zones (evidence: `automation/plugins/modules/gcp_compute_zones_info.py`)
