简体   繁体   中英

Do I need to switch Laravel to Symfony?

I have the same question about my current project.


  • Project type: Something like shopping cart SDK.
  • Models: 30+ (with extensions)
  • Extensions: 15+
  • Tables: 47
  • Relations: every model have 3+ relations
  • The most performance demanding part processing: 300ms

On start, I have 10 models with relations, that's why I choose Laravel as Framework, and I do not think about growing.

Now, I have 40 models with a lot of extensions and Laravel work fine. My project is growing fast. Now It's a big SDK with a lot of tables, relations, and extensions.

I need advice from experienced developers.

Do I need to switch Laravel to Symfony, to reduce future problems with performance?

I would be glad if you can advise me on this.


PS: I understand complexity with migration from Laravel to Symfony,

Performance-wise there is no big difference between frameworks. If you are coding right - they are all just the same.

But the problem is in this part "if you are coding right" .

You must always think about design, about responsibilities, about service layers, and to be consistent with your approaches.

And for this Symfony is much better. It's just a more convenient framework to go with SOLID. And it makes you think in a right direction.

Laravel is good for medium websites. For big app i would always use symfony or zend.

TL;DR: There is no any reason to change Laravel to Symfony.

Symfony has no layer for models handling. It's ORM library's responsibilities (usually we can use Doctrine in Symfony -- but it's possible to use another ORM libraries for that -- even Eloquent). And also it's not a big deal to use Doctrine for Laravel.

But obviously changing framework won't decrease the number of models -- so 40 models in Laravel still will be 40 models in Symfony. Because of this, there is no any advantage for decreasing of complexity.

Also there is no explicit dependency between framework and performance (generally, the DB is bottle neck).

Despite of opinion that Symfony automatically (and magically) increases programming skills -- it's wrong. So if someone able follow to SOLID principles, able to reduce cyclomatic complexity of the code, able to provide strong cohesion and loose coopling for the classes -- it doesn't sense what exact framework could be used. Actually Symfony doesn't force to use the best practices.

Therefore Symfony provides a lot of excellent components. But most of them can be used easily (and actually used) in Laravel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM