Yii Framework Forum: Need suggestions on Yii2 as rest api vs Lumen - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Need suggestions on Yii2 as rest api vs Lumen Rate Topic: -----

#1 User is offline   wwwwww 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 04-December 12

Posted 08 August 2016 - 05:56 PM

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.

0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,184
  • Joined: 17-January 09
  • Location:Russia

Posted 09 August 2016 - 07:04 AM

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

Quote

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


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.

Quote

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

Can't say so. It's OK.

Quote

Yii2 community is not as big and live as laravel

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

Quote

Yii2 seems to be better than Lumen in terms of memory optimizations!

True. Laravel and Lumen are quite resource hungry.

Quote

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.

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

Quote

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


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 http://www.slimframework.com/ which is very barebone but has all what's necessary. You have to do lots of things yourself, of course. As with any microframework.
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users