Skip to main content

High Availability and Disaster Recovery

For high availability, it is recommended to run the Styra DAS on a Kubernetes cluster that spans multiple availability zones and have a pod scheduling policy that places replicas across multiple availability zones.

The default On-premise installation sets the replica value to 1.

For high availability, Styra recommends you to set the microservices replicas with the following values:

microservicereplicas
activity3
agentbundle3
agentloader1
agentstatus3
analysis-api3
controllers3
coordinator1
datasources3
docs1
fetchdb3
gateway3
logreplay3
stacks3
sysinspector1
systems3
tenants1
timeseries3
ui3

In addition to the Kubernetes cluster, the database is prepared to run across multiple availability zones. You can achieve this depending on the kind of PostgreSQL deployment you have. For example, to learn how to accomplish High Availability (Multi-AZ) for Amazon RDS, see the documentation page.

For disaster recovery purposes, running the cluster and the database in multiple availability zones might not be sufficient. In this case, the DAS can be prepared for disaster recovery across multiple geographically distant regions as follows.

info

While the above steps prevent data loss, they don’t provide you with automated failover, but in the case of a disaster, manual operations are required to bring up DAS.

1. In the secondary region, prepare a secondary, standby Kubernetes cluster that is ready to be used to install the DAS if the primary cluster in the primary region fails.

2. In the primary region, configure the database to asynchronously replicate its database to a read-only replica in the secondary region. For more information on AWS RDS PostgreSQL, see `https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.XRgn`.

In case of a disaster, you must execute the following steps.

  1. For a new DAS setup, you must promote the read replica in the secondary region to a new standalone database instance. For an instance with AWS RDS PostgreSQL, you can follow the instructions on https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.Promote.

  2. Now deploy the DAS to the secondary cluster and point it to use the newly created database instance.

  3. Change the DNS name assigned for the DAS and configured to OPAs to point to the secondary DAS setup. This instructs the OPAs to connect to the secondary DAS setup once their DNS caches expire instead.

tip

Therefore, it is recommended to have short TTLs for the DNS entries pointing to the Styra DAS.