Skip to main content

Service Replicas

Service Replicas is a feature that allows you to create multiple replicas of your services, enhancing availability and fault tolerance for your Nhost apps. By distributing user requests among replicas, your apps can handle more traffic and provide a better user experience. This documentation touches on the key aspects of Service Replicas in the context of the Nhost Cloud Platform.

Service Replicas

To read the announcement, check out our blog post.

Supported Services

Replicas can be configured for the following services:

  • Hasura
  • Auth
  • Storage

Currently, we don't support replicas for Postgres.

Configuring Service Replicas

To configure Service Replicas for your project, follow these steps:

  1. Navigate to your project's settings in the Nhost Dashboard.
  2. Click on "Compute Resources".
  3. Locate the "Replicas" slider for each service (Hasura, Auth, and Storage).
  4. Adjust the number of replicas for each service as needed.
  5. Save your changes.

Please note that when setting multiple replicas for a service, the 1:2 ratio between CPU and RAM for that service has to be respected. With only one replica, this ratio does not need to be respected at the service level.

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.

Pricing

Pricing is based on the size of each replica and the total number of replicas you have configured for each service:

  • If you allocate 1 vCPU and 2 GiB of RAM to the auth service, for example, the cost for a single replica is $50.
  • If you configure 3 replicas for auth, the total cost for all replicas would be $150 (3 replicas x $50 per replica).

Please note that Service Replicas is available only for projects on the Pro plan or higher.

Caveats

  • Postgres replication: As mentioned earlier, we do not have support for multiple replicas of Postgres. This feature may be added in the future.
  • Resource ratio: When configuring multiple replicas for a service, you must adhere to the 1:2 ratio between CPU and RAM for that service.

Compute Resources

For more information on compute resources and scaling your apps, refer to our documentation on Compute Resources.