Client Perspective on Symfony vs Yii: Which is Better for Your Project?
If you are looking for a less geeky, more business-friendly explanation of the differences between Symfony and Yii that will help you actually understand what to choose for your project this article is for you.
This is not a typical X vs Z framework article, in which programmers go into full detail about all features of frameworks in question and discuss implications of these differences only from the ‘programmer’s perspective’.
In this article, we’d like to show you the most important points for you, as a client, when it comes to choosing the technology for your website or web app. Therefore, you won’t find an exhaustive list of differences between Yii vs Symfony here, only what we think will help you make your decision.
The Most Important Thing In Choosing a Framework
We think that the most important thing you should understand about choosing between Symfony and Yii frameworks, or perhaps any other technologies, is the following:
The best framework for your project is that which your programmer knows best!
As trivial as it sounds, it’s really an important one! If everyone understood it, there wouldn’t still be an argument about which of the two technologies is better. None of these two frameworks is superior.
At Greenice, we have years of experience in both technologies and can tell you that both are strong, when in the right hands. We’ve seen experienced programmers do equally good work using both of these frameworks and, unfortunately, we’ve seen weak programmers failing regardless of the technology choice.
That being said, we are not trying to convince you that the two frameworks don’t differ. They do. These technologies have some fundamental differences. However, most of these pros and cons have more influence on the programmer’s work than on the outcome, besides a few. And those few key differences that are most likely to have an impact on your project you’ll find in this article.
Symfony or YIi: Which is Stronger?
First, let’s recap the strong points of both frameworks.
When evaluating alternative frameworks one should consider such key issues as:
- Does the framework have a good track record and stability?
- Does it have features & tools for my project?
- How well is it supported?
- How big is the community?
Both frameworks are very serious with a good track record.
1. Track record
The two frameworks have been around long enough to be considered solid.
Symfony PHP framework was first released in 2005 by the developers of SensioLabs. It has a large base of components/libraries and a modular framework.
Yii had a first alpha release in 2006. Yii is an MVC framework that is optimized for high performance. It is also one of the best frameworks for Rapid Application Development (RAD).
Great projects have been developed with both of these frameworks
The frameworks are rich in tools and methodologies, so both can be used in custom programming to build great projects.
For example, compared to Yii Symfony has the biggest amount of components. However, most of Symfony components can be also used in Yii.
Yii provides a lot of features out of the box, which speeds up the development process.
They both support the databases we work with at Greenice (MySQL, PostgreSQL, MongoDB) so it was not an issue for us, as well. However, Symfony does support a greater amount of databases, in case Yii doesn’t cover your needs.
If you need a more in-depth exploration of the features, here is a great article that shows Symfony vs Yii vs Laravel comparison at opensource.com
It is important that the technology that you choose to develop your project is further supported by the core developers.
Core teams of both frameworks support their releases very well. Symfony provides Long Term Support (3 years) for some of its releases. Yii doesn’t officially issue LTS, but they do support their releases for longer periods than three years.
As the frameworks in question are open source, the size and quality of their communities are very important. A big and engaged community means that not only the core team supports the framework, but many other industry experts (contributors) from around the world participate in improving and resolving arising issues of the technology. In addition to that communities produce educational resources.
In this respect, both technologies have outstanding communities.
Symfony: over 300 000 members as stated officially, 2,273 contributors on GitHub Yii: 193 112 forum members, 1,106 Yii2 contributors on GitHub.
3 Key Differences
Here are the three differences that we think may have the biggest implications on your project from the business perspective.
1. Architecture Design
This framework dictates architectural decisions to a developer, whereas Yii gives complete freedom in this regard.
This happens due to convention over configuration, one of the principles of the Symfony framework, which attempts to decrease the number of decisions that a developer is required to make without necessarily losing flexibility. Symfony consists of independent components, which have to be structured in a way that excludes dependencies.
Its architectural rules are based on the best practices of Modular Programming and Domain Driven Design (you can learn more on that in the article). It is quite hard to avoid these rules, thus a programmer is ‘forced’ to follow best practices whether he/she wants it or not.
In this regard, Yii is much less rigid than Symfony. Yii also gives a default (MVC) architecture but leaves most of the architectural decisions up to the developer.
Although Yii is also built on its own components, these components are not independent as in the case with Symfony. Yii has a singleton for the entire application (Yii::$app), which makes it difficult to test different components separately.
Business implications: Bad architecture leads to large amounts of dependencies in a code. The more dependencies you have in a code, the more difficult it will be to upgrade and support a web app. This will mean that a bug in one part of your system may lead to problems in other unexpected places. In addition to that, future changes to your system (like adding new functionality) may lead to failures in the existing parts of your app. As a result, such project quickly turns into a support nightmare.
The truth is that it can happen on both frameworks and it also can be avoided on both technologies!
Symfony creates a stricter environment with an aim to prevent such costly mistakes. However, the framework is by no means a ‘foolproof’ technology, so one can still ruin a project written with it.
Yii leaves more room for maneuver. This flexibility is a good thing for an experienced programmer, who follows best practices by default, Yii gives him/her freedom to be creative. The same freedom can be deadly for a newbie who needs more guidance.
Therefore, Symfony might be a better option for very complex projects. When your app or website has a lot of features, complicated business logic, big distributed development team and you anticipate a lot of changes, you might really benefit from Symfony’s modularity.
2. Time to Launch
Symfony attempts to speed up the development process with its reusable components. This means that you can utilize parts of the code that you once built for other parts of your project, as well as for other projects. However, its complex design patterns that lead to easier testing and support in the future, often slow down the development process at the launch phase.
Yii This one was created with development speed in mind. The technology has a lot of ready-to-use extensions out of the box, as well as code scaffolding for faster code generation and development.
Business implications: If development speed is very critical for you, you want to launch your app or website as fast as possible, go with Yii.
3. App Performance (Loading Speed)
Symfony is considered one of the slower PHP frameworks. Its modularity and abstraction layers make it heavy. However, this will only be a problem for high-load real-time applications using critical data. In addition to that, there are ways programmers can work out such performance issues, but it will cost you extra hours.
Yii In the contest of Symfony vs Yii performance, Yii is a clear winner, as it shows very good performance compared to others. Benchmark tests prove this speed advantage.
|framework||requests per second||relative||peak memory||relative|
Business implications: You should be concerned with performance only if you are building a real-time app and you know that a lot of visitors are going to use it at the same time (like a social network). In that case, Yii is a good choice.
The bottom line is that unless your developer really knows his craft, i.e. really understands MVC, Object-Oriented Programming, and other programming best practices, he or she is going to fail with any framework. Even Symfony’s strictness won’t save your project.
As for the rest, both tools are very strong and resourceful.
Symfony has a stricter programming environment that may be beneficial to very complex projects with large distributed teams.
Yii gives more freedom to developers. While this can be a problem for inexperienced developers, seasoned guys can use this to the advantage of your project (come up with faster and better solutions than default ones).
As a result, with Yii, you will likely hit the market faster than with Symfony. And this can be critical to some startups.
In addition to that, apps built with Yii run faster than those built with Symfony. However, unless you plan for a very high user load the difference will be hardly noticeable.
Co-author: Max Lapko, Team Leader at Greenice. Max supervises the most complex projects at our agency, ensuring top-quality work and optimal productivity of his team. He is also a go-to person when anyone in the team faces a challenging technical problem.
Get a FREE technical consultation for your custom website.Contact Us
Author: Kateryna Reshetilo is a Head of Marketing at Greenice web development agency. She is responsible for uncovering new market opportunities in the eCommerce, Healthcare and eLearning spheres. Kateryna also crafts and oversees the execution of marketing strategy at Greenice. When off-duty, she is a loving wife and mother of a cute 8-year-old boy. She is also passionate about climbing and windsurfing!