ralee's avatar

Lumen or Laravel?

Hi Guys,
I was hoping that someone can advice me. I am building a bidding site with speed and performance as its number 1 priority. But its a large site with multiple component apart from the bidding page and Lumen is designed as a micro-site. I am afraid its not the ideal approach.

I have considered using lumen as the database layer and laravel as the front-end, but i read somewhere the extra HTTP request wont improve the performance of the site. Can someone please advice me if I should use Lumen On Laravel?

Thanks in advance!

0 likes
2 replies
jhoff's avatar
jhoff
Best Answer
Level 14

Laravel 5.2 actually takes a big step towards Lumen with it's new Route Middleware groups. Lumen is basically a lightweight variant of Laravel that has a bunch of the bootstrapping and middleware stripped away. It's intended to be used for non-render / non-asset type resources like json apis, job processing, etc. With the new middleware groups, you can automatically exclude any middleware that you don't need for things like APIs. From a performance perspective a Laravel API route that doesn't have to do CSRF / Authentication / etc is going to be a lot closer to Lumen performance than you think.

If you're just starting out, you might be distracting yourself with too big of an architecture decision up front. The good thing about Laravel vs Lumen is that the code is portable. If it works in one it'll work in the other.

Having the application and database on the same machine will always be faster than any other option. The cost of that though is scale. Once you start getting enough traffic that requires you to have multiple application endpoints, load balancing, database replication, server side caching, etc, then it'll be time to worry about that kinda thing. But, if you actually have that kinda traffic, chances are you can afford to hire some help to make scaling an easier burden.

If it were me, I would start out with a Laravel 5.2 app with the intention of eventually splitting down the road. Make sure you are using middleware groups and put a lot of thought into how much extra work each of your requests are doing. Then, if and when you need to scale, you can start breaking it apart, migrating the relevant code over to Lumen for job processing or for an API layer as needed. There is a lot of complexity that comes along with having a separated database / application that, in my opinion, isn't worth worrying about until you have to.

2 likes
HRcc's avatar

Just go with Laravel. Lumen is cool, but you probably don't want to build your whole app around it unless it's an API.

1 like

Please or to participate in this conversation.