Website Preloader

Getting started with Databricks Lakebase

Important (update 2026-02-16): Lakebase deployments are now supported in Databricks Asset bundles and this should be the prefered way of deploying Lakebase. Read more here. If you want to learn about uv and the Databricks-SDK, carry on reading!

—–

Introduction

Lakebase. You might or might not have heard of it, and you might or might not have laughed at its name when you first heard it foot-in-mouth. In this article, we’re here to help you get started and hit the ground running with your first Lakebase project, deployed with the Python SDK and uv.

As Lakebase is still a very new solution, we will gradually update this blogpost as new features and functionality become available. All sample code in this blogpost can be found on our Dtyped GitHub Lakebase repository, as well as a sample GitHub Actions CI/CD pipeline!

What is Lakebase exactly? 

The name alone raises some eyebrows. It sounds like a mashup, as if someone had taken the concept of a data lake and a relational database and tossed them in a blender. But what is it? Well, maybe that’s exactly what happened. To help understand what Lakebase is, we’ll take you on a very brief trip down memory lane. 

Neon

Just before the Lakebase announcement in 2025, Databricks had quietly acquired a company called Neon, a startup focused on serverless, scalable Postgres. Neon had built an architecture that allowed for instant branching of databases, near-zero latency and developer-first operations, ideal for modern applications and AI-driven environments. Neon’s philosophy fit neatly into Databricks’ vision and its technology provided the foundation for what would become Lakebase.

The issue with the Lakehouse

By now, we can all say the Lakehouse architecture was a breakthrough. By combining the scalability of data lakes with the reliability and governance of data warehouses, it gave organizations a unified platform for analytics and AI. With technologies like Delta, ACID guarantees and open formats, it solved many of the historical trade-offs between flexibility and structure.

But in today’s “AI” world, there is a catch.

The Lakehouse is fundamentally optimized for analytical (OLAP) workloads: aggregations, transformations and machine learning jobs. What it doesn’t natively optimize for is transactional (OLTP) workloads, i.e. the small, frequent, low-latency reads and writes that power operational applications. If you’re building a customer-facing app, a SaaS product, or an AI agent that needs to read, insert and/or update records in milliseconds, a Lakehouse architecture just isn’t the right tool for the job.

And the moment AI enters the picture, the gap becomes more painful. AI applications often need both worlds at once: transactional consistency and large-scale analytical context. And may we remind you that Databricks themselves have been advocating for Databricks to call it an “AI database”, as early as 2013-2016? Well, now it might just be! 

To keep things simple

Databricks took something we all knew, Postgres (OLTP), and plugged it into the Lakehouse, making transactional and analytical workloads neighbors rather than distant cousins. They call it Lakebase. Lakebase is not just an additional database layer. It acts as a bridge between the Databricks Lakehouse and a managed PostgreSQL instance through what Databricks calls synced tables. A synced table is essentially a Lakeflow pipeline under the hood. It continuously (or periodically) moves data from the Lakehouse into Postgres, either in streaming mode for near-real-time updates or on a scheduled snapshot basis. This way, you’re not required to build and maintain custom data movement pipelines yourself.

Provisioned vs. Autoscaling

There are 2 versions of Lakebase. One is called Provisioned and the other one is called Autoscaling. Trust us when we say (and we speak to Databricks on a daily basis): Provisioned will not be around for very long and most of the efforts are going into Autoscaling. Autoscaling is essentially what Neon stood for: serverless Postgres, scale-to-zero compute, instant branching, and elastic performance by default.

Setting up Lakebase

Using Python to define Lakebase assets lets you treat your data platform as infrastructure as code, keep deployments version-controlled, and integrate with CI/CD workflows. In the below guide, we will get you up and running with a Lakebase Autoscaling project using the official Databricks Python SDK. Ideally, we would want to use Terraform for this, but at this stage in time it is a better choice to use the SDK. 

What will we show in this blogpost?

Simple, 2 things:

  • How to use and set-up uv (a lightning fast Python package manager built in Rust, and the best practice at the moment).
  • How to build a Lakebase Python package and deploy a Lakebase project using the official Databricks SDK, including making it metadata driven. This way, you’re set up with a good cookie cutter template for all future Lakebase developments.

 

Limitations, principles & prerequisites

Usually, we put limitations at the end. But we want to be very blunt here: Lakebase is a new product and still has some serious limitations.

  • At the moment of writing (February 2026), Lakebase has just been made Generally Available on AWS.
  • This blogposts focusses on Azure Databricks, where Lakebase is still in Beta. Some features are even still in Private preview.
  • This blogpost will focus on the ‘Autoscaling’ version of Lakebase.
  • We will only deploy an Autoscaling project, this will set you up for all future enhancements and additions that the SDK will be enriched with in the near future. The Databricks SDK team is actively improving and adding functionality. 
  • Currently, you can not create synced tables in a standard Unity Catalog catalog using the SDK, Databricks mentioned it will be added to the SDK in a few weeks. You can however use the UI for this once you’ve set up your Autoscaling project. 
  • Lakebase is built on top of Databricks, so you need an active Databricks workspace to do the things in this blogpost.

Setting up uv

Before you start building a Lakebase instance, you’ll want a clean, reproducible Python environment. That’s where uv comes in.

uv is a fast Python package manager and virtual environment tool written in Rust. Think of it as a modern replacement for pip + venv, but significantly faster and simpler.

Please follow the official uv documentation on how to intall it.

Open up a terminal and follow the following steps:

  • run uv init
  • run uv venv

This will give you a main.py and pyproject.toml file.

  • create a folder called lakebase
  • in this folder, create a file callled __init__.py
  • move main.py to the lakebase folder.

Edit the pyproject.toml file and add the following:

What did we do here? In this project file, we’re turning internal Databricks deployment logic into a proper, installable Python package called lakebase.

Instead of using a legacy setup.py, we’re defining everything in pyproject.toml, the modern Python packaging standard. It holds:

  • Project metadata
    We define the package name, version, Python requirement (3.11+), and description.

  • Dependencies
    The package depends on:

    • databricks-sdk to interact with Databricks APIs

    • pyyaml to parse YAML configuration files

  • CLI entry point
    lakebase-deploy = “lakebase.cli:main”

    This creates a real command-line tool. After installation, users can run: lakebase-deploy

  • Build configuration
    The [build-system] section tells Python to use setuptools to build the package into a distributable wheel.

 

From the root, you should now be able to run: uv sync. This will install all the dependencies from your pyproject.toml in your Python virtual environment, as well as install your newly made Python package.

 

Time to start adding some Lakebase code

Add the following 2 files to the lakebase folder: cli.py and project.py.

We add two Python modules: cli.py and project.py  to turn our Package into a simple, reusable command-line driven project.

  • cli.py acts as the entry point: it defines a command-line interface so you (and CI/CD tools) can run a single command like uv run lakebase-deploy … to kick off the deployment logic.

  • project.py holds the core logic for our Lakebase project: it reads metadata (e.g. from YAML), constructs the necessary Python SDK objects, and defines how the Lakebase resources should be created and configured.
    Together, they make our deployment metadata-driven, repeatable, and easy to integrate into build pipelines.

Add the following content to the files respectively:

 

cli.py

project.py

Metadata

Remember we mentioned we’d make this deployment metadata driven? That’s where our yaml file comes in.
In the root, add a folder called metadata and add dev.yml. Add the following content (obviously, you can change the name of the Lakebase project):

dev.yml

 

Of course, now it only contains the project name, but you can enrich this file with things such as: compute min max, synced tables and their configurations, etc. 

Settings the Databricks auth & Deploying with uv

Before we can start deploying, we need to authorize with Databricks first. That’s because the Python SDK expects a `WorkspaceClient`, which requires the following: DATABRICKS_HOST and DATABRICKS_TOKEN. Obviously, in Production, you would want to use a service principal and not a PAT (or at least a PAT generated by a Service Principal).

Run the following commands in your terminal to get authenticated:

  • export DATABRICKS_HOST="<your Databricks workspace URL>"
  • export DATABRICKS_TOKEN="<your PAT token value>"

This sets so called “environment variables”, making sure the Python SDK automatically knows which workspace to authenticate to.

And that’s it, now you can run uv run lakebase-deploy --metadata metadata/dev.yml and your lakebase project will be deployed!

Good to know, if your auth is unsuccessful, this will return: ValueError: default auth: cannot configure default credentials, please check https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication to configure credentials for your preferred authentication method.

 

Conclusion & next steps

And that’s basically it. You’ve now set up a Lakebase project, using the official Python SDK and the best package manager in town: uv! Now that your project is set up, you can enrich your set-up with things such as:

  • Using the SDK to set and scale the compute
  • Creating Synced tables
  • And much more in the future (again, the automation-with-code part of Lakebase is still very limited at the moment) 

Please check out our Dtyped Lakebase GitHub repository we’ve created to go alongside this cookie cutte template. It also includes a sample GitHub actions pipeline to get you up and running with proper CI/CD.

Jaco