SQL Database Management
Relevant source files
The following files were used as context for generating this wiki page:
SQL Database Management in Aether-X Ultimate encompasses the deployment, initialization, and structured organization of relational data using MySQL and PostgreSQL. These databases serve as the backbone for persistence regarding user accounts, application metadata, and structured workflow definitions.
The system utilizes containerized instances to ensure environment consistency across development and production. While MySQL is primarily tasked with user management and application data, PostgreSQL handles workflow definitions and complex relational data structures.
Sources: README.md:88-91, infrastructure/databases/docker-compose.yml:6-45
Database Architecture and Provisioning
The project employs a microservices-compatible database architecture where SQL engines are isolated within Docker containers. Each database is provisioned with specific environment variables for credentials and initialized using automated scripts.
Container Configuration
SQL services are defined with health checks to ensure they are ready before dependent microservices attempt to connect. Data persistence is managed via named Docker volumes.
| Service | Image | Default Port | Primary Purpose |
|---|---|---|---|
| MySQL | mysql:8.0 | 3306 | User management, core app data |
| PostgreSQL | postgres:15 | 5432 | Workflow definitions, relational data |
Sources: infrastructure/databases/docker-compose.yml:6-45, README.md:88-91, config/development.yaml (as seen in setup-dev.sh:110-117)
Initialization Flow
The initialization process uses a centralized shell script that generates SQL initialization files. These files are mounted into the /docker-entrypoint-initdb.d directory of the respective containers to execute on the first boot.
The diagram shows the automated workflow from script execution to the deployment of initialized SQL containers.
Sources: infrastructure/databases/init-databases.sh:1-168, infrastructure/databases/docker-compose.yml:19-20, 37-38
Data Models and Schema
The SQL schema is designed for a multi-tenant environment where users own applications and workflows. The schemas for MySQL and PostgreSQL are kept identical to support flexible deployment options.
Core Tables
The following tables are defined in both aether_x_db (MySQL) and aether_x_db (PostgreSQL):
- users: Stores authentication and profile data.
- apps: Contains metadata for no-code applications created by users.
- workflows: Stores JSON-structured automation logic linked to specific apps.
- content_generated: Tracks outputs from AI model executions.
Sources: infrastructure/databases/init-databases.sh:10-91
Schema Definition
| Field | Type (MySQL) | Type (PostgreSQL) | Constraints |
|---|---|---|---|
id | INT AUTO_INCREMENT | SERIAL | PRIMARY KEY |
username | VARCHAR(255) | VARCHAR(255) | UNIQUE, NOT NULL |
email | VARCHAR(255) | VARCHAR(255) | UNIQUE, NOT NULL |
structure | JSON | JSONB | - |
created_at | TIMESTAMP | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP |
Sources: infrastructure/databases/init-databases.sh:14-48, 55-91
Entity Relationship
The relationship between core entities follows a hierarchical structure where users are the top-level owners.
This ER diagram illustrates the relational links and foreign key constraints established during initialization.
Sources: infrastructure/databases/init-databases.sh:14-48
Infrastructure Management
SQL databases are integrated into the broader Aether-X network, allowing microservices like no-code-development and security to access them.
Connection Configuration
Services connect to SQL databases using environment-specific hostnames defined in the orchestration layers.
# Example from config/development.yaml
databases:
mysql:
host: localhost
port: 3306
name: aether_x_dev
postgres:
host: localhost
port: 5432
name: aether_x_dev
Sources: setup-dev.sh:110-117, docker-compose.yml:68-81
Maintenance and Health Checks
The SQL containers include health check commands to verify availability:
- MySQL: Uses
mysqladmin pingto check responsiveness. - PostgreSQL: Uses
pg_isreadyto verify database status.
Sources: infrastructure/databases/docker-compose.yml:23-26, 41-44
Summary
SQL Database Management in Aether-X Ultimate provides a robust relational storage layer through MySQL and PostgreSQL. By leveraging automated initialization scripts and containerized deployment, the system ensures that user data, application structures, and generated content are stored in a consistent, indexed, and relational format. This setup supports the high-level goals of the platform by providing the necessary structured persistence for the no-code development and security modules.
Sources: README.md:12-25, infrastructure/databases/init-databases.sh:1-5