# Data Plane High Availability

High availability (HA) for API7 Gateway Data Plane (DP) nodes keeps API traffic flowing when individual nodes fail or are restarted. Use this page when you need to design a multi-node deployment behind a load balancer.

This guide focuses on runtime availability of traffic-serving nodes. For adjacent concerns, see:

* [Scale Data Plane](https://docs.api7.ai/api7-gateway/configure-and-manage/scale-data-plane.md) for adding capacity.
* [Autoscale Data Plane on Kubernetes](https://docs.api7.ai/api7-gateway/scalability/autoscale-on-kubernetes.md) for HPA-based scaling.
* [Data Plane Resilience](https://docs.api7.ai/api7-gateway/configure-and-manage/data-plane-resilience.md) for fallback behavior during extended control plane outages.

## HA Architecture[​](#ha-architecture "Direct link to HA Architecture")

A typical HA setup for the Data Plane involves deploying multiple DP nodes across different physical servers or availability zones.

* **Multi-Node Deployment**: Deploying at least two DP nodes ensures that one node can take over if the other fails.
* **Stateless Operation**: DP nodes operate independently and do not share any state, simplifying the HA architecture.
* **Control Plane Independence**: DP nodes can continue to handle traffic using the cached configuration even if the Control Plane becomes temporarily unavailable.

## Health Checks and Probes[​](#health-checks-and-probes "Direct link to Health Checks and Probes")

Configure health checks to monitor the status of DP nodes and ensure only healthy nodes receive traffic.

### Status API Endpoint[​](#status-api-endpoint "Direct link to Status API Endpoint")

Enable the status listener to use its health endpoints. The examples use port `7085`. A `200` from `/status` confirms the gateway process is running. Use `/status/ready` when routing traffic requires an available DP Manager connection and workers in sync.

### Kubernetes Probes[​](#kubernetes-probes "Direct link to Kubernetes Probes")

This Kubernetes example uses sync-aware readiness. If a gateway should stay in rotation during a shared control-plane outage, use a traffic check that can succeed with cached configuration. See [Configure Readiness and Liveness Probes](https://docs.api7.ai/api7-gateway/how-to-guides/ops/configure-readiness-probe.md).

```
# Kubernetes pod probes example

readinessProbe:

  httpGet:

    path: /status/ready

    port: 7085

  initialDelaySeconds: 5

  periodSeconds: 10

livenessProbe:

  httpGet:

    path: /status

    port: 7085

  initialDelaySeconds: 15

  periodSeconds: 20
```

## Resilience to Control Plane Failures[​](#resilience-to-control-plane-failures "Direct link to Resilience to Control Plane Failures")

API7 Gateway Data Plane nodes are designed to be resilient to Control Plane (CP) unavailability.

1. **Configuration Caching**: When a DP node receives configuration from the CP, it caches it in memory.
2. **Traffic Processing**: Running nodes can continue serving traffic from cached configuration. A request can still fail when it must look up a consumer or developer through the control plane and that result is not already cached.
3. **Automatic Reconnection**: The DP node will automatically attempt to reconnect to the CP until the connection is restored. Once reconnected, it will synchronize any configuration changes made during the downtime.

## Multi-Node DP Deployment[​](#multi-node-dp-deployment "Direct link to Multi-Node DP Deployment")

To achieve HA, you should deploy multiple DP nodes behind a load balancer.

1. **Load Balancer**: Distributes traffic across all healthy DP nodes.
2. **Health Checks**: Choose a check that reflects when a node should receive traffic. For a node starting from a snapshot during an outage, follow [fallback recovery](https://docs.api7.ai/api7-gateway/configure-and-manage/data-plane-resilience.md#recover-traffic-nodes-from-fallback-storage).
3. **Failover**: If a DP node fails, the load balancer will stop sending traffic to it and redistribute the load to the remaining healthy nodes.

## Next Steps[​](#next-steps "Direct link to Next Steps")

* [Scale Data Plane](https://docs.api7.ai/api7-gateway/configure-and-manage/scale-data-plane.md)
* [Autoscale Data Plane on Kubernetes](https://docs.api7.ai/api7-gateway/scalability/autoscale-on-kubernetes.md)
* [Multiple Availability Zones Deployment](https://docs.api7.ai/api7-gateway/configure-and-manage/deployment-scenarios/multi-az-deployment.md)
* [Production Best Practices](https://docs.api7.ai/api7-gateway/configure-and-manage/production-best-practices.md)
