Adding operational state to the Lakehouse with Databricks Lakebase

Adding operational state to the Lakehouse with Databricks Lakebase

Lakebase-powered workflow prioritization in the Blueprint Informatica Migration Workbench

Table of Contents
    Add a header to begin generating the table of contents
    Scroll to Top
    Table of Contents
      Add a header to begin generating the table of contents
      Scroll to Top

      How Blueprint Informatica Migration Workbench uses Lakebase to manage workflow prioritization within the Databricks platform

      The Blueprint Informatica Migration Workbench is a Databricks App that guides enterprise teams through a six-stage migration process: Assess, Design, Migrate, Integration, Validation, and Transition. It processes Informatica XML workflows, uses Mosaic AI for migration guidance, automates code conversion to PySpark, and reads from dozens of Delta Lake tables in Unity Catalog to present dashboards, scorecards, and stage-by-stage progress. 

      As the workbench matured, a new class of requirement emerged. Teams needed to prioritize which workflows migrate first and see that prioritization reflected everywhere in the workbench: assessment queues, conversion pipelines, validation dashboards, and consolidated scorecards. This kind of user-driven operational state (small, frequent, transactional writes like assigning a priority or swapping two rankings) called for something purpose-built. Databricks Lakebase provided exactly that. 

      The three-layer architecture

      With Lakebase, the workbench now operates as a three-layer Lakehouse application, each layer handling what it does best. 

      Layer 1: Databricks Apps

      Provides the Streamlit frontend, hosted natively in the Databricks workspace with On-behalf-of (OBO) authentication, service principal isolation, and Databricks Asset Bundle (DAB) deployment.

      Layer 2: Unity Catalog + Delta Lake

      Serves as the analytical data layer. Assessment results, pipeline execution state, file registries, complexity scores, and conversion artifacts are all stored as Delta tables. This layer is read-heavy, optimized for analytical queries via Databricks SQL, and governed through Unity Catalog’s access controls. It handles the “what happened” questions: Which workflows have been assessed? What are the complexity distributions? How many conversions have passed validation?

      Layer 3: Databricks Lakebase

      Provides the operational data layer. As a PostgreSQL-compatible managed OLTP database within the Databricks platform, Lakebase handles the transactional, low-latency read/write operations that interactive user-driven state demands. Workflow priorities live here, where inserts, updates, and deletes execute in milliseconds. It handles the “what should happen next” questions: Which workflow is the highest priority? What order should the migration factory process work?

      The result is a full-stack application with zero external dependencies and a single security model. No external databases to provision, no VPC peering to configure, no separate backup strategies to maintain.

      This is a high level overview of Lakebase from Databricks found here.

      How does it work?

      Auto-detect and activate

      The Lakebase integration follows a zero-configuration activation pattern. When a LAKEBASE_INSTANCE_NAME environment variable is set in the Databricks App’s app.yaml, the feature activates automatically. When the variable is missing or empty, every Lakebase-dependent feature is completely hidden. No error messages, no empty UI sections, no failed connections. A single is_lakebase_enabled() gate function controls this behavior across the entire application. Teams can adopt Lakebase when ready without modifying a single line of application code.

      Authenticate with platform identity

      The connection layer uses psycopg2 with OAuth tokens generated through the Databricks SDK. The get_lakebase_connection() function calls WorkspaceClient().database.generate_database_credential() to produce short-lived tokens that expire in approximately 15 minutes. A module-level cache with a 14-minute TTL ensures tokens are refreshed before expiration. No stored passwords, no connection strings in configuration files, and no separate credential rotation policies. The same identity that governs Unity Catalog access authenticates to Lakebase.

      Store operational state in PostgreSQL

      Priority assignments are stored in a public.workflow_priorities PostgreSQL table within Lakebase, with UNIQUE constraints on both file_id and priority columns. The table is auto-created on first access using idempotent CREATE TABLE IF NOT EXISTS statements. All queries use parameterized values through psycopg2 to prevent SQL injection. Writes commit transactionally; failures trigger automatic rollback.

      Bridge analytical and operational data

      The apply_priority_sort() function bridges the two data layers. It reads priority assignments from Lakebase (PostgreSQL), then merges them onto DataFrames sourced from Unity Catalog (Delta Lake) using pandas. Normalized name matching handles case differences and file extensions across pages. The result is a unified view: analytical data enriched with operational state, sorted by priority with unprioritized items falling to the bottom.

      Degrade gracefully under any condition

      If Lakebase becomes unavailable at runtime, the workbench falls back to its original alphabetical sorting without displaying errors. Priority data is cached via Streamlit’s @st.cache_data(ttl=60) to minimize round-trips. Every Lakebase operation is wrapped in exception handling that logs warnings and returns safe defaults. The workbench never breaks because of an operational feature.

      Key features of the integration

      Connection layer with OAuth token management

      The lakebase_utils.py module provides a purpose-built connection layer for Lakebase. Rather than maintaining persistent connection pools (unnecessary for Streamlit’s request-per-interaction model), the module opens and closes connections per operation while caching the underlying credentials.

      Short-lived OAuth tokens are generated through the Databricks SDK and cached at the module level with a 14-minute TTL. This approach avoids regenerating tokens on every database call while ensuring credentials rotate before expiration. The connection configuration, including the Lakebase instance’s read-write DNS endpoint, is resolved dynamically from the Databricks workspace.

      This means deployments require no database connection strings, no credential vaults, and no infrastructure provisioning beyond creating the Lakebase instance itself. The app discovers everything it needs from the platform.

      Priority manager with transactional guarantees

      The PriorityManager class encapsulates all business logic for workflow priority operations. It supports five core operations:

      • Assign priority: Insert a new priority using INSERT ... ON CONFLICT (file_id) DO UPDATE, handling both first-time assignments and edits in a single atomic statement
      • Edit priority: Update an existing assignment with the same upsert pattern, recording the user who made the change and the timestamp
      • Remove priority: Delete a priority record, causing the workflow to return to alphabetical positioning
      • Swap priorities: Exchange priorities between two workflows using a three-step update with a temporary sentinel value (-1) to satisfy the UNIQUE constraint at every intermediate step
      • Validate uniqueness: Check whether a priority number is available before assignment, with an optional exclusion for the workflow being edited
      Each write operation clears the Streamlit cache to ensure the UI reflects the latest state immediately. The table schema tracks created_by, updated_by, created_at, and updated_at metadata for every record, establishing an audit foundation from day one.

      Intelligent sorting across every page

      The apply_priority_sort() helper merges Lakebase priority data onto any workflow DataFrame and applies consistent sorting. It auto-detects the join strategy based on available columns, joining on file_id when available and falling back to workflow_name with normalized case-insensitive, extension-insensitive matching when queries return name-based results.

      This sorting applies across every page of the workbench: the Dashboard scorecard, session tables, stage progress views, and individual stage pages. Prioritized workflows surface to the top. Unprioritized workflows follow in alphabetical order. The priority column appears as the first column in every table, giving teams immediate visual confirmation of migration sequencing

      Settings page management interface

      The Settings page provides a complete management interface for workflow priorities, gated by is_lakebase_enabled(). The section includes quick stats showing total, prioritized, and unprioritized workflow counts. An interactive priority table displays all active workflows with their current assignment. Expanders provide forms for assigning new priorities, editing or removing existing ones, and swapping priorities between workflows.

      Permission checks ensure that users with appropriate access can view priority assignments while only write and admin users can modify them. Validation prevents duplicate priority assignments with descriptive error messages identifying which workflow holds the conflicting priority.

      Why this matters

      Enterprise migration projects involve dozens or hundreds of workflows, each with different complexity, business criticality, and resource requirements. Without prioritization, teams process workflows in arbitrary order, often tackling simple ones first while business-critical migrations wait. Priorities get tracked in spreadsheets. Decisions are communicated in meetings. Assignments live in project management tools that have no connection to the data they reference.

      The Lakebase integration brings that operational context directly into the workbench. Project managers assign priorities based on business impact. Those priorities propagate into assessment queues, conversion pipelines, and validation workflows. The entire migration factory operates in priority order without manual coordination. The same interface that shows whether a workflow has been converted also shows whether it should be converted next.

      From an architecture standpoint, the three-layer pattern addresses a broader need. Lakehouse applications built on Databricks Apps have powerful analytical capabilities through Unity Catalog and Delta Lake. Lakebase adds a natural home for the transactional writes that make applications interactive, all without leaving the platform. One platform, one security model, one operational surface.

      The auto-detect pattern also provides a blueprint for incremental feature adoption. Organizations can deploy the workbench without Lakebase and add operational capabilities later by provisioning a Lakebase instance and setting a single environment variable. No code changes. No redeployments. No feature flag management systems.

      What’s next

      Workflow prioritization is the first operational capability built on Lakebase, but the transactional foundation it establishes opens a clear roadmap:

      • Approval workflows and sign-offs: Stage gates where stakeholders approve migration readiness before a workflow advances
      • User annotations and notes: Free-text comments attached to individual workflows, capturing tribal knowledge alongside automated assessments
      • Team assignments and ownership tracking: Assigning workflows to specific engineers or teams with workload balancing visibility
      • SLA tracking and deadline management: Target completion dates with automated alerts when workflows fall behind schedule
      • Activity logging and audit trails: Granular records of every operational decision, queryable for compliance and retrospective analysis
      • Custom metadata tagging: User-defined labels for categorizing workflows by business unit, regulatory domain, or migration wave

      Each of these capabilities follows the same three-layer pattern: transactional state in Lakebase, analytical data in DeltaLake, merged at the application layer, and gated by feature detection. The connection layer, PriorityManager pattern, and apply_priority_sort() merge approach are all reusable templates for the next operational capability. 

      This pattern extends beyond migration workbenches. Data quality platforms, ML experiment trackers, and customer-facing analytics portals all need the same combination of analytical reads and operational writes. If your team is building Databricks Apps and needs user-driven operational state alongside analytical data, the three-layer pattern gives you aconcrete starting point: is_lakebase_enabled() for feature gating, psycopg2 with SDK-generated OAuth tokens for connections, and pandas merges for bridging the two data layers.  

      Share with your network

      You may also enjoy

      Master High-Stakes Database Migrations: Reduce Risk and Accelerate AI Readiness

      ACCESS THE REPORT

      Master High-Stakes Database Migrations: Reduce Risk and Accelerate AI Readiness (February 2026)​

      First name *
      Last name *
      Job title *
      Company *
      Company email *