Skip to content
TechFabric

Gilbert Databricks User Group

Building applications on Lakebase: Postgres, Databricks Apps and AI in one place

Here are the slides.

  1. Slide 1: Building applications on Lakebase. The first session of the Gilbert Databricks User Group, on 18 September 2026 at the TechFabric office in Gilbert.

    Building applications on Lakebase

    The first session of the Gilbert Databricks User Group, on 18 September 2026 at the TechFabric office in Gilbert.

  2. Slide 2: Four things, live. The running order, each with the script that ran it: PostgreSQL with Databricks identity, safe branching and recovery, a secure Data API, and lakehouse and application data together.

    Four things, live

    The running order, each with the script that ran it: PostgreSQL with Databricks identity, safe branching and recovery, a secure Data API, and lakehouse and application data together.

  3. Slide 3: One database, two neighbourhoods. Lakebase is a managed Postgres inside a Databricks project. Applications connect to it as ordinary Postgres, Unity Catalog governs it, curated Delta snapshots land in a lakehouse schema, and every application write streams back out.

    One database, two neighbourhoods

    Lakebase is a managed Postgres inside a Databricks project. Applications connect to it as ordinary Postgres, Unity Catalog governs it, curated Delta snapshots land in a lakehouse schema, and every application write streams back out.

  4. Slide 4: PostgreSQL with Databricks identity. Section one of four. Existing tools connect unchanged, and tokens replace passwords.

    PostgreSQL with Databricks identity

    Section one of four. Existing tools connect unchanged, and tokens replace passwords.

  5. Slide 5: Where the password would have been. A workspace login through databricks psql and an application's client credentials mint the same thing, a one-hour OAuth token. Postgres sees a role, and ordinary GRANT decides the rest.

    Where the password would have been

    A workspace login through databricks psql and an application's client credentials mint the same thing, a one-hour OAuth token. Postgres sees a role, and ordinary GRANT decides the rest.

  6. Slide 6: Nothing to rewrite. It is ordinary PostgreSQL: foreign keys, check constraints, joins, and any client or ORM connecting unmodified. The project sets enable_pg_native_login to false, so there are no database passwords to rotate or to leak.

    Nothing to rewrite

    It is ordinary PostgreSQL: foreign keys, check constraints, joins, and any client or ORM connecting unmodified. The project sets enable_pg_native_login to false, so there are no database passwords to rotate or to leak.

  7. Slide 7: What scale-to-zero costs you. Measured on this project rather than read off a datasheet. The first query against an idle endpoint took 2,979 ms against 1,650 ms warm, so about 1.3 seconds of a cold query is the endpoint waking. Five idle minutes and it scales back to zero on its own.

    What scale-to-zero costs you

    Measured on this project rather than read off a datasheet. The first query against an idle endpoint took 2,979 ms against 1,650 ms warm, so about 1.3 seconds of a cold query is the endpoint waking. Five idle minutes and it scales back to zero on its own.

  8. Slide 8: Safe branching and recovery. Section two of four. An isolated copy in seconds, and a way back after a bad update.

    Safe branching and recovery

    Section two of four. An isolated copy in seconds, and a way back after a bad update.

  9. Slide 9: A database in four seconds. create-branch returned READY in 4.5 seconds with its own read-write endpoint. logical_size_bytes starts at zero because the pages are shared copy-on-write with the parent, so only the branch's own writes add bytes.

    A database in four seconds

    create-branch returned READY in 4.5 seconds with its own read-write endpoint. logical_size_bytes starts at zero because the pages are shared copy-on-write with the parent, so only the branch's own writes add bytes.

  10. Slide 10: The same question, two answers. One fingerprint query run against both branches after a schema change, a price change and a destructive DELETE on the branch alone. Production never saw any of it.

    The same question, two answers

    One fingerprint query run against both branches after a schema change, a price change and a destructive DELETE on the branch alone. Production never saw any of it.

  11. Slide 11: The UPDATE that lost its WHERE. Recovery is a branch at a timestamp. source_branch_time snaps to the last committed write at or before the moment you ask for, and source_branch_lsn is the exact alternative. Repairing from it is ordinary Postgres, a COPY out and an UPDATE ... FROM back in.

    The UPDATE that lost its WHERE

    Recovery is a branch at a timestamp. source_branch_time snaps to the last committed write at or before the moment you ask for, and source_branch_lsn is the exact alternative. Repairing from it is ordinary Postgres, a COPY out and an UPDATE ... FROM back in.

  12. Slide 12: What the script is honest about. history_retention_duration was seven days on this project, and past it there is no moment left to branch from. The repair assumes nothing else is writing, which is true of a demo and worth saying out loud before running the same shape against a live database.

    What the script is honest about

    history_retention_duration was seven days on this project, and past it there is no moment left to branch from. The repair assumes nothing else is writing, which is true of a demo and worth saying out loud before running the same shape against a live database.

  13. Slide 13: A secure Data API. Section three of four. REST over Postgres, with no API service to build and host.

    A secure Data API

    Section three of four. REST over Postgres, with no API service to build and host.

  14. Slide 14: From the browser to the policy. The only server-side code is the token exchange, and the browser never holds the secret. Because the Data API runs each request as the caller's identity, GRANT and row-level security are the whole authorization model.

    From the browser to the policy

    The only server-side code is the token exchange, and the browser never holds the secret. Because the Data API runs each request as the caller's identity, GRANT and row-level security are the whole authorization model.

  15. Slide 15: The URL is the query. Filter and order are query parameters, foreign keys come back as embedded objects with no join written anywhere, counts and pagination are headers, and a write is a POST to the same URL. Responses ran 384 to 542 ms.

    The URL is the query

    Filter and order are query parameters, foreign keys come back as embedded objects with no join written anywhere, counts and pagination are headers, and a write is a POST to the same URL. Responses ran 384 to 542 ms.

  16. Slide 16: One policy, three answers. One row-level security policy on demo_app.orders, tested against the role each token became. The owner sees every status over psql, the service principal gets an empty array for rows it may not read, and posting a cancelled order comes back 403 with 42501, because the policy refuses to create what it would hide.

    One policy, three answers

    One row-level security policy on demo_app.orders, tested against the role each token became. The owner sees every status over psql, the service principal gets an empty array for rows it may not read, and posting a cancelled order comes back 403 with 42501, because the policy refuses to create what it would hide.

  17. Slide 17: Lakehouse and application data together. Section four of four. One governance model over Delta and Postgres, and traffic both ways.

    Lakehouse and application data together

    Section four of four. One governance model over Delta and Postgres, and traffic both ways.

  18. Slide 18: In as a snapshot, out as history. Two managed pipelines and no reverse-ETL code. The synced copy lives in its own lakehouse schema so the change feed on demo_app does not replicate straight back out, and application writes reach Delta in 10 to 15 seconds.

    In as a snapshot, out as history

    Two managed pipelines and no reverse-ETL code. The synced copy lives in its own lakehouse schema so the change feed on demo_app does not replicate straight back out, and application writes reach Delta in 10 to 15 seconds.

  19. Slide 19: Registered, then synced. postgres create-catalog took 5.7 seconds and makes the database a Unity Catalog catalog, with a SQL warehouse reading live Postgres rows in place and no copy. create-synced-table in SNAPSHOT mode was online 51 seconds after the call, and a re-snapshot runs about 33 seconds.

    Registered, then synced

    postgres create-catalog took 5.7 seconds and makes the database a Unity Catalog catalog, with a SQL warehouse reading live Postgres rows in place and no copy. create-synced-table in SNAPSHOT mode was online 51 seconds after the call, and a re-snapshot runs about 33 seconds.

  20. Slide 20: Every write is a Delta record. One order's insert, update and delete as they land in the change data feed, with the transaction id on every row. REPLICA IDENTITY FULL has to be set before the feed is enabled, because a table without it is SKIPPED and flipping it afterwards is not reliably picked up.

    Every write is a Delta record

    One order's insert, update and delete as they land in the change data feed, with the transaction id on every row. REPLICA IDENTITY FULL has to be set before the feed is enabled, because a table without it is SKIPPED and flipping it afterwards is not reliably picked up.

  21. Slide 21: Questions. Where the session ended, and where the group picks up: the Gilbert Databricks User Group meets at the TechFabric office in Gilbert.

    Questions

    Where the session ended, and where the group picks up: the Gilbert Databricks User Group meets at the TechFabric office in Gilbert.

Slide 1 of 21

Build this with us

The session came out of work we do for clients. If any of it maps onto something you are deciding, these are the places to start.

Databricks consulting

Unity Catalog, Lakeflow, Databricks Apps and Lakebase, built by engineers who work on them daily.

What we do on Databricks

The Field Guide

The manual our engineers work from, including the chapters behind this talk. Free to read.

Read the Field Guide

The next session

Gilbert Databricks User Group meets at our office in Gilbert. Free, and listed here before it happens.

Upcoming events