ADR-001: Database Abstraction Layer

Status

Accepted

Context

FT Services needs to support both MySQL (development) and Oracle (production) databases without changing application code or deployment manifests.

Decision

Implement database abstraction using Helm template helpers that:

  1. Generate appropriate JDBC URLs based on database.type value

  2. Abstract database host, port, and connection string formats

  3. Allow seamless switching via values files

{{- define "ft-services.dbJdbcUrl" -}}
{{- if eq .Values.database.type "mysql" -}}
jdbc:mysql://mysql:3306/{{ .Values.mysql.database }}
{{- else if eq .Values.database.type "oracle" -}}
jdbc:oracle:thin:@oracle:1521/{{ .Values.oracle.serviceName }}
{{- end -}}
{{- end }}

Consequences

Positive

  • Developers can use MySQL (faster, lighter)

  • Production uses Oracle (enterprise features)

  • Single Helm chart supports both

  • Easy environment creation with either database

  • Schema stays identical across databases

Negative

  • Must ensure SQL compatibility

  • Cannot use database-specific features in code

  • Testing burden (need to test both databases)

Alternatives Considered

  1. Separate charts per database - Rejected due to maintenance overhead

  2. Oracle everywhere - Rejected due to resource constraints

  3. MySQL everywhere - Rejected due to production requirements

References