Running Medplum across availability zones for high availability

Running self-hosted Medplum across availability zones means designing app servers, PostgreSQL, Redis and the load balancer so one zone can fail without stopping clinical work. This page explains the design choices, failover behavior and what to confirm.

On this page

Running Medplum across availability zones for high availability: when a single zone is not enough

A multi-AZ design keeps a self-hosted Medplum running when one availability zone fails, but only if every stateful and stateless tier is spread across zones and the failover path has been tested. For a clinical or regulated team that already runs Medplum in its own cloud account, the work is to remove the single points of failure inside one region: the application servers, the PostgreSQL database that holds the FHIR data, and the Redis cache. The design covers three layers. The stateless app tier runs several Medplum server instances in at least two zones behind a load balancer that health-checks them. The managed PostgreSQL database runs a synchronous standby in a second zone and, where the workload is read-heavy, one or more readers. Redis runs with a replica in another zone so that cache loss does not stall sign-in or search. Medplum's self-hosting docs recommend AWS with CDK and CloudFormation, and the layout described here applies to that route and to equivalent setups on other clouds or Kubernetes.

A multi-AZ design does not protect against loss of a whole region, a bad deployment that corrupts data, an operator who deletes the wrong project, or a ransomware event that reaches the database. Those belong to backup, point-in-time recovery and disaster recovery planning, which are covered in sibling sections. Treat the multi-AZ setup as a way to absorb a zone outage with minimal disruption, and ask your team to confirm the exact recovery behavior of each managed service in your region, since failover timing and whether connections drop depend on the product and its settings. Also confirm that Medplum's server version you run supports the topology you choose, because upgrades must follow the documented minor version sequence in the Medplum upgrading guide.

Before go-live, the decisions that matter most are where each tier's replicas sit, how many app instances you need to keep headroom when one zone is gone, and how application connections to the database are pooled during a failover. Ask your platform team to write down, for each component, what the reader sees during a zone loss, what alarms fire, and who acts. Then run a planned failover in a non-production environment and measure how long sign-in, FHIR reads and writes, and Bot executions take to recover. The results decide whether the design is adequate for your clinical service levels, which your own owners set and document, not a figure this page can supply.

Request and failover flow across two or more availability zones

A client request enters through a load balancer that spans zones, then reaches a Medplum app server in whichever zone is healthy. Each app server reads and writes to the primary PostgreSQL instance, while readers serve read traffic and a standby in another zone takes over if the primary's zone fails. Redis runs with its own redundancy, so cache loss does not take the app tier down. Check that the client network boundary sits in front of the load balancer and that every hand-off crosses zones.

Traffic flows from the client network through a zone-spanning load balancer to app servers, database and cache in two zones.

Configuration options for each tier and when each fits

This table compares the placement, load balancing, database and cache choices for a multi-AZ Medplum deployment, with the trade-off each carries. Read each row as a decision: pick the option that matches your recovery target, budget and team's operating capacity, then confirm the behavior against the Medplum version you run.

Tier and decisionOptionTrade-offWhen it fits
App server placementReplicas spread across at least two AZsSurvives one AZ loss; needs cross-AZ traffic and matching capacity in each zoneAny production deployment that must ride out a single AZ failure
App server placementAll replicas in one AZLowest network cost and simplest setup; an AZ outage takes the API downNon-production or internal environments where downtime is acceptable
Load balancer typeManaged application load balancer spanning AZsHealth-checked failover handled by the provider; less control over TLS and routing detailMost AWS deployments already using the CDK reference stack
Load balancer typeSelf-managed proxy in front of app serversFull routing control; you own its own redundancy, patching and failoverTeams with existing ingress standards or non-AWS clouds
PostgreSQL standbySynchronous standby in a second AZLowest data loss on failover; each write waits for the standby, adding latencyStrict recovery point targets for clinical records
PostgreSQL standbyAsynchronous standby in a second AZFaster writes; committed transactions can be lost during failoverWorkloads that tolerate a small recovery point gap, confirmed by your RPO
PostgreSQL readersRead replicas for reporting or heavy searchOffloads reads but can return stale data; the app must be configured to use themConfirm with Medplum which query paths read from replicas before routing traffic there
Redis redundancyManaged Redis with a replica and automatic failoverCache survives a node loss; failover can briefly reset cached sessions or dataProduction systems where cache loss must not stall the API
Redis redundancySingle cache nodeLowest cost and operations; cache loss on failure and a restart cycleDev or test environments only

