<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Do Thanh Long on Medium]]></title>
        <description><![CDATA[Stories by Do Thanh Long on Medium]]></description>
        <link>https://medium.com/@dothanhlongit?source=rss-1cda208b3b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RivWHLUm-bbI1uDZ</url>
            <title>Stories by Do Thanh Long on Medium</title>
            <link>https://medium.com/@dothanhlongit?source=rss-1cda208b3b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:13:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dothanhlongit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Technical Proposal: decoupling Liquibase Database Migration from Application Startup in Backbase…]]></title>
            <link>https://medium.com/@dothanhlongit/technical-proposal-decoupling-liquibase-database-migration-from-application-startup-in-backbase-541ba53fd749?source=rss-1cda208b3b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/541ba53fd749</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[engagement]]></category>
            <category><![CDATA[backbase]]></category>
            <category><![CDATA[data-migration]]></category>
            <category><![CDATA[liquibase]]></category>
            <dc:creator><![CDATA[Do Thanh Long]]></dc:creator>
            <pubDate>Thu, 26 Nov 2026 08:49:45 GMT</pubDate>
            <atom:updated>2026-11-26T08:49:45.726Z</atom:updated>
            <content:encoded><![CDATA[<h3>Technical Proposal<strong>: decoupling Liquibase Database Migration from Application Startup in Backbase Platform</strong></h3><p>1. Executive Summary</p><p>Backbase currently supports database schema migration through Liquibase integration. In Kubernetes deployments, Liquibase executes within an init container before the application container starts. The Backbase Database Change Management Documentation outlines this as the standard deployment pattern for cloud environments.</p><p>While this approach provides automated schema management and ensures database consistency, it introduces several operational challenges at enterprise scale:</p><ul><li>Increased application startup time.</li><li>Tight coupling of database migration and application deployment.</li><li>Higher deployment risk during large schema changes.</li><li>Rollout failures caused by migration timeouts or lock contention.</li><li>Reduced operational flexibility for database governance.</li></ul><p>This proposal recommends moving Liquibase execution from the Kubernetes runtime startup path into the CI/CD release pipeline. The proposed approach separates <strong>Database Deployment</strong> from <strong>Application Deployment</strong>, allowing database changes to be reviewed, validated, and executed before application rollout.</p><p>2. Current Backbase Approach</p><p>2.1 Liquibase Architecture</p><p>According to the Backbase Database Change Management Documentation, every service contains a master changelog:</p><pre>db.changelog-persistence.xml</pre><p>which references versioned changelog files. During execution, Liquibase compares the changelog with:</p><ul><li>DATABASECHANGELOG</li><li>DATABASECHANGELOGLOCK</li></ul><p>to determine and apply pending migrations.</p><p>2.2 Kubernetes Deployment Pattern</p><p><strong>Current deployment flow:</strong></p><p>Helm Deploy<br> ↓<br>Kubernetes Pod Created<br> ↓<br>Liquibase Init Container (InitContainerApplication)<br> ↓<br>Apply Pending Changesets<br> ↓<br>Exit Successfully<br> ↓<br>Main Application Container Starts</p><p>Liquibase is enabled via Helm values:</p><p>yaml</p><pre>global:<br>  liquibase:<br>    enabled: true</pre><p>The init container executes InitContainerApplication and performs all required migration activities before the main application container can start.</p><p>3. Benefits of Current Approach</p><p>The existing Backbase design provides several advantages, particularly in early development stages:</p><ul><li><strong>3.1 Automated Schema Synchronization:</strong> Every deployment automatically ensures Application Version == Database Schema Version without requiring a separate migration process.</li><li><strong>3.2 Reduced Operational Complexity:</strong> Development teams only need to trigger a service deployment; database migration is handled automatically.</li><li><strong>3.3 Consistent Release Behavior:</strong> Each environment receives the exact same migration logic because the changelog travels together with the application artifact.</li><li><strong>3.4 Migration Lock Protection:</strong> Liquibase uses DATABASECHANGELOGLOCK to prevent concurrent migrations from multiple pod instances.</li></ul><p>4. Pain Points and Limitations</p><p>Although appropriate for development environments, several critical issues emerge when this pattern is applied to mission-critical production banking systems.</p><p>4.1 Increased Cold Start Time</p><p>Startup duration becomes directly dependent on migration execution time (Pod Start → Migration → Application Start).</p><ul><li><strong>Result:</strong> Longer deployment windows, extended recovery time (MTTR), and slower auto-scaling or node failover.</li></ul><p>4.2 Deployment Coupled with Database Changes</p><p>Application deployment cannot proceed until database migration succeeds (Migration Failed → Init Container Failed → Pod CrashLoopBackOff → Deployment Failed). A database script issue directly causes an application deployment outage.</p><p>4.3 Rollout Timeout Risk</p><p>Modern delivery and GitOps platforms enforce strict rollout time limits (e.g., Jenkins timeout, GitLab CI timeout, Helm --timeout, ArgoCD sync timeout). Long-running migrations can exceed these thresholds and mark the deployment as failed even when the migration itself is technically valid.</p><p>4.4 Production Governance Challenges</p><p>In regulated banking environments, production database changes strictly require:</p><ul><li>DBA review and SQL script verification.</li><li>CAB (Change Advisory Board) approval.</li><li>Audit tracking and controlled execution windows.</li></ul><p>Automatic startup migration bypasses pre-execution DBA inspection and reduces governance visibility.</p><p>4.5 Horizontal Scaling Impact</p><p>When multiple replicas start simultaneously:</p><pre>Pod A: acquires lock -&gt; runs migration<br>Pod B: waits on DATABASECHANGELOGLOCK<br>Pod C: waits on DATABASECHANGELOGLOCK</pre><p>All application instances block and remain dependent on Liquibase completion before serving traffic.</p><p>5. Existing Capability Provided by Backbase</p><p>Backbase already provides native mechanisms suitable for decoupled migrations without requiring product customization. As detailed in the Backbase Database Change Management Documentation:</p><ul><li>Each service builds and ships a dedicated artifact containing all Liquibase changelogs:</li><li>&lt;service-name&gt;-service-liquibase.zip</li><li>Backbase supports generating raw SQL scripts prior to execution:</li><li>liquibase update-sql</li><li>allowing DBAs to inspect exact DDL/DML statements before approving execution.</li></ul><p>6. Proposed Solution</p><p>6.1 Architecture Principle</p><p>Move Liquibase execution from the <strong>Runtime Deployment Stage</strong> to the <strong>Release Pipeline Stage</strong>, enforcing strict version alignment between the database artifact (-service-liquibase.zip) and application artifact (-service.jar).</p><p>6.2 New Deployment Workflow</p><p><strong>1. Build Phase</strong></p><pre>Source Code -&gt; Build Service -&gt; Publish Immutable Artifacts (Tagged with Release Version):<br>  - &lt;service&gt;-service.jar<br>  - &lt;service&gt;-service-liquibase.zip</pre><p><strong>2. Database Migration Phase (Triggered by Release Request / CAB Approval)</strong></p><pre>Release Action<br>  ↓<br>Jenkins Pipeline<br>  ↓<br>Download &lt;service&gt;-service-liquibase.zip<br>  ↓<br>Generate &amp; Verify SQL (liquibase update-sql) [Optional DBA Gate]<br>  ↓<br>Execute Liquibase Update (liquibase update)<br>  ↓<br>Validate Results &amp; Mark Success</pre><p><strong>3. Application Deployment Phase (Executed only after DB migration succeeds)</strong></p><pre>Deploy Helm Chart<br>  ↓<br>Pod Created<br>  ↓<br>Application Starts Immediately (No migration overhead)</pre><p>7. Target Configuration by Environment</p><p>Environment<strong>global.liquibase.enabled</strong>Execution MechanismPurpose<strong>DEV / SIT</strong>trueKubernetes Init ContainerMaximize developer productivity and fast feedback loops.<strong>UAT / Pre-Prod</strong>falseJenkins Release PipelineRehearse and validate the exact production migration workflow (Dry-run).<strong>Production</strong>falseJenkins Release PipelineEnsure governance, fast startup, and failure domain isolation.</p><p>8. Proposed CI/CD Flow</p><pre>Developer Commit<br>  ↓<br>CI Build &amp; Package<br>  ↓<br>Publish Artifacts (service.jar &amp; service-liquibase.zip)<br>  ↓<br>[Release Approval / DBA Sign-off]<br>  ↓<br>Jenkins CD Job:<br>  ├── Step 1: Run Liquibase Migration (using matching version tag)<br>  ├── Step 2: Verify Database State<br>  └── Step 3: Deploy Application via Helm</pre><p>9. Expected Benefits</p><ul><li><strong>Faster Startup:</strong> Application startup becomes Pod Start -&gt; Application Ready, eliminating migration overhead and improving auto-scaling responsiveness.</li><li><strong>Failure Domain Separation:</strong> DB Migration Failure != Application Deployment Failure. Database issues are caught before touching running application pods.</li><li><strong>Improved Governance:</strong> Enables formal DBA review (update-sql), CAB approval workflows, and compliance audit trails.</li><li><strong>Better Incident Recovery:</strong> Database and application lifecycles are managed independently, giving operations teams clearer recovery paths.</li><li><strong>Improved Observability:</strong> Migration logs are centralized in Jenkins build records and audit logs rather than buried inside ephemeral init container logs.</li></ul><p>10. Risks and Mitigations</p><p>RiskImpactMitigation Strategy<strong>Schema &amp; Code Version Mismatch</strong> (Old app code N-1 running against new DB schema N during rollout)Application runtime errors or data corruption during deployment window.Enforce <strong>Backward-Compatible Migrations (Expand &amp; Contract pattern)</strong>. Breaking changes (e.g., DROP COLUMN, RENAME) must be split across two separate releases.<strong>Artifact Version Drift</strong> (Running liquibase.zip from version X while deploying service.jar of version Y)Missing tables/columns or unexpected runtime exceptions.Enforce <strong>Immutable Release Tagging</strong> in CI/CD. Jenkins pipeline must pull both artifacts using a single, unified Release Tag.<strong>Failed or Partial Database Rollback</strong>Difficulty reverting database state if application deployment fails post-migration.Require explicit &lt;rollback&gt; blocks in all Liquibase changesets, take automated DB snapshots prior to production runs, and favor <strong>roll-forward</strong> hotfixes for data mutations.<strong>Manual / Pipeline Misconfiguration</strong>Accidentally leaving liquibase.enabled: true in Production Helm values.Enforce Helm chart validation / policy checks (e.g., OPA/Kyverno or CI linting) to block liquibase.enabled: true in UAT and Production manifests.</p><p>11. Recommendation</p><p>For enterprise banking platforms, database schema migration should be treated as an independent, governed release activity rather than a runtime container startup task.</p><p>We recommend adopting the decoupled pipeline model:</p><ol><li><strong>Build:</strong> Package service.jar and service-liquibase.zip with unified versioning.</li><li><strong>Migrate:</strong> Execute Liquibase via a governed Jenkins pipeline (update-sql review → update).</li><li><strong>Deploy:</strong> Roll out the application via Helm with global.liquibase.enabled: false in <strong>UAT</strong> and <strong>Production</strong>.</li></ol><p>This approach preserves full compatibility with Backbase’s native tooling while reducing startup latency, minimizing rollout risks, and satisfying enterprise banking governance standards.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=541ba53fd749" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>