> [!CAUTION]
> You are currently viewing version 1.15 of the Apigee hybrid documentation. For more information, see [Supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions).

<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.15 </button>

- Supported versions:
- [v1.17 (latest)](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/cassandra-production.md.txt)
- [v1.16](https://docs.cloud.google.com/apigee/docs/hybrid/v1.16/cassandra-production.md.txt)
- [v1.15](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/cassandra-production.md.txt)
- [v1.14](https://docs.cloud.google.com/apigee/docs/hybrid/v1.14/cassandra-production.md.txt)
- [List of supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions)
- Unsupported versions:
- [v1.13](https://docs.cloud.google.com/apigee/docs/hybrid/v1.13/cassandra-production.md.txt)
- [v1.12](https://docs.cloud.google.com/apigee/docs/hybrid/v1.12/cassandra-production.md.txt)
- [v1.11](https://docs.cloud.google.com/apigee/docs/hybrid/v1.11/cassandra-production.md.txt)
- [v1.10](https://docs.cloud.google.com/apigee/docs/hybrid/v1.10/cassandra-production.md.txt)
- [v1.9](https://docs.cloud.google.com/apigee/docs/hybrid/v1.9/cassandra-production.md.txt)
- [v1.8](https://docs.cloud.google.com/apigee/docs/hybrid/v1.8/cassandra-production.md.txt)
- [v1.7](https://docs.cloud.google.com/apigee/docs/hybrid/v1.7/cassandra-production.md.txt)
- [v1.6](https://docs.cloud.google.com/apigee/docs/hybrid/v1.6/cassandra-production.md.txt)
- [v1.5](https://docs.cloud.google.com/apigee/docs/hybrid/v1.5/cassandra-production.md.txt)
- [v1.4](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/cassandra-production.md.txt)
- [v1.3](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/cassandra-production.md.txt)
- [v1.2](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/cassandra-production.md.txt)
- [v1.1](https://docs.cloud.google.com/apigee/docs/hybrid/v1.1/cassandra-production.md.txt)


This topic describes required and recommended steps to configure the Cassandra database
component for a Apigee hybrid production installation.

## Required configurations


The following configurations are required.

### Ensure high availability

Cassandra clusters need three availability zones to maintain availability in a production
environment. If one zone goes down, the remaining zones will continue responding to requests
while the remaining zone comes back online. If two or more zones go down, Cassandra will be
unable to respond to requests until at least two zones are online. Apigee recommends
bringing zones back online within three hours to minimize the risk of missing data updates.

### Configure Cassandra storage settings


For a production installation of Apigee hybrid, Google recommends that you add the
following storage and heap settings to your overrides file and apply them to the cluster:

> [!NOTE]
> **Note:** All Cassandra storage settings in the overrides file are per pod. See also [Scaling Cassandra](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/cassandra-scaling.md.txt).

```
cassandra:
  ...
  replicaCount: 3
  storage:
    storageclass: your-preferred-ssd-storage #If not using default storage for your cluster
    capacity: 500Gi
  resources:
    requests:
      cpu: 7
      memory: 15Gi
  maxHeapSize: 8192M
  heapNewSize: 1200M
```


Apply changes to cassandra with the following command:

```
helm upgrade datastore apigee-datastore/ \
--namespace apigee \
--atomic \
-f OVERRIDES_FILE.yaml
```

> [!NOTE]
> **Note:** If you see an error saying `Error: UPGRADE FAILED: "datastore" has no deployed releases`, replace `upgrade` with `install` and try the command again.

#### `replicaCount`


The value of `replicaCount` must be a multiple of `3`. To determine your
desired `replicaCount` value, consider the following:

- Estimate the traffic demands for your proxies.
- Load test and make reasonable predictions of your CPU utilization.
- You can specify different `replicaCount` values in different regions.
- You can expand the `replicaCount` in the future in your overrides file.

<br />

#### `storageclass`

> [!NOTE]
> **Note:** Once you have created your cluster and set the StorageClass, you cannot change the StorageClass. See [`cassandra.storage.storageclass`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/config-prop-ref.md.txt#cassandra-storage-storageclass) in the Configuration property reference.

For production, Cassandra storage must be an SSD StorageClass. Set the value of
`storageclass` if you are not using the default Kubernetes StorageClass for your
cluster. You can check the default StorageClass with the following command.

```
kubectl get storageclass
```


Your output should look something like:

```
NAME                     PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
premium-rwo              pd.csi.storage.gke.io   Delete          WaitForFirstConsumer   true                   6d23h
standard                 kubernetes.io/gce-pd    Delete          Immediate              true                   6d23h
standard-rwo (default)   pd.csi.storage.gke.io   Delete          WaitForFirstConsumer   true                   6d23h
```


Follow the instructions in [StorageClass configuration](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/cassandra-config.md.txt) if you want
to change the default Kubernetes StorageClass.


To check the current `storageclass` setting, execute the following command on your cluster:

```
kubectl get pvc -n NAMESPACE cassandra-data-apigee-cassandra-default-0 -o=jsonpath="{['.spec.storageClassName', '.metadata.annotations.volume\.beta\.kubernetes\.io/storage-class']}"
  
```

<br />

#### `storageSize`


For production installations, Google recommends a storage size of at least 500Gi (gibibytes).
You can change the storage size in response to your cluster's storage needs. See the
instructions in [Expand Cassandra persistent volumes](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/expand-persistent-volumes.md.txt) to
change the storage capacity.

> [!NOTE]
> The default for `cassandra.storage.storageSize` is `10Gi`, which is insufficient for production installations. See [`cassandra.storage.storageSize`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/config-prop-ref.md.txt#cassandra-storage-storagesize) in the Configuration property reference.


To check the current size setting, execute the following command on your cluster:

```
kubectl get pvc -n NAMESPACE cassandra-data-apigee-cassandra-default-0 -o=jsonpath='{.spec.resources.requests.storage}'
  
```

<br />

#### `cpu` and `memory`


For production installations, Google recommends at least 7 CPUs and a minimum 15Gi (gibibytes) per
pod. When specifying `cassandra.resources.requests.cpu` and
`cassandra.resources.requests.memory`, consider the traffic volume and the CPU and
Memory demands of your proxies.


To check the current cpu setting, execute the following command on your cluster:

```
kubectl get pods -n NAMESPACE apigee-cassandra-default-0 -o=jsonpath='{.spec.containers[].resources.requests.cpu}'
  
```

<br />


To check the current memory setting, execute the following command on your cluster:

```
kubectl get pods -n NAMESPACE apigee-cassandra-default-0 -o=jsonpath='{.spec.containers[].resources.requests.memory}'
  
```

<br />

#### `maxHeapSize` and `heapNewSize`


These properties determine the maximum memory heap allocated to cassandra processes and the amount
by which memory is increased, respectively, in megabytes (heap sizes are specified in megabytes,
not mebibytes). For production environments, Google recommends the following values:

- `maxHeapSize: 8192M`
- `heapNewSize: 1200M`


Consult your Kubernetes platform provider's documentation for optimal heap size values.


To check the current `maxHeapSize` setting, execute the following command on your cluster:

```
kubectl get sts -n NAMESPACE apigee-cassandra-default -o=jsonpath='{.spec.template.spec.containers[].env[?(@.name=="MAX_HEAP_SIZE")]}'
  
```

<br />


To check the current `heapNewSize` setting, execute the following command on your cluster:

```
kubectl get sts -n NAMESPACE apigee-cassandra-default -o=jsonpath='{.spec.template.spec.containers[].env[?(@.name=="HEAP_NEWSIZE")]}'
  
```

<br />


For more information on these property settings, see the [Configuration property reference](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/config-prop-ref.md.txt).

### Use SSD storage for production deployments

For the Cassandra database, the hybrid runtime only supports using
[dynamically created](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#dynamic) persistent volumes to store data. Local solid state disk (SSD) drives are not supported.

If you do not currently have SSD configured for Cassandra, you must configure a
[StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes)
definition that is backed by a solid-state drive (SSD) and make it the default
class. See [StorageClass configuration](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/cassandra-config.md.txt) for detailed steps.


Follow the instructions in [StorageClass configuration](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/cassandra-config.md.txt) if you want
to change the default Kubernetes StorageClass.

> [!NOTE]
> **Note**: The Cassandra database for hybrid should not use persistent volumes provisioned on network-attached storage (NAS) systems.

## Recommended configurations


This section describes recommended configurations for Cassandra.

### Configure a daily backup schedule


In the event of a multi-regional Cassandra issue following a misconfiguration, Google will not be
able to restore the [runtime data](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/where-data.md.txt), which will
result in permanent data loss.


To prevent data loss, configure a daily
[backup schedule](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/cassandra-backup-overview.md.txt).
Monitor your backup sizes and frequency, and ensure that you are notified when the backup
pipeline fails.

### Adhere to Cassandra minimal cluster requirements


Follow [minimal cluster configuration](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/cluster-overview.md.txt) for
Cassandra.

### Treat all customer-facing environments as production


Even if your hybrid installation is considered "non-prod", you still might need production-ready
settings. For example, outages in User Acceptance Testing (UAT) installations should trigger high
priority incidents.


Use production-ready settings even for "non-prod" customer-facing hybrid installations.
We recommend that you adhere to the same principles for all customer-facing environments as for
production servers, as outlined in this article. In particular, follow the disaster recovery
principles using `replicaCount` and regions.
See [Configure Cassandra storage settings](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/cassandra-production.md.txt#configure-cassandra-storage-settings) for
details.