Lumen vs Sinatra!

I'm very confused about choosing a micro-framework to build a RESTful API's, all who i asked said that Sinatra (based on Ruby) is the best choice for getting amazing performance, but when i searched a little, I found that Lumen is a nice choice, I developed many applications with Laravel and i felt with its power, i know that Lumen is a Laravel based and for this reason i'm confused.

Jonathan Vargas's photo

If your API is pretty simple and doesn't require an ORM, complex routing, and some other things, them Slim is the way to go. Otherwise some more bloated frameworks like Lumen would be okay.

Todd D Nestor's photo

With Lumen being benchmarked as faster than Slim, what's the benefit to using Slim? I haven't benchmarked them myself so perhaps your answer will be that the benchmarks are biased towards Lumen and are do not accurately reflect the realities in a real app, and my experience with Slim is limited, so I'm asking out of real curiosity.

Todd D Nestor's photo

Also, I now realize that I am replying to a comment from two years ago, so perhaps the realities have changed and Lumen only recently surpassed Slim in terms of performance. I'd be interested in knowing if your opinions have changed at all though.

For my work I mostly develop in Rails, but for my own projects I often use Laravel for things that need a full-stack framework, or Lumen if I don't need as much simply because it is quite performant and uses the Laravel syntax I am already so familiar with.

TJ's photo

If you have experience with Laravel already, then I would absolutely build it with Lumen. I have 3 Lumen apps / service in production and they work great and are very performant. I had one instance of a data api needed some higher level functionality and there is a very straight forward upgrade path to Laravel. Add the performance improvements of PHP 7 to the mix and I wouldn't think twice about it.

Lumen is a stripped down version of Laravel. The reason why this is great for APIs is that you don't have the overhead of features that you don't need, e.g. Blade Views, out of the box. You can piece in additional services as needed.