@annaro There’s no need to create multiple threads for the same topic. You already had a thread here: https://laracasts.com/discuss/channels/forge/load-balancing-jobs
Database server with a load balancer
I have an app with a database containing users as well as other tables. Logged in users can start jobs. Jobs can be demanding, and i want my app to be able to handle any number of users / jobs, which is why i'm looking into load balancers now. I am thinking about Laravel Forge (even though i am unsure if configuring a load balancer directly with Digital Ocean might be a good alternative too).
Would this be a good configuration?
Server 1: database
Server 2: load balancer
Server 3: app
Server 4: app
In that case, should my .env files on Server 3 and Server 4 indicate something like this?
DB_HOST= {{ ip address of Server 1 }}
So the deployment script for Server 1 would say: php artisan migrate but the deployment scripts for the other servers would not contain that line, is that right?
Is there anything else to configure to make the whole thing work with my database on a different server than my app?
Should i link the domain name to Server 2, 3 and 4, but NOT to Server 1, right?
Thank you!
I found this blog post has a pretty clear workflow for setting this up using Forge. It seems to answer most, if not all your questions.
https://www.blog.plint-sites.nl/a-scalable-server-setup-using-laravel-forge-and-envoyer/
Please or to participate in this conversation.