Running Fabric CA in a cluster with PostgreSQL or MySQL

A Fabric CA cluster lets several CA servers share one database behind a load balancer so identity issuance survives a server failure. This page covers the database, TLS, LDAP and upgrade choices that shape that design.

On this page

Why run Fabric CA as a cluster with a shared database

A single Fabric CA server is a single point of failure for enrollment and renewal. If it is down, new identities cannot enroll and existing ones cannot renew, so every peer, orderer and client certificate that comes due during the outage becomes a problem. Running several CA servers that share one database removes that single point of failure, provided the database itself is also made highly available. A cluster is several Fabric CA servers that all read and write one shared database holding identities and issued certificates, placed behind a load balancer such as HAProxy so clients reach whichever server is healthy. If LDAP is configured as the user registry, identity information lives in LDAP instead of the database, but the certificate records still need a shared store.

The default backend is SQLite, a file-based database that a single server owns, so a cluster is not possible until the backend changes. Teams need a cluster when enrollment or renewal has to survive a server failure, when certificate issuance is part of a routine process such as automated renewal, or when a CA must be patched without stopping enrollment. Before you commit, confirm the supported database versions (PostgreSQL 13 or later, or MySQL 8.0 or later, per the Fabric CA User's Guide), decide who operates the database, and confirm how that database is made highly available, because a clustered CA that depends on one database server still has a single point of failure.

Database and identity store options for a Fabric CA cluster

This table compares the database and identity store choices for Fabric CA: SQLite, PostgreSQL, MySQL and LDAP. Read each row against your planned number of CA servers, because only a shared database or LDAP allows several servers to run behind one load balancer. The main takeaway is that a cluster needs a supported external database or LDAP, and the version floors should be confirmed in the Fabric CA guide before you build.

OptionCluster supportWhen it fitsOperational trade-off
SQLite (default)Single CA server onlyTest networks, proofs of concept and single-server CAs with no high availability goalSimplest to run, but it cannot back a load-balanced group of CA servers
PostgreSQL 13 or laterYes, shared database for all CA serversOrganizations that already run supported PostgreSQL and want HA with TLS to the databaseNeeds a database HA design of its own, plus backups and version upgrades; confirm the current minimum in the Fabric CA guide
MySQL 8.0 or laterYes, shared database for all CA serversOrganizations standardized on MySQL with a tested HA and backup patternSame HA and backup duties as PostgreSQL; check the Fabric CA guide for current version and TLS settings
LDAP identity storeYes, identities held in LDAPOrganizations whose workforce directory is already the source of identityCertificates still need a database; LDAP changes affect enrollment, so plan directory ownership and access
PostgreSQL lines 14 to 18Supported lines per PostgreSQL policyChoosing a current major version for a new clusterConfirm which line your database team supports; older lines reach end of support on fixed dates

How to set up a clustered Fabric CA step by step

This sequence takes a single Fabric CA server to a cluster of CA servers that share one database, sit behind a load balancer and report healthy, so that an identity enrolled through any server is recognized by all of them.

  1. Confirm the database version and backend choice

    Before anything is installed, confirm that the database is PostgreSQL 13 or later or MySQL 8.0 or later, since those are the minimum versions for a Fabric CA cluster. Check the PostgreSQL support window as well, because PostgreSQL 14 reaches end of support on November 12, 2026, and a cluster built on an unsupported release will need a planned upgrade. Record the chosen version, the host or service endpoint, and the database name and owner the CA servers will use. You know this step is done when the team has a written version decision and the database accepts a test connection from the network segment where the CA servers will run.

  2. Provision the database TLS client certificate and key

    Create a client certificate and private key in PEM format for the CA servers to present to the database, and configure the database to require TLS for these connections. Fabric CA can connect to PostgreSQL over TLS using PEM-encoded client certificate and key files, so keep the key file readable only by the CA service account and store it with the other CA secrets. Ask the team that operates the database to confirm the certificate chain and the expiry date, and record both in the CA runbook. You know this step is done when a connection from one CA host succeeds with TLS verified and a connection without a valid client certificate is refused.

  3. Create a shared database schema for the CA cluster

    Create the empty database and role for Fabric CA and do not let any CA server initialize it independently. In a cluster, all CA servers share the same database for identities and certificates, so the first server to start creates the tables and the rest must use the same schema. Keep the database credentials and TLS file paths identical across servers so that no server has a different view of the data. You know this step is done when the database role can create and read the Fabric CA tables and a query from a second host returns the same empty schema.

  4. Configure each CA server to use the shared database

    On each CA server, set the database type, datasource and TLS options in the Fabric CA server configuration so that every instance points at the same PostgreSQL or MySQL endpoint. Keep the CA's signing key and root certificate material consistent across servers, because the servers must act as one CA. Start the first server, confirm that it initializes the schema, and then start the remaining servers one at a time. You know this step is done when every server starts without schema errors and the database shows one set of Fabric CA tables used by all of them.

  5. Place the load balancer in front of the CA servers

    Deploy HAProxy or another load balancer in front of the CA servers and configure it to forward CA API traffic to all healthy instances. Set the health check to the CA server's health endpoint so that an instance that cannot reach the database is removed from rotation. Because clients enroll with mutual TLS in many setups, confirm with the team that the load balancer passes TLS through or terminates it in a way the CA clients accept. You know this step is done when requests sent to the load balancer virtual address reach more than one CA server and a server stopped on purpose is taken out of rotation.

  6. Verify identities enrolled through one server are visible through another

    Register an identity and enroll it through one CA server, then run the same identity lookup or enrollment check against a different CA server directly and through the load balancer. The identity should appear on every server because they share one database, and certificates issued by one server should be visible in the same way. Record the test identity name and the servers used, and remove the test identity afterward. You know this step is done when the lookup returns the same identity and the same certificate status from each server, which confirms that the cluster behaves as one CA.

  7. Confirm health, version and metrics endpoints

    Check the operations endpoints on each CA server, including the health check, the version endpoint and the Prometheus metrics endpoint, and confirm that the monitoring system scrapes each instance. Operations endpoints for Fabric components are secured with mutual TLS client certificates, so verify that the monitoring client presents an approved certificate and that unauthorized requests are rejected. Record the expected responses so that alerts can be built against them. You know this step is done when every server returns a healthy status, reports the same version, and shows up in the metrics dashboard with its own labels.

How CA servers, load balancer and database fit together

The diagram starts with Fabric clients and peers sending enrollment and renewal requests to a load balancer, such as HAProxy, which spreads them across several Fabric CA servers. Every CA server reads and writes the same database for identities and certificates, and the connection to PostgreSQL or MySQL runs over TLS using a client certificate and key. If LDAP is the user registry, identity information lives in the directory instead, so check which store holds identities before you size the database. Confirm that all servers point to the same database and that the TLS connection is enforced.

Clustered Fabric CA servers share one database behind a load balancer.

Securing the database connection and CA keys

A clustered Fabric CA is only as trustworthy as the database holding its identities and certificates and the servers that answer for it. The cards below cover the database connection, the database account, the authentication method, the CA signing keys and the access paths into the cluster, which should be reviewed together before go-live.

TLS to the database

Each Fabric CA server in the cluster connects to PostgreSQL or MySQL over TLS, and for PostgreSQL the client certificate and key are supplied as PEM-encoded files. Confirm that the database server validates the CA server's client certificate, that the key file is readable only by the CA service account, and that certificate rotation is part of the operations runbook. A connection that is encrypted but never verifies the server identity still leaves the cluster exposed to interception on the database network.

Fabric CA user guide

Least-privilege database account

Give the Fabric CA servers a dedicated database role that owns only the schema and tables the CA needs, with no superuser rights and no access to other applications' databases. Separate the account used for routine CA operation from the one used for schema changes during upgrades. Ask your DBA to document who can read the identity and certificate tables, since those rows describe every enrolled identity in the network.

SCRAM instead of MD5

PostgreSQL documents several client authentication methods, including password, certificate, LDAP, GSSAPI and OAuth 2.0. Use SCRAM password authentication for the CA database role, and confirm that MD5 password authentication is not enabled for it. PostgreSQL 18 deprecated MD5 in favor of SCRAM, so a network that still relies on MD5 should plan the change before any major version upgrade. Also review the pg_hba.conf entries so only the CA servers' addresses can reach the database.

PostgreSQL authentication docs

Protecting CA signing keys separately

The CA signing keys are not stored in the database and need their own protection. Decide whether they stay as files with tight permissions on each CA host or move into an HSM through BCCSP and PKCS#11, which requires a custom Fabric CA build. Every CA server in the cluster must handle the same signing material consistently, so confirm how keys are distributed and who approves a change. Losing these keys means rebuilding trust for the whole network.

Load balancer and admin endpoint access

The load balancer, such as HAProxy, is the single entry point for enrollment and registration traffic, so restrict which networks can reach it and terminate or pass through TLS in a way your security team has approved. The Fabric CA administrative endpoints, including the registration and revocation calls, should be reachable only from administrator workstations or management networks, with the admin identities protected as privileged accounts. Log every administrative action and review the logs on a set schedule.

Connection pooling and database exposure

If the CA cluster opens many database connections through a pooler such as PgBouncer, the pooler becomes another component with credentials and network reach. Confirm that the pooler is placed inside the same trust boundary as the CA servers, that its client and server TLS settings are configured, and that it does not share a database role with other applications. Keep database ports off public and general office networks.

PgBouncer docs

What happens when a CA server or the database fails

A single Fabric CA server failing is the easy case. Because every CA in the cluster reads and writes the same database for identities and certificates, a replacement server pointed at that database can take over without re-enrolling identities. The database is the component that carries the state, so the failure plan has to focus on it. PostgreSQL does not detect a failed primary or promote a standby on its own. The PostgreSQL failover documentation is explicit that automatic failover needs external tooling, so your team must choose and operate that tooling, decide who is allowed to trigger a promotion, and confirm that the CA servers reconnect to the new primary without manual edits to their configuration.

The replication mode sets how much you can lose. With synchronous replication, a commit waits until the standby confirms it, so an acknowledged identity registration or revocation is on two servers, but a stalled standby can block CA writes. With asynchronous replication, the primary keeps accepting writes while the standby lags, which keeps the CA responsive but means the most recent changes can be lost if the primary fails before they reach the standby. Hot standbys can serve read-only queries, but Fabric CA's write path still depends on the primary. Decide which loss is acceptable for certificate issuance and revocation records, and test both the normal path and a promotion before go-live.

Replication is not a backup. A mistaken fabric-ca-server operation or a bad schema change replicates to the standby within seconds. Point-in-time recovery, built on base backups and archived write-ahead log, is the basis for restoring the CA database to a moment before the error. Confirm the archive location, retention period and restore procedure with your database team, and rehearse a restore into a separate environment, then start a CA server against the restored copy and check that enrollment and revocation behave as expected. The test should also confirm that revocation records restored from backup match what your CRLs and channel configurations already publish.

Limits to confirm in your environment

A clustered Fabric CA depends on a handful of assumptions about versions, identity stores, network behavior and database availability. Each card names one assumption, why it matters for the cluster, and what to confirm with your own test environment before production sign-off.

Fabric CA and database version match

A cluster must use PostgreSQL 13 or later or MySQL 8.0 or later, but the supported-version floor is only part of the check. Confirm that the Fabric CA release you plan to run is tested against your exact PostgreSQL or MySQL major version, and record that pairing in your change plan. Ask your database team which PostgreSQL major versions are still inside their support window, since PostgreSQL 14 support ends November 12, 2026.

Fabric CA docs

LDAP as the identity store

When LDAP is the user registry, identity information lives in the directory and not in the shared database, which changes where you look for enrollment failures. Confirm the bind account, search base, user and group attributes, and how the directory behaves during failover. Test enrollment against each CA node, because a misconfigured node may fail only under the load balancer's routing.

Load balancer session behavior

Several CA servers sit behind a load balancer such as HAProxy, so each request may reach a different node. Confirm that enrollment, renewal and revocation calls do not depend on session affinity, and that health checks mark a node down only when it cannot reach the database. Test a node failure in the middle of a bulk enrollment to see whether clients retry cleanly.

TLS to the database

Fabric CA can connect to PostgreSQL over TLS using PEM-encoded client certificate and key files, so the CA nodes hold a database client identity. Confirm who issues and renews that certificate, where the key file is stored and its file permissions, and whether the database server enforces certificate-based access. Rotation of this certificate is a recurring task that should appear in your operations calendar.

Connection pooling with PgBouncer

Several CA servers opening connections directly can exhaust PostgreSQL connection limits under peak enrollment. PgBouncer can pool connections in front of the database, but Fabric CA's compatibility with the pooling mode you choose is not something to assume. Confirm the pool mode, test the TLS path through the pooler, and verify that the pooler does not hide database failures from the CA nodes.

PgBouncer project

Database HA versus the availability target

Sharing one database across CA servers only makes the CA as available as that database. PostgreSQL does not detect a failed primary or promote a standby by itself, so automatic failover needs external tooling. Confirm whether your recovery time target and the failover method you use are documented and tested, including what happens to in-flight CA operations during a primary switch.

PostgreSQL failover docs

Questions teams ask before running a clustered Fabric CA

Can our own team run a clustered Fabric CA without outside help?

Yes, if you already run PostgreSQL or MySQL in production, operate a load balancer and have someone who owns your certificate policy. Fabric CA is a single product with documented settings for clustering, and the Fabric CA User's Guide describes the shared database and load balancer pattern in plain terms. The harder part is not the configuration file but the operational discipline around it: patching the database, rehearsing failover, rotating TLS material and keeping the CA identities consistent across servers. Teams without those habits usually find that the first failover test is where the gaps show. An outside partner is most useful when you want that test done and documented before go-live, or when the database and PKI skills sit in different teams that have never worked together on this system.

What drives the cost of a clustered Fabric CA project?

Cost follows the number of moving parts you must integrate and test. The main components are database setup and administration, the load balancer configuration, TLS between the CA servers and the database, LDAP integration if identities live in a directory, and failover testing. Each component adds design decisions, configuration work and verification. Costs recur in operations: database patching, certificate renewal for the database client credentials, LDAP account changes and periodic failover drills. When requesting a quote, ask the provider to list which of these are included, who owns the database and directory after handover, and what evidence of testing you will receive. A fixed-scope written agreement makes these boundaries visible before work starts.

Which PostgreSQL or MySQL versions can we use for a Fabric CA cluster?

The Fabric CA User's Guide requires PostgreSQL 13 or later, or MySQL 8.0 or later, for a cluster. Choose a version that is still supported at the time of go-live. The PostgreSQL versioning policy lists 14 as supported until November 12, 2026, and 15 until November 11, 2027, while 13 and earlier are unsupported. Plan the upgrade path when you choose: a Fabric CA cluster that depends on a database version approaching end of support creates a forced change later. Confirm the MySQL version your organization supports with your database team, since the Fabric CA guide sets only the minimum.

How long does it take to set up a clustered Fabric CA?

Duration depends mainly on how mature your existing database, load balancer and PKI practices are. If a PostgreSQL or MySQL service already exists with backups, monitoring and an approved TLS model, the Fabric CA work is mostly configuration, testing and documentation. If the database must be provisioned, or LDAP access needs new service accounts and network approvals, those approvals often take longer than the technical work. No duration figure is supplied for this topic, so ask any provider for a timeline built from a written scope, and ask which of your internal approvals the plan assumes will finish on time.

What do we need to provide from our database, network and PKI teams?

Three groups carry most of the dependencies. Your database owners must supply the server, the database and user for Fabric CA, backup and restore arrangements, and the TLS client certificate and key files for PEM-based connections. Your network team must allow the CA servers to reach the database and the load balancer, and must define the virtual address clients will use. Your PKI owners must decide the CA topology, approve the TLS material and agree how identities are registered, including whether LDAP is the user registry. Ask for these inputs in writing at the start, because missing one of them blocks the cluster at the point of first connection.

How do we test failover for a clustered Fabric CA?

Test each failure the cluster is meant to survive: one CA server stopping, the load balancer removing an unhealthy node, and a database failover. Fabric CA itself depends on the database, and PostgreSQL does not detect a primary failure or notify a standby on its own, so automatic failover needs external tooling that your team must select and test. Record which identities can still enroll during each drill, how long clients take to recover, and whether revocation and certificate renewal still work. Repeat the drills after each database or Fabric CA upgrade. Ask for test scripts and results as deliverables rather than a verbal statement that failover works.

When should we use LDAP as the identity store instead of the database?

Use LDAP when identities are already governed in a directory and you want one source of truth for who may enroll. The Fabric CA User's Guide states that when LDAP is configured, identity information is kept in LDAP instead of the shared database, so the database then holds certificates rather than identity records. This changes who administers accounts, how offboarding removes enrollment rights and which team must be involved when a service account password changes. Confirm with your directory owners how group membership maps to Fabric roles before you commit, because changing the identity store later is a larger project than the initial setup.

How DeployOpen scopes and delivers a clustered Fabric CA

DeployOpen plans, builds, documents and supports clustered Fabric CA deployments inside your own infrastructure, including the shared database, load balancer, TLS and identity store behind the CA servers. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

How we scope

  • Confirm the Fabric CA version, the database engine and version, and whether PostgreSQL 13 or later or MySQL 8.0 or later is already in use.
  • Record which CA servers, load balancer and database hosts will run in your data centers or cloud accounts, and who owns each.
  • Agree in writing whether LDAP is the identity store, and document the user registry and attribute mappings to be built.

How we build

  • Configure each CA server against the shared database with TLS client certificate and key files, and test the connection before go-live.
  • Set up the load balancer in front of the CA servers and verify failover behavior when one CA server is stopped during enrollment.
  • Test certificate issuance, renewal and revocation through the load balancer, and confirm CRL generation is consistent across all CA servers.

How we hand over

  • Deliver configuration files, database and TLS settings, and runbooks covering upgrades, database maintenance and CA server replacement.
  • Provide a backup and restore procedure for the database and CA key material, with a recorded restore test against your environment.
  • Walk your platform, security and compliance teams through the design, evidence and open items before the engagement closes.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover, scoped in writing.
  • Plan database major version upgrades and Fabric CA upgrades as separate, tested change windows agreed with your team.
  • Confirm with your database and identity teams who owns patching, monitoring and on-call for the CA cluster before go-live.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.