Setting up a multi-AZ Medplum deployment step by step

This sequence builds a self-hosted Medplum stack in which application servers, PostgreSQL and Redis each have a presence in more than one availability zone, and ends with a controlled test that proves the stack keeps serving when one zone is removed. Each step closes with a check you can record before moving on.

  1. Define private subnets in each zone

    Your cloud or infrastructure engineers create at least two private subnets, each in a different availability zone, with routing, NAT egress for package and image pulls, and security groups that allow only the traffic each tier needs. Confirm the design with your network team before anything is placed in it, and record the subnet IDs and CIDR ranges for later steps. The step is done when every subnet is listed in your inventory with its zone, and a test instance in each subnet can reach your container registry and the internal database address.

  2. Deploy the application tier across zones

    Run two or more Medplum server instances, placed in separate zones, using your chosen deployment method (the self-hosting docs describe AWS with CDK and CloudFormation as the recommended route, plus Kubernetes, Docker and others). Put them behind a load balancer that spans the same zones and configure a health check against the Medplum server's health endpoint. Confirm the exact health check path and version against the self-hosting documentation for your release. The step is done when the target group lists healthy targets in every zone and a request through the load balancer returns a successful response.

  3. Provision Multi-AZ PostgreSQL with readers

    Create a PostgreSQL primary with a synchronous standby in a second zone, and add one or more read replicas if your workload needs them. Medplum uses PostgreSQL as its database, so confirm with your Medplum version which connections should target the writer endpoint and which, if any, can use readers. Set backup retention and point-in-time recovery before go-live, since these are covered in the backup topic. The step is done when the failover mechanism shows the standby as healthy, and the Medplum servers connect to the writer endpoint successfully.

  4. Provision Redis with redundancy

    Medplum uses Redis as its cache. Deploy Redis with a replica in a second zone and automatic failover, or a managed equivalent, and confirm that your Medplum version can reconnect to the new primary after a failover without a manual restart. Check the connection settings in the configuration reference for your release before you assume this works. The step is done when a manual failover test completes and the Medplum servers continue to answer requests with only brief cache-related errors in the logs.

  5. Wire secrets and configuration

    Store database credentials, Redis endpoints, the Medplum configuration file and signing material in a secrets manager reachable by every application server, and make each server read the same configuration version. Confirm that the same settings, including base URLs and the database and cache endpoints, point to the writer and cache endpoints rather than to any single zone's address. The step is done when every server in every zone starts from the same configuration, and a configuration diff across instances shows no differences in endpoints or versions.

  6. Verify healthy targets in each zone

    Before testing failure, confirm the full steady state. Check that each zone has at least one healthy application server in the load balancer target group, that the PostgreSQL standby reports as synchronized, and that Redis replication is current. Run a sample of FHIR reads and writes through the load balancer and record the results. The step is done when your team has a dated baseline showing healthy components in every zone, which you will compare against during the isolation test.

  7. Run a controlled zone-isolation test

    Plan a test window with your operations and clinical stakeholders, then isolate one zone by stopping or blocking its application servers and forcing a database standby promotion or failover in a non-production environment first. While the test runs, submit writes, confirm that the writes survive the promotion by reading them back from the new primary, and watch the load balancer drain the failed zone. Record error rates and latency, and confirm the application recovers when the zone returns. The step is done when the test report shows no lost committed writes and states the observed failover behavior, which you will use to tune runbooks and alert thresholds.

What happens during failover, by component and by zone outage

When one Medplum application server instance stops, the load balancer should stop sending it new requests once its health check fails, and the remaining instances carry the traffic. The main user-visible effect is that requests already in flight on that instance are dropped, so clients see connection resets or 5xx responses and must retry. Sessions are not tied to a single instance, so a user who retries normally lands on a healthy server without signing in again. The reader should confirm the behavior rather than assume it, because retry logic in client applications and Bots varies.

  • In-flight requests: Expect failed requests at the moment of loss; confirm that client SDKs and integrations retry idempotent reads and writes safely.
  • Health check timing: Confirm how quickly the target group marks an instance unhealthy and removes it from rotation.
  • Capacity headroom: Check that the remaining instances can carry peak load in the zone-loss case.
  • Replacement: Confirm that the auto scaling group or orchestrator replaces the lost instance and that the new one passes health checks before receiving traffic.
  • Log trail: Verify that the lost instance's last logs reached central logging.

