Fabric HorizonDB: PostgreSQL inside Fabric, explained

Fabric HorizonDB (preview) is a managed PostgreSQL database that lives in a Fabric workspace, scales its compute by itself and can pause when idle. How it connects to analytics in three directions (mirroring to OneLake, federated queries into Fabric, Copy job back into PostgreSQL), a worked example with SQL, the preview limits that matter (only the creator can connect), and when to use it.

Short answer: Fabric HorizonDB (in public preview) is a managed PostgreSQL database created as a Fabric item (+ New item, HorizonDB database (preview)). Applications connect through the normal PostgreSQL protocol; Fabric manages compute, storage and maintenance, scales compute automatically, and can pause an idle database and resume it on the next connection. Its value for data teams is Federated Analytics: mirroring copies eligible tables into OneLake with a read-only SQL analytics endpoint, federated queries let PostgreSQL read Fabric warehouse and lakehouse data through pg_fabric_fdw, and Copy jobs load analytical results back into PostgreSQL. In the preview, only the Entra identity that created the database can connect.

The classic split: the app writes orders to PostgreSQL, a nightly job copies them to the warehouse, data science calculates a churn risk per customer, and another job copies the scores back so the app can show them. Two copy pipelines, two schedules, two places that break. HorizonDB puts the operational database inside Fabric so those paths are built in.

How does data move between the app and analytics?

  1. 1
    App writesorders and customers in HorizonDB, through the PostgreSQL endpoint
  2. 2
    Mirroringeligible tables copied to OneLake, changes applied asynchronously
  3. 3
    Analyticsnotebooks or the warehouse calculate a risk score per customer
  4. 4
    Federated query or Copy jobthe app reads the scores live, or loads them into PostgreSQL
Three directions between HorizonDB and Fabric
PathDirectionRows liveUse when
MirroringHorizonDB to OneLakein OneLake, read-only copyreports and models must not query the app database
Federated queryFabric into a PostgreSQL querystay in Fabrica selective, current lookup, no local copy needed
Copy job (data delivery)Fabric into PostgreSQL tablesin PostgreSQLthe app reads the same result often and needs indexes and fast replies
Which path for which need

What does a federated query look like?

The pg_fabric_fdw extension is installed and managed by the service. You import the remote tables as foreign tables (metadata only, no rows copied), then query them like local ones:

CREATE SCHEMA IF NOT EXISTS fabric_sales;

IMPORT FOREIGN SCHEMA dbo
    LIMIT TO (customer_signals)
    FROM SERVER customer_signals_dw
    INTO fabric_sales;

SELECT c.customer_id, c.customer_name, s.risk_score
FROM app.customers AS c
JOIN fabric_sales.customer_signals AS s
  ON s.customer_id = c.customer_id
WHERE s.risk_score >= 70
ORDER BY s.risk_score DESC
LIMIT 20;

Here customer_signals_dw is a foreign server you registered for the warehouse that holds the scores; the built-in server fabric_dw points at the database's own mirrored SQL analytics endpoint. Run EXPLAIN (VERBOSE) and read the Fabric SQL line to see which filters, joins and aggregates run in Fabric instead of pulling rows back.

Do the numbers add up?

Five customers in the app, risk scores calculated in Fabric:

customer_idLocal in HorizonDBrisk_score from FabricReturned (score 70 or more)
C-01yes82yes
C-02yes45no
C-03yes70yes
C-04yes91yes
C-05yes12no
Result5 customers3 rows: C-04, C-01, C-03
The join above, row by row

Three customers pass the filter, sorted by score: 91, 82, 70. If the warehouse is unreachable, this query fails while plain queries on app.customers keep working; federation adds a runtime dependency.

What are the preview limits that matter?

  • One identity. Only the Entra identity that created the database can connect. Other users, groups, service principals and managed identities cannot, and sharing the item does not change that. Plan pilots around one owner.
  • No PostgreSQL role management. You cannot create users or roles, and per-table permissions are not available.
  • No version choice. The service picks and maintains the PostgreSQL version; there is no superuser, host or file system access, and only documented extensions.
  • Pause and resume. After an idle pause, the next connection resumes it, with startup delay and no published guarantee. Sessions, temporary tables and prepared statements may not survive; clients should retry with backoff.
  • Mirroring is asynchronous. A committed transaction appears in the app before it appears in OneLake, with no published freshness guarantee. Give reports a "data as of" timestamp.
  • Use test data. Microsoft's own guidance for the preview: a dedicated test workspace and synthetic, nonsensitive data.

When should you use it?

Good fit nowa new app or prototype whose data feeds Fabric reports; one team, one owner, test data
Not yetproduction with many users and service identities, strict role design, or a pinned PostgreSQL version
Fabric HorizonDB or another PostgreSQL

Until the preview limits lift, keep production on the PostgreSQL service you run today and use HorizonDB for a pilot, so the move is easy once it is generally available.

What goes wrong?

  • Connecting the app to the SQL analytics endpoint. It is a read-only analytical copy. Applications use the PostgreSQL endpoint.
  • Running CREATE EXTENSION. Extensions are service-managed; check pg_extension instead.
  • Broad federated scans. A query that pulls a whole warehouse table into PostgreSQL is slow and may be rejected by a planning guardrail. Filter first.
  • Tables without primary keys. Mirroring needs a stable key on tables meant for analytics.
  • Assuming the database's health covers mirroring. The database, mirroring, federation and Copy jobs each have their own health.

Where can you check this?

Where do you start?

Create a HorizonDB database in a test workspace, load a few thousand synthetic orders, wait for mirroring to finish, and build one Power BI report on the mirrored endpoint. Then score something in a notebook and read it back with a federated query. Database Hub shows the new database next to the rest of your estate, and What is OneLake? explains where the mirrored copy lands.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.