Service Replicas allows for multiple instances (or replicas) of your services, enhancing availability and fault tolerance of your backend infrastructure. By distributing user requests among replicas, your backend can handle more traffic and provide a better experience to your users.

Service Replicas

Benefits

  • Improved fault tolerance: Multiple replicas ensure that if one instance crashes duo to an unexpected issue, the other replicas can continue to serve user requests.
  • Improved availability: Distributing user requests among multiple replicas allows your apps to handle more traffic and maintain a high level of performance.
  • Load balancing: Distributing workloads evenly among replicas to prevent bottlenecks and ensure smooth performance during peak times.
Replicas can be set for Hasura, Auth, Storage, and Run Services, Postgres support is coming next

Configuration

To setup replicas for your project, you can either use the Dashboard or the Config.

When configuring multiple replicas of a service, you must adhere to a 1:2 ratio between vCPU and RAM for that service
nhost/nhost.toml
[hasura.resources]
replicas = 2

[auth.resources]
replicas = 2

[storage.resources]
replicas = 2