# Horizontal Scaling

RudderStack makes it easier for you to add more nodes to your Kubernetes cluster, to process the events in a timely and effective manner. This guide shows you how to effectively configure your [Helm charts](https://github.com/rudderlabs/rudderstack-helm) to trigger a horizontal scale up/down, based on the version of RudderStack you are using.

## RudderStack Open-source Version

Each RudderStack node consists of a backend pod and a PostgreSQL pod. In case a RudderStack cluster is not able to process the events, it is advisable to add more more nodes to it. By changing the **`backendReplicaCount`** in the [Helm configuration](https://github.com/rudderlabs/rudderstack-helm/blob/master/values.yaml), you can trigger horizontal scale up/down. If you set this value to any positive number, helm charts will create as many RudderStack nodes.

The `values.yaml` file can be found [here ](https://github.com/rudderlabs/rudderstack-helm/blob/master/values.yaml).

There are, however, a couple of challenges in scaling up or down this way.

### Event Ordering

In a single-node cluster, all events are routed to the same RudderStack node. This guarantees the ordering of all events it has received for a given user. In case of a multi-node cluster, since the events of a same user can go to different nodes, the event ordering is not guaranteed by the cluster.

![](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-864108e4d56fff48861f446272fef271ff3899ff%2Fimage%20\(17\).png?alt=media) Event Ordering While Scaling Up from 1 Node to 2 Nodes

### Scale Down

If you scale down, all the pending events in the terminated node will not be delivered to the destination. You will need to make sure that all the events in a node are drained before terminating it.

![](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-fab3212f980b6805e0dd7e3e26eecb5f5b604a51%2Fimage%20\(65\).png?alt=media) Scaling Down from 2 Nodes to 1 Node

To understand how RudderStack handles hardware failures and guarantees High Availability, please go through our [High Availability guide](https://rudderstack.com/docs/user-guides/administrators-guide/high-availability/).

## RudderStack Enterprise Version

The Enterprise version of RudderStack makes horizontal scaling seamless, while maintaining the event ordering and guaranteeing the delivery of all events.

### Event Ordering

RudderStack Enterprise has a proxy service that implements a routing algorithm. It forwards a given set of user events to the same RudderStack node every time. Each node then guarantees the event ordering while delivering to the specified destinations. This proxy service is highly available and scalable.

![](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-a7f7be5bcab2e1794734a6b5f232431687f6849d%2Fimage%20\(27\).png?alt=media) Event Ordering in RudderStack Enterprise

### Scale Down

RudderStack Enterprise includes a separate process named **Jobs DB Migrator**. This process is responsible for moving all pending events from the existing nodes to the new nodes after scaling up or down. It makes sure all the events are migrated to the new nodes and the event ordering is maintained during and after the migration process.

![](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-7c8ccfde7771c601b1d31f3b5c2b5455305ce41a%2Fimage%20\(55\).png?alt=media) Scaling Down in RudderStack Enterprise

## Contact Us

If you want to know more about horizontal scaling in RudderStack, or if you have any queries or concerns on how to implement it effectively, please feel free to [contact us](mailto:%20docs@rudderstack.com). You can also start a conversation in our [Slack](https://rudderstack.com/join-rudderstack-slack-community) community to know more about this feature.
