Lumen and several Laravel instances in different servers
Hi,
I'm currently studying Lumen and I am creating a web application. It's an e-commerce web app and I want the Admin dashboard, merchant dashboard and the actual shopping site in different laravel instances and different servers. I'm planning to place Lumen and the database in 4th server.
Is having too many servers bad? What setup is better?
No it is not bad. Actually it is quite clever that way. You are able to scale the servers to fit your needs more flexible that way.
But you will need databases on each of them right? Otherwise what do you want laravel for?
If you want the admin dashboard and the shop just to consume one central api then I would go for laravel for the api and vue.js / bootstrap for the two frontends.
I really don't think Lumen is enough for any real api. It is for microservices in REST style.
You will pretty soon come to the need of a feature Lumen does not support out of the box.
That is just my experience. So I personally do not bother about Lumen anymore I just go with full laravel and strip down some providers to minimize overhead.
@winterhevn I would suggest looking into Docker for that type of architecture. I have many applications, APIs, databases etc... each inside a separate docker container inside a docker swarm. A swarm is just a docker network that includes internal DNS and loading balancing. You can create new instances of any container on-demand for an easily burstable solution. A swarm can exist on one or across multiple physical servers. A lot cheaper and more versatile than having a dedicated server per application.
You could also consider creating an SPA on the back of that approach.
@ChristophAust Thanks! Decided to use Laravel instead of Lumen. I'm pretty new to vue.js so I'm going to use the same Laravel installation for the admin dashboard in the meantime. I only have to work on admin for now (and a few tasks only). I will convert to Vue after when I get the hang of it.