Need suggestions on Yii2 as rest api vs Lumen

We’ve recently has started to look for a fast framework to serve as a microservice backend (rest api) for all our services (and a full js frontend which is not important for now). Laravel/Lumen seems to be the most popular one [which I don’t like the fact <_< ]. Anyway I need some suggestions about using Lumen or Yii2. These are some statements that I have encountered based on my searches which I don’t agree or disagree with them [I need some unbiased recommendations]:

  • Yii2 is not a micro-framework in nature, but Lumen is.

  • Lumen is not mature enough for a micro-framework which is supposed to serve all types of requests

  • Yii2 community is not as big and live as laravel

  • This is my experience: A simple Lumen request to get a JWT token [dingo api/jwt-auth module] takes more than 3 MB of memory, while Yii2 hello world application with all view components included take less than 3.5 MB, i.e. Yii2 seems to be better than Lumen in terms of memory optimizations!

  • Yii development team tends to implement components natively, while Lumen uses symphony or other 3rd party components, this feature results in optimizations on memory and cpu for Yii2 framework, but some time you have to wait so long for a native component to be available.

  • Suppose you agree with Yii2 over Lumen, what are you main reasons? What if you’re agree with Lumen? What are your main reasons in this case.

  • Do you have any experience on using Yii2 or Lumen as a full rest api application?

  • Have you done any benchmarking tests on comparing Yii2 and Lumen?

Last words:


[*]Have I missed any important criteria to choose a micro-framework?

[*]I am a Yii lover myself, please try to be as fair as possible :D .

[*]Thanks for your time in advance and let me know if you need any clarifications.



Yii forum isn’t the best place to look for unbiased opinions. Still, I’ll try to provide more or less objective opinion.

Semi-true. Lumen is stripped too much so if you need routing you take it from Laravel, if you need to work with database you take it from Laravel etc. In the end you have almost Laravel which performance isn’t as good as advertised.

Can’t say so. It’s OK.

In US — true. Non-US — nope. Yii is more popular.

True. Laravel and Lumen are quite resource hungry.

True about memory/cpu optimizations. Not sure which components you need to wait for. Everything PHP could be easily used with Yii.

Yes. I think you’re missing the point of micro-framework. If you need just memory/CPU efficiency, it’s fine to go with Yii. If you’re about micro i.e. nothing except routing and HTTP then I’d look at something like which is very barebone but has all what’s necessary. You have to do lots of things yourself, of course. As with any microframework.

1 Like

I am on the analogous situation, trying to change from old node version to yii2+php, but what about Phalcon?
have you tried, or what was your final choice about what to use?

1 Like