To me, it really sounds like a single app with different user roles where the various roles allowed/disallowed you from accessing different things. Is there a reason for thinking they should be separate "apps"?
Run multiple Laravel apps that run off the same database
I'd like to set up an admin application to run alongside my web app. These two apps may, or may not, be on the same server. I want them to run off the same database - which is on a different server. Is this as simple as just properly configuring the env to use the same database connection?
I could see potential conflicts with migrations - in other words, you wouldn't be able to just download the admin app and set it up on your local machine because it wouldn't know to create the users table, etc., all the things that the web app handles creating.
Is this a bad idea? If it is, what are the alternatives? I foresee us needing a number of "portals" like this for different user groups, but I don't want to create completely different apps. There's no reason, for instance, that we couldn't drive all these users and user types from a single users table in the Laravel application.
Thanks! -Matt
Load balancers aren't a problem, but you have to do a few things. Instead of each server storing data on the server it's hosted on, everything needs to be stored externally. A common place that all servers would use.
For instance, with a single site on a single server, it's no big deal to have the database on the same server, file uploads stored on that server, sessions generated on that server, etc. But when you are behind a load balancer, these things all need to be in common. Like you can't upload an image on one server and have it show up on the other servers (well, you can with some extra work, but you wouldn't want to do that anyway). Instead, you'd upload to a S3 bucket or something external, and have all servers using that bucket to store/retrieve images. The same for the database. It needs to be on a separate server, with all servers using it. The same for sessions. Use redis or something for sessions. So if you log into one server on the first request, and the 2nd request puts you on a different server - it won't matter.
Once this system is in place, it's just a matter of adding a new server behind the balancer, deploy the app to it and make the balancer aware of the server. Really, almost a 2 minute thing and mostly automated.
None of this is specific to laravel. It's how anything behind a load balancer needs to work.
Here's a good article: https://serversforhackers.com/c/so-you-got-yourself-a-loadbalancer
Please or to participate in this conversation.