ADR-001: Database Abstraction Layer
Table of Contents
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:
-
Generate appropriate JDBC URLs based on
database.typevalue -
Abstract database host, port, and connection string formats
-
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
Alternatives Considered
-
Separate charts per database - Rejected due to maintenance overhead
-
Oracle everywhere - Rejected due to resource constraints
-
MySQL everywhere - Rejected due to production requirements