Cluster Setup
How to set up Formbricks in a cluster
Running Formbricks in a multi-instance cluster configuration is an Enterprise Edition feature and requires an enterprise license key.
Overview
Running Formbricks as a cluster of multiple instances offers several key advantages:
-
High Availability: Ensure your surveys remain accessible even if some instances fail
-
Load Distribution: Handle higher traffic by distributing requests across multiple instances
-
Scalability: Easily scale horizontally by adding more instances as your needs grow
-
Zero-Downtime Updates: Rolling updates without service interruption
Requirements
To run Formbricks in a cluster setup, you’ll need:
-
Enterprise Edition license key
-
Shared PostgreSQL database
-
Shared Redis cache for session management and caching
-
Load balancer to distribute traffic
Architecture
The Formbricks cluster setup consists of multiple components working together to provide a scalable and highly available system. Here’s a detailed overview of the architecture:
Component Description
-
Formbricks Cluster
- Multiple Formbricks instances (1..n) running in parallel
- Each instance is stateless and can handle any incoming request
- Automatic failover if any instance becomes unavailable
-
PostgreSQL Database
- Primary database storing all survey, response, and contact data
- Optional high-availability setup with primary-replica configuration
- Handles all persistent data storage needs
-
Redis Cluster
- Acts as a distributed cache layer
- Improves performance by caching frequently accessed data
- Can be configured in HA mode with primary-replica setup
- Handles session management and real-time features
-
S3 Compatible Storage
- Stores file uploads and attachments
- Can be any S3-compatible storage service (AWS S3, MinIO, etc.)
- Provides reliable and scalable file storage
-
Load Balancer
- Distributes incoming traffic across all Formbricks instances
- Performs health checks and removes unhealthy instances
- Ensures even load distribution and high availability
Redis Configuration
Configure Redis by adding the following environment variables to your instances:
S3 Configuration
Configure S3 storage by adding the following environment variables to your instances:
When using S3 in a cluster setup, ensure that:
- All Formbricks instances have access to the same S3 bucket
- The bucket has appropriate CORS settings configured
- IAM roles/users have sufficient permissions for read/write operations
Kubernetes Setup
Formbricks provides an official Helm chart for deploying the entire cluster stack on Kubernetes. The Helm chart is available in the Formbricks GitHub repository.
Features of the Helm Chart
The Helm chart provides a complete deployment solution that includes:
- Formbricks application with configurable replicas
- PostgreSQL database (with optional HA configuration)
- Redis cluster for caching
- Optional Traefik ingress controller for routing and SSL termination
- Automatic configuration of dependencies and networking
Installation Steps
- Add the Formbricks Helm repository:
- Install the chart:
Configuration Options
The Helm chart can be customized using a values.yaml
file to configure:
- Number of Formbricks replicas
- Resource limits and requests
- Database configuration
- Redis settings
- Ingress rules and TLS
- Environment variables and secrets
Refer to the Helm chart documentation for detailed configuration options and examples.
Was this page helpful?