Skip to content

feat(db): unify all databases into single airavata DB with schema migrations#592

Merged
yasithdev merged 2 commits intomasterfrom
feat/svclayer-db
Mar 26, 2026
Merged

feat(db): unify all databases into single airavata DB with schema migrations#592
yasithdev merged 2 commits intomasterfrom
feat/svclayer-db

Conversation

@yasithdev
Copy link
Copy Markdown
Contributor

Summary

Consolidates 7+ separate databases into a single airavata database and introduces a unified V1 baseline schema generated from the JPA entity annotations in the codebase.

What changed

  • Single database: All persistence units (experiment_catalog, app_catalog, replica_catalog, workflow_catalog, sharing_catalog, credential_store, profile_service) now point to one airavata database
  • V1 baseline schema: 146 tables generated from @Entity/@Table annotations across all modules, verified 1:1 against ORM create mode output
  • Table name deduplication: Profile GATEWAYTENANT_GATEWAY, Research PROJECTRESEARCH_PROJECT (resolved collisions from merging separate DBs)
  • Removed dead code: Legacy workflowcatalog entities (not in any persistence unit), DatabaseCreator, DBMigrator, old migration delta scripts
  • Hostname standardization: All configs use airavata.localhost (RFC 6761 .localhost TLD, auto-resolves to 127.0.0.1)
  • Simplified compose.yml: Single compose file with MariaDB, RabbitMQ, ZooKeeper, Kafka, Keycloak. DB auto-initializes from V1 schema via docker-entrypoint-initdb.d
  • Removed .devcontainer/: Consolidated configs into conf/ and root compose.yml

Files changed by category

Category Description
Java entities (2 lines) @Table/@Entity name renames for deduplication
Java DB init DBInitializer → no-op (schema from SQL now)
Java deleted DatabaseCreator, MappingToolRunner, DBMigrator, etc.
SQL V1 baseline (1720 lines), removed old per-catalog scripts
Properties/YAML JDBC URLs → single DB, hostnames → airavata.localhost
Docker New compose.yml, removed old docker-compose.yml + .devcontainer/
Ansible DB names unified, hostnames standardized
pom.xml Removed registry-db-migrator module

No business logic, API, or feature changes — purely DB/DevOps.

Verification

All 9 services tested from clean slate (docker compose up + V1 schema):

Service ORM Validate Port
Registry Server OpenJPA PASS 8970
Credential Store OpenJPA PASS 8960
Sharing Registry OpenJPA PASS 7878
API Server OpenJPA PASS 8930
Orchestrator OpenJPA PASS 8940
Profile Service OpenJPA PASS 8962
Research Service Hibernate PASS 18889
Agent Service Hibernate PASS 18880

Zero schema errors, zero RabbitMQ errors, all ports listening.

Test plan

  • mvn clean install -DskipTests builds successfully
  • docker compose up -d starts all infrastructure
  • V1 schema loads cleanly (146 tables, no errors)
  • OpenJPA services connect and validate against schema
  • Hibernate services (ddl-auto: validate) pass
  • All 9 service ports listening simultaneously
  • Run existing test suites with Docker available

🤖 Generated with Claude Code

…rations

- Consolidate 7+ separate databases (app_catalog, experiment_catalog,
  replica_catalog, workflow_catalog, sharing_catalog, credential_store,
  profile_service) into a single 'airavata' database
- Generate V1 baseline schema (146 tables) from JPA entity annotations
  across all modules: experiment catalog, application catalog, airavata
  workflow catalog, replica catalog, sharing registry, profile service,
  research service, and agent service
- Rename duplicate table names for single-DB coexistence:
  profile GATEWAY -> TENANT_GATEWAY, research PROJECT -> RESEARCH_PROJECT
- Remove legacy workflowcatalog tables (dead code, not in any persistence unit)
- Remove legacy DatabaseCreator and make DBInitializer a no-op
  (schema creation now handled by migration SQL)
- Restore persistence.xml (needed by OpenJPA enhancer) and dozer_mapping.xml
- Standardize all hostnames to airavata.localhost (RFC 6761 .localhost TLD)
- Simplify compose.yml: single file with all infrastructure services
  (MariaDB, RabbitMQ, ZooKeeper, Kafka, Keycloak)
- Remove .devcontainer directory (Dockerfile kept, compose consolidated)
- Remove portals, proxy, gateway-storage configs
- DB init uses V1 flyway migration SQL directly via docker-entrypoint-initdb.d
- Fix validation queries (SELECT 1 instead of SELECT 1 from CONFIGURATION)
- Fix RabbitMQ credentials to match compose (airavata:airavata)

Verified: all 9 services start and pass schema validation against
the V1 baseline with zero errors.
- Update spotless-maven-plugin 2.44.5 -> 3.4.0
- Update palantir-java-format 2.70.0 -> 2.89.0 (Java 25 compat)
- Apply formatting fixes
@yasithdev yasithdev merged commit 7d0d8fb into master Mar 26, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant