---
title: Serve lakehouse data
description: Sync a Unity Catalog table into Lakebase Postgres for low-latency reads, then join lakehouse analytics with operational data in one Postgres query.
canonical_url: https://docs.databricks.com/aws/en/oltp/projects/quickstart-synced-tables
---

# Serve lakehouse data

Sync a Unity Catalog table into Postgres and query it alongside your operational data.

**Steps:** ① [Create analytics data](https://docs.databricks.com/aws/en/oltp/projects/quickstart-synced-tables.md#step-1-create-analytics-data-in-unity-catalog) → ② [Sync to Lakebase](https://docs.databricks.com/aws/en/oltp/projects/quickstart-synced-tables.md#step-2-sync-the-table-to-lakebase) → ③ [Find your data in Postgres](https://docs.databricks.com/aws/en/oltp/projects/quickstart-synced-tables.md#step-3-find-your-data-in-postgres) → ④ [Query across both worlds](https://docs.databricks.com/aws/en/oltp/projects/quickstart-synced-tables.md#step-4-query-across-both-worlds)

> [!NOTE]
>
> This is a quickstart. For complete documentation, see [Sync tables](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md).

## Prerequisites

* Make sure you completed [Get a Postgres database](https://docs.databricks.com/aws/en/oltp/projects/get-started.md). You need a Lakebase project with sample data.
* A SQL warehouse or notebook for Unity Catalog queries.
* **USE\_SCHEMA** and **CREATE\_TABLE** on the schema where you'll create the synced table.

## <a id="step-1-create-analytics-data-in-unity-catalog" />Step 1: Create analytics data in Unity Catalog

Imagine your data team has built user segmentation scores in the lakehouse. In production, this is a gold table, ML output, or enriched dataset. For this guide, create a small sample.

In a SQL warehouse or notebook, run:

```sql title="Databricks SQL"
CREATE TABLE main.default.user_segments AS
SELECT * FROM (VALUES
  (1, 'power_user', 0.92),
  (2, 'casual', 0.35),
  (3, 'power_user', 0.88)
) AS segments(user_id, segment, engagement_score);
```

Notice the `user_id` values match the `id` column in your `playing_with_lakebase` table from get-started. That's intentional. You join them in Step 4.

Learn more: [Supported source types](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md#sources)

## <a id="step-2-sync-the-table-to-lakebase" />Step 2: Sync the table to Lakebase

In your Databricks workspace, go to **Catalog** in the sidebar. Select your `user_segments` table to open its details page, then click **Create** > **Synced table**.

In the **Create synced table** dialog, choose your Lakebase project's `databricks_postgres` database as the target and **Snapshot** as the sync mode. Snapshot copies the data once, which is the simplest option for getting started.

The sync runs automatically. When it completes, a new read-only table appears in your Lakebase database. The schema name from Unity Catalog becomes the Postgres schema name, and the table name gets a `_synced` suffix: `default.user_segments_synced`.

Learn more: [Create a synced table (full procedure)](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md#create-a-synced-table) | [Sync modes](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md#modes)

## <a id="step-3-find-your-data-in-postgres" />Step 3: Find your data in Postgres

Switch to the Lakebase SQL Editor. The analytics data from Unity Catalog is now queryable with standard Postgres SQL. Look for user `1`:

```sql title="PostgreSQL"
SELECT * FROM "default".user_segments_synced WHERE user_id = 1;
```

> [!NOTE]
>
> `default` must be quoted because it is a PostgreSQL reserved keyword. The synced table schema inherits the Unity Catalog schema name, so if your schema is named `default`, you must always quote it in queries.

You should see user `1` with segment `power_user` and an engagement score of `0.92`. This is the same row you created in Unity Catalog, now available in Postgres with low-latency reads.

Learn more: [Data type mapping](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md#data-types)

## <a id="step-4-query-across-both-worlds" />Step 4: Query across both worlds

Here's the payoff. Your `playing_with_lakebase` table has operational data. Your `user_segments_synced` table has lakehouse analytics. Join them:

```sql title="PostgreSQL"
SELECT
  p.id,
  p.name,
  p.value,
  s.segment,
  s.engagement_score
FROM playing_with_lakebase p
JOIN "default".user_segments_synced s ON p.id = s.user_id;
```

Your application can now serve enriched data. A single Postgres query combines what the app knows (names, values) with what the lakehouse computed (segments, scores). No API calls to the lakehouse, no sync scripts, no latency penalty.

Learn more: [Capacity planning](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md#capacity)

## Next steps

* **Keep data fresh:** Configure [Triggered or Continuous sync modes](https://docs.databricks.com/aws/en/oltp/projects/sync-tables.md#modes) for ongoing updates.
* **Build an app:** Use synced data in a [Databricks app](https://docs.databricks.com/aws/en/oltp/projects/databricks-apps.md) or [external application](https://docs.databricks.com/aws/en/oltp/projects/build-applications.md).
* **Explore Lakebase:** [Core concepts](https://docs.databricks.com/aws/en/oltp/projects/core-concepts.md) | [Lakebase](https://docs.databricks.com/aws/en/oltp/projects/index.md)
