Skip to content

Replit on Databricks: governed apps with Lakebase Postgres

TechFabricUpdated 7 min readAnnouncements

We build applications on Databricks Lakebase. For any of them, the first question we'd settle is where the app's own records live, apart from the analytics it reads. We moved DealerIQ's TotalLoop onto Lakebase from Cosmos DB and SQL Server, in waves that could each be rolled back (case study). In September we built an app on it live in front of our Gilbert user group.

Replit and Databricks have now settled that question for anyone building with Replit Agent. The integration is generally available with native Lakebase support (Databricks blog). Somebody describes an internal tool in plain language and gets a working app, deployed inside Databricks. It reads the company's governed data and keeps its own records in a Lakebase database.

Someone can build a tool in an afternoon under the same permissions as the reports, which is the upside. Fifty of them with no owner is the risk. We haven't shipped a system with Replit Agent in it, so our decisions come from building on Lakebase. We'd make them before anybody types the first prompt.

What the app's own data needs

Reading from a lakehouse was never the hard part of an internal app. Approvals, comments, submissions and workflow state need a transactional database, and that usually meant an external Postgres or MySQL with its own permission model, its own compliance review and its own on-call.

Lakebase removes that second estate. In our own session building an app on it at the Gilbert Databricks User Group in September, nobody typed a database password, because a person at psql and the application both signed in with a one-hour Databricks OAuth token, and Postgres GRANT decided the rest. The app's writes reached Delta through the change data feed in 10 to 15 seconds. For a security reviewer, the change is that the app's database lives inside the workspace and signs people in with identities they already audit.

Databricks draws the split in its announcement: the app reads analytical data through a SQL warehouse and writes its operational data, such as submissions, approvals and state, to Lakebase (Databricks blog). A prompt that says "copy the warehouse into the app database so it's faster" is asking for the wrong shape, and we'd stop it there. The copy would need its own refresh, its own grants and its own explanation every time it disagreed with the governed tables the rest of the business reads.

A price-exception app on Lakebase

Take a wholesale distributor whose sales managers ask for price exceptions by email and whose finance team approves them in a spreadsheet. Each manager could open a Replit-built app, deployed as a Databricks App, see current margin by customer from a gold table, and file a request with a reason. A finance approver would see the queue, the margin impact and the history.

The margins come from the SQL warehouse under Unity Catalog grants. The requests, approvals and comments land in the app's Lakebase database, where Postgres roles and grants decide access, separately from Unity Catalog (permissions). Each manager should see only their own region, so we'd put a row filter keyed to region on the margin table and row-level security on the requests. We tested that kind of policy at Gilbert, where one policy on an orders table gave the owner every row, gave a service principal an empty result, and refused a write it would have hidden with a 403 and error 42501.

Replit-built app

Deployed as a Databricks App

Reads margins through the SQL warehouse

Writes requests and approvals to Lakebase

Unity Catalog grants

Postgres roles and row-level security

The app reads margins under Unity Catalog grants and writes requests and approvals to Lakebase under Postgres roles and grants.

Over a quarter, those approvals become a record finance can query for who granted which exception at what margin, which is the question the email thread never answered.

Service principal or user connector

The connector mode is the decision that's hardest to reverse once apps are in use, so we'd make it first. Databricks' announcement describes both (Databricks blog).

Service principal (M2M) User-to-machine (U2M)
Identity One shared service identity Each builder's own Databricks identity
What a builder can see Whatever the principal is granted Their own Unity Catalog grants
Where we'd use it A platform team building for others against a known set of tables Builders who should see only what their own grants allow

With a shared principal, its grants are the ceiling for everyone building with it. Working out who can see what through one identity is the analysis this integration was meant to remove. Before launch we'd also check whose identity the deployed app queries as, since both modes are described in terms of the builder, and a manager who opens the app should see their own region, not the builder's.

Databricks puts setup at about 15 minutes across three roles. A Databricks admin creates the service principal and its OAuth secret, which is shown only once. A Replit organisation admin adds the connector and limits who may use it, and a builder on Replit Enterprise switches it on in a project. We'd book all three into the same half hour, so the secret never sits in a chat thread overnight.

Schema changes, idle time and limits

Replit's Supervised AI Migration makes any schema change Replit Agent proposes wait for team approval (Databricks blog), and we'd turn it on before the first app ships. Automated Preview Deploys give each change its own test environment. We'd still want every schema change to exist as a migration file, because a change somebody makes by hand in a test environment never reaches production and is lost with it.

Idle time is the setting we'd tune next. Lakebase scales compute to zero after an inactivity timeout that defaults to 24 hours and can be set from 60 seconds to 7 days (scale to zero). An approvals app used in office hours idles every night and weekend, so we'd set it well under a day. The price is a slower first query each morning, which on our Gilbert project meant 2,979 ms against 1,650 ms warm.

The workspace has to be a standard one without a compliance security profile (Databricks blog), so teams with HIPAA or PCI workspaces should check that before planning anything. The organisation needs Replit's Enterprise plan, and the bills come from the Replit contract, Databricks Apps compute while an app runs, and Lakebase. Databricks caps apps at 100 per workspace (resource limits), and a prompt-driven builder gets there faster than a team writing code.

Who owns a prompt-built app after launch

This is for internal, governed, data-backed apps, and we wouldn't use it for a customer-facing product. An agent that explores the schema writes queries only as good as the schema it finds, so a catalog of inconsistently named tables yields an app that looks finished and returns wrong numbers. If the data an app needs still sits in an ERP or a CRM, that pipeline comes first (data integration).

The harder question comes after the first app works. A finance approver who relies on the price-exception queue will expect it on Monday, and the sales manager who prompted it into existence isn't on call. We'd treat every app that a second team depends on as a product with a named owner and a review whenever its schema changes. We'd make the platform team, not the builder, responsible for noticing when that happens, since only they can see which apps have users outside the team that built them.

The first thing we'd do is settle the connector mode, switch on Supervised AI Migration and name the person who retires apps unopened for a quarter. Then build one app with a real queue behind it and measure whether requests stop arriving by email.

Frequently asked questions

Where does a Replit-built Databricks app keep its own data?

In a Lakebase Postgres database provisioned for it inside the Databricks workspace. The app reads analytical data through a SQL warehouse under Unity Catalog grants and writes its own records, such as submissions, approvals and state, to Lakebase, where Postgres roles and grants decide access.

Which Replit connector mode should a company choose?

A service principal suits a platform team building for others against a known set of tables, since one identity's grants become everyone's ceiling. The user-to-machine mode gives each builder their own Unity Catalog grants. Either way, check whose identity the deployed app uses to query before anyone else opens it.

Does the Replit integration work in a compliance-profile workspace?

No. Databricks' announcement of the integration says "Your Databricks workspace should be a standard workspace without a compliance security profile". A team on a HIPAA or PCI workspace would need a separate standard workspace for it.

What does a prompt-built app cost to run?

It needs a Replit Enterprise plan plus Databricks consumption for the SQL warehouse, the Databricks Apps compute while the app runs, and Lakebase, which scales to zero when idle. An office-hours app costs least with a short idle timeout, at the price of a slower first query each morning.