Check these with a controlled instance termination in a non-production environment before go-live.

Security and operational considerations for a multi-zone deployment

A multi-zone Medplum deployment spreads compute and data across failure domains, but it also multiplies the places where network rules, secrets, patches and operator access can drift. The cards below cover the controls that keep a zone-resilient design secure and upgradable, and the responsibilities that stay with your team.

Keep data tiers in private subnets

Place PostgreSQL and Redis in private subnets in each zone, with no route from the internet and security groups that accept traffic only from the Medplum application tier on the database and cache ports. Confirm that replicas and standby instances inherit the same restrictions, because a failover that promotes an instance outside the expected group can break connectivity or widen exposure. Review these rules after every change to the network layout, not only at build time.

Encrypt and manage secrets across zones

Database credentials, Redis auth values, signing keys and any integration secrets must be readable by application servers in every zone without being stored in images or plain configuration. Confirm that encryption at rest covers database storage, replicas, snapshots and binary storage in each region or zone you use, and that key access is limited to the workloads that need it. Rotation should be tested in a non-production zone first, since a rotation that works in one zone can fail on servers that were not restarted.

Self-hosting docs

Upgrade through each minor version

Medplum must be upgraded through each minor version in sequence. The upgrading guide warns that skipping versions, for example moving from v3.1.2 straight to v4.3.4, causes startup failures. Post-deploy data migrations can run for hours or days on large datasets, so plan a staging run against a recent copy of production data, schedule the window with your clinical users, and confirm how a rollback would work once a migration has started.

Upgrading guide

Time patches to the policy

Medplum's versioning policy targets security patches within 7 days for critical vulnerabilities (CVSS 9.0 or higher) and within 14 days for high vulnerabilities (CVSS 7.0 to 8.9). Your team owns the rollout across zones, so set a process that applies the patch to the staging stack, rolls it through the application tier one zone at a time, and records the date each zone was patched. Confirm that your standby database and cache images are patched on the same schedule as the primary.

Versions and release policy

Map shared responsibility explicitly

Medplum's compliance documentation states that compliance is a shared responsibility between Medplum and its customers. On a self-hosted deployment, your organization owns the infrastructure, network controls, backups, zone configuration, logging and access reviews, so these are not covered by the vendor. Write down which party owns each control before a regulator or auditor asks, and map the multi-zone design to those owners so that gaps between teams are visible.

Compliance documentation

Control operator access

Failover depends on people who can change infrastructure, so limit who can reach production databases, load balancer settings and super admin functions. Use named accounts with multi-factor authentication, short-lived credentials for console and CLI access, and a record of every change made during an incident. Confirm that break-glass access is documented, tested and reviewed, and that operators in one zone cannot silently disable controls that protect another.

Questions buyers ask before running Medplum across availability zones

What drives the cost of running Medplum across availability zones?

The main drivers are the number of application server instances, the database class and whether it has standby and reader instances, the Redis tier, and the time spent building and testing the failover path. Each of these is one-time work (design, build, failover testing) plus recurring infrastructure charges that continue for as long as the extra capacity runs. Cloud charges for duplicate instances, cross-zone traffic and storage are paid to your cloud provider, while build and test effort is paid to whoever implements the work. Ask any partner for a quote that separates one-time effort from recurring infrastructure, and that lists each instance, database and cache resource by name.

How long does a multi-AZ Medplum build take?

Duration depends on how much of the environment already exists, how many components need to be redundant, and how much failover testing your change process requires. Teams with an existing Infrastructure as Code baseline usually spend less time than teams building from scratch, and failover testing often takes longer than the initial build because it needs test windows and results documented for review. Ask for a schedule that lists design, build, failover tests and handover as separate phases, with the test windows you must approve.

Can our internal team build multi-AZ Medplum on its own?

Yes, if your team has cloud networking, PostgreSQL and container operations experience and time to test. Medplum publishes self-hosting options, including an AWS deployment with CDK and CloudFormation as its recommended route, so the build is well documented. The harder parts are usually database failover behavior, connection handling under failover, and rehearsing a zone loss without affecting production. Decide early whether your team will own these tests, and whether an outside team will support the design review.

