yesterday
Hi Everyone, This is a follow up to a previous question I posted. We have a need for a number of apps that have a spreadsheet-like interface and read/write to our lakehouse. A common spec that comes up in these discussions is the need for managers to view who made what changes to the data and when. As in "if I hover over a cell can I see the last edit to the cell? When was it made, who made it, and what the change was?"
Is this possible for a dbx app, say using Streamlit and perhaps a Lakebase backend? Or is it just not doable currently?
yesterday
Hi dbernstein_tp,
yesterday
Hi @dbernstein_tp ,
Yes - this is doable in a Databricks App, but I donโt think there is currently a native โhover over any cell and Databricks automatically tells me who changed it, when, and from what valueโ capability. You would build that behavior into the app.
A Streamlit Databricks App can already read a Unity Catalog table, allow edits, and write them back. Databricks has an official example of exactly that pattern.
For the audit requirement, there are a couple of approaches:
1. Lakebase as the transactional backend - probably the cleanest approach for this type of app.
Lakebase now also has Change Data Feed, which captures every INSERT, UPDATE, and DELETE, including the before/after row state, transaction information, and timestamp, and writes the history into an immutable Delta table in Unity Catalog. Databricks explicitly lists audit history as a use case.
You would still need to capture the application user identity with each edit. That is important because an App using normal app authorization writes as its service principal, so otherwise every change can look like it came from the application rather than Alice/Bob/etc.
Databricks Apps now also support user authorization, where the app acts using the identity of the user interacting with it.
Then when the user hovers/clicks a cell, the UI looks up the most recent audit entry for that row + column. You could also expose the full change history.
2. Write directly to Delta.
Delta Change Data Feed can give you row-level "update_preimage" and "update_postimage" records plus commit version and timestamp. Delta table history can also tell you which identity performed each table write.
yesterday
Thank you both for those very quick and excellent responses. The hovering thing is just an example of the kind of question I get, probably not an exact spec. I would be happy if the audit trail can be displayed somehow in the app.
yesterday
You can store the trail in Lakebase and display it in app. Databricks App and Lakebase supports these cases.
yesterday
No problem @dbernstein_tp . Still, Iโd consider that very achievable with a Databricks App + Lakebase architecture.