On this page
Last week I wrote about choosing between Azure HorizonDB and Azure Database for PostgreSQL flexible server after HorizonDB reached general availability at Ignite. That article measured HorizonDB alone. This one puts the two services side by side: the same PostgreSQL version, the same table, the same 100,000 vectors, the same queries, and a client that keeps writing while each service fails over.
The short version. On vector search the two are the same engine and behave the same, to within a fraction of a millisecond. The difference is in what happens when a node dies: the HorizonDB client lost 9 to 10 seconds of writes, the flexible server client 34 to 37. HorizonDB costs about 56 percent more per vCore than a flexible server with the same memory, and getting a cluster running from the command line takes several steps the documentation does not mention.

Test Setup
Both databases ran in Sweden Central with high availability across zones and two vCores per node. The client was Azure Cloud Shell in West Europe, about 25 ms away, which is why every client-side latency in this article starts at 25 ms. Server-side times come from EXPLAIN ANALYZE and leave the network out.
| Flexible server | HorizonDB | |
|---|---|---|
| Configuration | General Purpose D2ds_v5 (2 vCores, 8 GiB) with a zone-redundant standby | One pool, 2 nodes of 2 vCores and 16 GiB, zone-redundant |
| Engine | PostgreSQL 17.11 | PostgreSQL 17.11 (HorizonDB build) |
| pgvector / pg_diskann | 0.8.7 / 0.6.6 | 0.8.7 / 0.7.6 |
max_connections | 859 | 128 |
shared_buffers | 2 GB | 9.4 GB |
maintenance_work_mem | 211 MB | 128 MB |
| Time to ready | Under 18 minutes, standby included | Cluster in 10 minutes or less, then the pool in 8 or less |
| Round trip from the client | 24.6 ms median | 25.2 ms median |
The two are not memory-equal: a HorizonDB vCore comes with 8 GiB, a General Purpose flexible server vCore with 4. On a 159 MB table that made no difference to query times, and the cost section compares against the memory-optimized tier where it does matter. The low max_connections on HorizonDB is worth planning for, because built-in PgBouncer is one of the things the service does not have yet.
Sign-in on both used Microsoft Entra ID with a short-lived token, so the test involved no database passwords at all.
Provisioning from the Command Line
The portal creates a usable HorizonDB cluster in one form. The command line does not, and the gaps are instructive about how the service is put together.
| Step | Flexible server | HorizonDB |
|---|---|---|
| Create | One command creates server, storage, standby and sign-in | The cluster command creates no compute, no sign-in method and public access disabled |
| Compute | Part of create | A separate pool; the command fails until a processor type and a compute generation number are supplied, neither marked as required in its help |
| Entra sign-in | Flags on create, then one command to add an administrator | No command; two calls to the management API |
| Endpoint host name | Derived from the server name | Not returned by the API or the CLI; read from the portal overview page |
| Extension allow list | One parameter update, under two minutes | A parameter group created and applied to the pool, 3 minutes 13 seconds |
| Failover | A CLI command | The portal only, with the CLI extension I had |
The Entra part is the one most likely to stop an automated deployment. With the CLI extension current at the time, enabling it took two requests against API version 2026-10-01-preview:
HID=$(az horizondb cluster show -g "$RG" -n "$CLUSTER" --query id -o tsv)
OID=$(az ad signed-in-user show --query id -o tsv)
TID=$(az account show --query tenantId -o tsv)
az rest --method put \
--url "$HID/authentications/microsoftEntra?api-version=2026-10-01-preview" \
--body '{"properties":{"state":"Enabled"}}'
az rest --method put \
--url "$HID/microsoftEntraAdministrators/$OID?api-version=2026-10-01-preview" \
--body "{\"properties\":{\"principalName\":\"labadmin\",\"principalType\":\"User\",\"tenantId\":\"$TID\"}}"
# The access token is the password; it is the same token for both services.
export PGPASSWORD=$(az account get-access-token --resource-type oss-rdbms --query accessToken -o tsv)Until the administrator exists, the login fails with “password authentication failed”, which says nothing about Entra. Two smaller things cost me a failed command each. On the flexible server, --high-availability ZoneRedundant is no longer accepted and the flag is now --zonal-resiliency Enabled. On HorizonDB, CREATE EXTENSION vector still fails with an allow-list error that names “Azure Database for PostgreSQL”, as it did a week ago.
Vector Search with HNSW
The table holds 100,000 rows with a 384-dimension embedding and a tenant column with 50 values. The script builds the same HNSW index on both (m = 16, ef_construction = 64), then runs 200 queries for the 10 nearest neighbours and compares each result with an exact scan.
Unfiltered, hnsw.ef_search | Flexible: recall | Flexible: server median | HorizonDB: recall | HorizonDB: server median |
|---|---|---|---|---|
| 40 | 0.988 | 0.73 ms | 0.978 | 0.63 ms |
| 100 | 0.993 | 1.10 ms | 0.983 | 1.01 ms |
| 400 | 0.993 | 2.15 ms | 0.988 | 1.77 ms |
Index build took 29.4 seconds on the flexible server and 21.9 on HorizonDB, for a 195 MB index on each. The small recall difference is the two HNSW graphs being built independently, not a property of either service. HorizonDB was 10 to 20 percent faster on the server side in every row, which amounts to a tenth to a third of a millisecond and disappears behind a 25 ms round trip. With one run of each, I read these as “the same”.
Add a tenant filter and both show the behaviour that catches most teams once:
One tenant of 50, ef_search 40 | Rows returned (asked for 10) | Recall | Server median |
|---|---|---|---|
| Flexible, iterative scan off | 0.9 | 0.089 | 0.75 ms |
| HorizonDB, iterative scan off | 0.9 | 0.088 | 0.66 ms |
Flexible, relaxed_order | 10 | 0.992 | 3.09 ms |
HorizonDB, relaxed_order | 10 | 0.985 | 2.60 ms |
With a selective filter and iterative scans off, the index returns its nearest candidates and the filter then discards most of them. A query for 10 rows returned fewer than one on average, on both services, with no error. Set hnsw.iterative_scan to relaxed_order (pgvector 0.8 or later) for filtered queries, and test with your real filter selectivity.
Vector Search with DiskANN
Both services ship Microsoft’s pg_diskann, and here the versions differ. The flexible server had 0.6.6, with two settings. HorizonDB had 0.7.6, with a dozen or more, among them a filter hook and selectivity thresholds for filter-aware search.
| Flexible server | HorizonDB | |
|---|---|---|
| Index build (178 MB) | 21.8 s | 33.6 s |
| Unfiltered, search list 40: recall / server median | 1.000 / 0.84 ms | 1.000 / 1.00 ms |
| Unfiltered, search list 400 | 1.000 / 2.36 ms | 1.000 / 2.50 ms |
| One tenant of 50, search list 40 | 10 rows, 0.999, 3.32 ms | 10 rows, 1.000, 3.43 ms |
| Plan for the filtered query | Index scan with iterative search | Custom scan (filter-aware DiskANN) |
DiskANN returned all 10 rows under the tenant filter on both services without any setting changed, because its iterative search is on by default. The newer extension on HorizonDB planned the filtered query differently and produced the same answer in about the same time. A 2 percent filter over 100,000 rows may be too easy to separate the two approaches; I would expect a gap to appear, if it does, at millions of rows and tighter filters, and I did not test that.
Build times went the other way from HNSW: the flexible server was faster here. Taken together, the two index builds say the services are comparable at this size and nothing more.
Failover from the Client
This is where the architectures differ. A flexible server standby is a second PostgreSQL server kept current by synchronous replication, and failover promotes it. HorizonDB nodes share a zone-redundant log and storage service; the documentation says a replica does not receive the log from the primary, so a promoted node has no replay backlog of its own.
The probe is a loop that commits one small insert every 250 ms, with a 3-second connect timeout and no pooling, and logs how long it went without a successful write.
while time.time() < end:
tick = time.time()
try:
if conn is None or conn.closed:
conn = connect(target, timeout=3)
n += 1
conn.execute("insert into lab_probe (n) values (%s)", (n,)) # autocommit: one committed write
if outage_started is not None:
outages.append(time.time() - last_ok) # the gap a client actually saw
outage_started, failures = None, 0
last_ok = time.time()
except Exception as error:
failures += 1
outage_started = outage_started or time.time()
try:
if conn is not None:
conn.close()
except Exception:
pass
conn = None # reconnect through the same endpoint
time.sleep(max(0.0, 0.25 - (time.time() - tick)))That is the core of the function in the sample with its logging removed.
| Run | No successful write for | Failed attempts | Management operation |
|---|---|---|---|
| Flexible server, forced | 37.3 s | 81 | 5 min 13 s |
| Flexible server, forced | 36.7 s | 74 | 5 min 11 s |
| Flexible server, planned | 34.4 s | 56 | 5 min 10 s |
| HorizonDB | 9.9 s | 16 | More than a minute |
| HorizonDB | 8.7 s | 12 | Not timed |
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF3E0','primaryTextColor':'#232F3E','primaryBorderColor':'#FF9900','lineColor':'#232F3E','signalColor':'#0073BB','signalTextColor':'#0F172A','actorBkg':'#FFF3E0','actorBorder':'#FF9900','actorTextColor':'#232F3E','noteBkgColor':'#FFF8E7','noteBorderColor':'#FF9900','noteTextColor':'#232F3E'}}}%%
sequenceDiagram
participant C as Client (write every 250 ms)
participant E as Read-write endpoint
participant N as New primary
C->>E: INSERT, committed
Note over E: Failover starts
C-xE: Connection dropped (SSL EOF)
C-xE: Reconnect refused or timed out
Note over N: Standby promoted, endpoint moved
C->>E: Reconnect
E->>N: Routed to the new primary
N-->>C: INSERT, committed
Note over C: Gap: 9 to 10 s HorizonDB, 34 to 37 s flexible server
On both services the connection string did not change, the client reconnected through the same host name, and no acknowledged write was lost: every row the probe had been told was committed was there afterwards, and the only missing sequence numbers were attempts that had failed. That matches what both sets of documentation promise.
Three observations from the runs:
- Planned was not gentler than forced on the flexible server. The planned failover cost 34.4 seconds of writes against 36.7 and 37.3 for forced. A maintenance window is a 35-second outage for writers either way.
- The management operation is not the outage. The flexible server command took over five minutes to return each time, while the client was writing again after 37 seconds. The HorizonDB failover page makes the same point and tells you to measure from the application. Do that, and do not put the portal’s duration in a recovery-time report.
- HorizonDB offered one kind of failover. The documentation describes planned and forced operations. The portal dialog I got had a single action, “Fail over to standby node”, described as stopping the read-write node immediately.
Neither service hides a failover from the application. For 9 seconds or for 37, every write fails, first with a dropped connection and then with refused or timed-out reconnects. A client without retry and backoff turns that into user-visible errors on either service; the faster failover only shortens the window.
Cost
List prices for Sweden Central in euro, from Microsoft’s Retail Prices API. HorizonDB is pay-as-you-go only.
| Meter | Flexible server | HorizonDB |
|---|---|---|
| Compute per vCore-hour | 0.0852 General Purpose (4 GiB per vCore); 0.1171 Memory Optimized (8 GiB per vCore) | 0.1832 (8 GiB per vCore) |
| Storage per GB-month | 0.1248, provisioned | 0.2357, used |
| Backup per GB-month | 0.0939 (locally redundant) | 0.1085 |
| The test configuration, compute per hour | 0.34 (2 x 2 vCores, General Purpose) | 0.73 (2 x 2 vCores) |
| The same per 730-hour month | About 249 | About 535 |
Per vCore with the same memory, HorizonDB is about 56 percent more than the memory-optimized flexible server. Against the General Purpose tier I actually ran, it is a little over twice the price, for twice the memory. Storage is nearly double per gigabyte, though HorizonDB bills what is used and the flexible server bills what is provisioned, so a half-empty disk narrows the gap.
Two structural points matter more than the rates. A flexible server standby is paid for and does nothing but wait; a HorizonDB second node also serves reads through the read-only endpoint, so the high-availability premium buys read capacity. And HorizonDB scales readers to 15 nodes on the same storage, where the flexible server needs read replicas with their own storage and replication lag. If the workload has read traffic to move, some of that 56 percent comes back.
The price list also carries HorizonDB meters named “1 vCore Free Tier” and “Storage – Free Tier” at zero. I found no page describing a free tier and did not try to create one.
Decision Guidance
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF3E0','primaryTextColor':'#232F3E','primaryBorderColor':'#FF9900','lineColor':'#232F3E','clusterBkg':'#F8FAFC','clusterBorder':'#CBD5E1','edgeLabelBackground':'#FFFFFF','nodeTextColor':'#232F3E'}}}%%
flowchart TD
A["PostgreSQL workload on Azure"] --> B{"Is a 35-second write outage
during failover acceptable?"}
B -->|No| C["HorizonDB:
about 10 s in this test"]
B -->|Yes| D{"Need VNet injection, PgBouncer,
or a region HorizonDB lacks?"}
D -->|Yes| E["Flexible server"]
D -->|No| F{"Read traffic that a second
node could serve?"}
F -->|Yes| C
F -->|No| G["Flexible server:
lower cost for the same engine"]
C --> H["Budget 128 connections per 2 vCores
and an external pooler"]
classDef compute fill:#FFF3E0,stroke:#FF9900,stroke-width:2px,color:#232F3E
classDef db fill:#EBF8FF,stroke:#0073BB,stroke-width:2px,color:#004C74
classDef store fill:#F0FFF4,stroke:#1D8102,stroke-width:2px,color:#145202
classDef mesh fill:#F3E8FF,stroke:#7C3AED,stroke-width:2px,color:#4C1D95
class A,B,D,F compute
class C,H db
class E,G store
- Vector search is not the deciding factor. Same pgvector, near-identical results. Choose on availability, read scaling, networking and cost.
- Failover time is. If the recovery-time target for writes is under 30 seconds, the flexible server did not meet it in three attempts and HorizonDB met it twice.
- Connections need a plan on HorizonDB. 128 on a 2-vCore node, and no built-in pooler. Put PgBouncer or an application-side pool in the design from the start.
- Automate HorizonDB with the management API in mind. The CLI did not cover sign-in, endpoints or failover. Expect to call the API directly, and to revisit the scripts as the extension catches up.
- Keep the filtered-search setting in the migration checklist. It is the same trap on both, so it moves with the application.
Recommendation
For a new system where write availability matters and the region list fits, I would now start with HorizonDB: the failover result is a real, repeatable difference, and the second node earns part of its cost by serving reads. For an existing flexible server that meets its recovery target, there is no query-performance reason to move, and the price and tooling say wait. In both cases, measure failover yourself with a writing client before putting a number in a design document; the figure on the portal is not the one your users will see.
A note on testing: I ran everything from Azure Cloud Shell in West Europe against two databases in Sweden Central, each with two vCores per node and high availability across zones. The data set is synthetic: 100,000 vectors with 384 dimensions, built from a 16-dimension mixture so that neighbours have structure, and 200 queries from the same distribution. Query results are from one run on each service; failover was run twice on HorizonDB, and on the flexible server twice forced and once planned. Two faults of my own cost a rerun each. The first query run reported perfect recall because the Python driver had prepared the statement while index scans were disabled, and the cached plan was reused. My first vectors had noise in every dimension, which gave HNSW a recall of 0.2 to 0.4 that described the data and not the databases. Both are fixed in the sample. I did not test larger data, concurrency, write throughput, read scaling on the second node, a zone outage (a requested failover is not one), a HorizonDB planned failover, Private Link, restore, or the free tier meters. Prices are list prices from the Retail Prices API and not from an invoice. Host names, subscription and tenant identifiers are left out, and the resource group was deleted afterwards.
The complete sample for this article is on GitHub: nithinmohantk/blog-samples-working-repo/horizondb-vs-flexible-server-tested. Clone it with git clone https://github.com/nithinmohantk/blog-samples-working-repo.git and open the horizondb-vs-flexible-server-tested folder. Its README says how to run it and what has been verified.
References & Further Reading
- → What is Azure HorizonDB?— Microsoft Learn: architecture, limits and regions
- → High availability and failover concepts in Azure HorizonDB— Shared log and storage, failover types, client guidance
- → Perform failover in Azure HorizonDB— Portal steps and the advice to measure from the application
- → Azure HorizonDB— Product and pricing page
- → What’s new in databases at Microsoft Ignite 2026— Microsoft’s summary of the database announcements
- → Sample code for this article— The lab script and its recorded output
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.