Yii2 Vs Laravel which is better

Oct 17, 2019

Yii2 vs Laravel

I found this post by Richardo and I think this best sums up the Yii vs Laravel Battle.

-- Re-Post Ricardo Obregón, Yii Coder and Consultant


Just forget it. It is outdated and requires much more work to get simple things done.

Yii is Faster to Develop

In my experience, in spite of Laravel is more popular (and in some weird cases better documented), I’ve found thar Yii works much better/faster and yourself can develop faster.

Yii Scales Better

When you move to production environments Yii scales fast and easy.

Laravel is Simpler To Learn

Laravel is simpler for beginners has nice tutorials/documentation, but in practice is much slower than Yii.

Libraries (tie)

Many people use to say that Laravel has much more libraries, which is half-true, because many of those libraries were not well-written (PSR, good practices, etc).

Yii Is More Stable

Yi is simply more professional IMHO. It is not perfect, of course, some things takes time to become alive in the framework, but is much more stable and have longer support (critical in production environments) than Laravel. Not always is that good to get major new versions each year, but to get bugs fixed fast and get enhancements in the same version without having to rewrite all your project because the team released a new version. E.g. Symfony framework works in a similar way, that’s why despite it is more than 10 years old, it is currently at version 3.

Compare that to Laravel, in 5 years has released 5 major versions and always require that you rewrite a lot of code in your project. Laravel is good of course for certain projects, but for production environments when your require to have stable code support time as longer as possible, is not that good.

Small Project Laravel Wins

So, If you want to develop a small project and you don’t care to rewrite stuff often, Laravel is fine.

Criterial Long Term Project: Yii Wins

But if you want a long supported project which endures some years before rewriting some critical stuff, Yii is your choice. Regarding the amount of traffic, if you use to apply good coding practices, it is not framework dependent, but infrastructure.

Final Summary

In my case, most of my projects in production run on PHP 7 (which is much faster than previous versions) and nginx.

Also I use Redis for session management and cache (it is pretty fast, reliable and pretty easy to configure in Yii: a couple lines in config file). Regarding DB, it is just a matter of adding DB name, user name and password in config file, so not big deal (even if you add a slave server, you just need to add a single line in Yii and it do all the balancing job for you), so, choose your favorite DBMS.

My favorite is PostgreSQL, and then all the others: CUBRID (which is already supported by Yii), MariaDB (MySQL overhauled) and Firebird (not supported by Yii 2.0 yet).

Go and give a good try to Yii ;-)

Check out our Yii2 Custom

Posted in Yii Framework on Oct 17, 2019

Back To Blog

About Wesvault

Wesvault is a premium economy software consultancy

Run A Consulting Business?
You could need a sales funnel

Start Now