Problem In Running Multiple Dreamfactory Instances


I managed to install a DF instance with MySQL as a backend. The instance is running fine, i am able to create new apps and services.

However, when I tried to install the second DF instance (for HA) with same MySQL as backend, after executing php artisan df:setup i got a message as Your instance is already setup.

I had gone through the whitepaper scaling-the-dreamfactory-services-platform for Horizontal scaling. I understood that DF is just a application running on a web server, which can talk to a common backend database. That’s it

I didn’t found any other resources guiding on how to run multiple instances of DF behind a load balancer.

Any help is appreciated.



Hi @arpiticx,

You are correct, DreamFactory can be load balanced across many instances, all of which share the same system database or database cluster. Getting Started with DreamFactory Chapter 9 presents a diagram depicting what this looks like.

The DreamFactory installers are useful for quickly installing and configuring a new DreamFactory instance. However they do not take into account a load balanced configuration. You could nonetheless use the installer for this purpose and just skip the php artisan df:setup step. Instead, you’ll copy your first DreamFactory instance’s .env file over to the newly installed instance. This is important because the .env file contains the APP_KEY value, database configuration settings, and any other settings which you might have configured.

After installing the DreamFactory instances, you’ll want to place them behind a load balancer. For instance, on AWS you might use an ALB (Application load balancer).

These days many DreamFactory users are gravitating towards Dockerized instances using DreamFactory’s Docker container (also see Dockerhub), as well as scaling using Kubernetes. Regarding Kubernetes, we’ve recently released a Helm Chart.

Hope this helps!