What does the work need from our team?

You will need cloud account access with the permissions to create the networking, compute, database and cache resources, a network plan covering subnets across zones, and named owners for on-call alerts. You also need test windows during which failover can be triggered and observed, and sign-off from the people who approve production changes. Plan for a clinical or operations contact who can confirm that a short interruption during a test is acceptable.

How is multi-AZ different from disaster recovery across regions?

Multi-AZ protects against the failure of one data center within a region, so the database and application servers keep serving requests when one zone is lost. Disaster recovery across regions protects against losing the whole region, and it usually relies on backups, replicated data or infrastructure rebuilt elsewhere, with a slower recovery. The two designs solve different risks and usually need separate testing. Ask your team which failure scenarios are in scope before deciding how much of each to build.

Does a zone failure need a manual step?

It depends on the database and cache services you choose and how they are configured. Managed multi-AZ database services commonly promote a standby automatically, but applications may still need to reconnect, and some Redis or load balancer setups behave differently. Confirm with your cloud provider and your Medplum version how failover is triggered, how long clients take to reconnect, and whether any step such as a DNS change or a restart is required. Write the answer into the runbook and test it.

What should we confirm about Medplum upgrades before going multi-AZ?

Confirm the Medplum version you run and the upgrade path, because self-hosted Medplum must be upgraded through each minor version in sequence. A redundant topology does not change this rule, and rolling restarts across several app servers still need to respect the migration steps in the upgrade guide. Ask your implementation team how upgrades will be tested against the multi-AZ setup and whether a rollback window is planned.

Confirming your Medplum version and zone design before purchase

The first decision is the Medplum version you will actually run, because the zone design, database sizing and upgrade plan all depend on it. At research time the latest release was 5.2.5, published on October 15, 2026, following 5.2.4 on October 14 and 5.2.3 on October 8, 2026. Medplum ships major versions annually in Q4, minor versions two to three times a year and patch versions weekly, so the version you scope against may be superseded before go-live. Ask which version the quote assumes, and confirm that the design (app server count, load balancer type, PostgreSQL engine version, Redis version) is valid for that exact release rather than for the version in a reference architecture.

Read the Medplum versions and release policy before fixing a version. It sets out the Active and Maintenance periods for each major version and the Enterprise extension for security patches, which determines how long a multi-AZ design can stay on one major line. Then read the Medplum upgrading the server guide, which states that self-hosted deployments must move through each minor version in sequence and that post-deploy data migrations can run for hours or days on large datasets. A failover design that assumes a rolling deploy must also account for those migrations, so confirm with Medplum whether a given upgrade path is compatible with running across zones.

Before scoping, put these questions to Medplum or to a partner: which release line the design targets and its end-of-support date; whether the chosen PostgreSQL and Redis topology is tested with that release; how many minor upgrades you expect in the first year; whether the post-deploy migrations for your target versions are expected to lock tables or run in the background; and who is responsible for patching the zone-level components. Get written answers, because they change the effort and the upgrade window you are paying to plan.

How DeployOpen scopes and delivers multi-AZ Medplum deployments

DeployOpen plans, builds, documents and supports self-hosted Medplum inside your own cloud accounts or data centers, including the multi-AZ layout for application servers, PostgreSQL and Redis. The work starts with a written scope that states which failures the design must survive and how each one will be tested.

How we scope

  • Engagements are fixed-scope, with the availability targets, failure cases and deliverables agreed in writing first
  • We map which Medplum components run in each availability zone and which depend on a single zone
  • We confirm your current Medplum version and the upgrade path before any topology change is designed

How we build

  • We deploy multiple Medplum app servers behind your load balancer with health checks sized to your traffic
  • We configure Multi-AZ PostgreSQL with read replicas and check how Medplum connections fail over
  • We test a zone failure in a non-production environment and record what users see during failover

How we hand over

  • You receive the infrastructure as code, configuration records and a runbook for zone failure and recovery
  • Documentation covers failover behavior, Redis redundancy limits and the checks your team repeats after changes
  • Handover includes a walkthrough with your platform and on-call engineers before go-live

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover
  • Retainers can cover patch application within the security timelines Medplum publishes for each release
  • Retesting after infrastructure or Medplum upgrades confirms the zone failure design still holds

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.