We are starting development of new version of our quite large IS. We starts on green meadow and currently choosing technologies. PHP and MySQL was necessary. We have chosen Laravel as backend framework and I have a question to that.
Should we mainly use Eloquent ORM or Query Builder?
Because our database are quite large currently 700MB and growing about 80MB per month. Current version of IS have some non-optimalized query series which takes over 30 seconds. Mostly its some data exports. And we have to do that much faster.
I want to use only one of these approach over whole application and I worry about performance a lot.
Which one is faster with large data joins. for example: 10 tables, one of them 2mil lines and ~150MB
The answer to this is totally "it depends". This question may be too broad.
What SQL the ORM generates depends on your use case, and the complexity of your data relationships/schemas.
You can, in any case, use cacheing to help improve speed (if your data/business needs permits).
Additionally, by and large you can use both. Perhaps start with Eloquent and switch when you need to (in other words, don't prematurely optimize).
Investigate the "repository pattern" to see how you can do this in a maintainable way.