DEV Community

Discussion on: Cleaner models with Laravel Eloquent Builders

Collapse
 
rocksheep profile image
Marinus van Velzen

It's true that writing and using pure SQL is a lot quicker than to use an ORM, but then you'll have to manually map all the data to the required objects anyway, which in the end will turn into a kind of specialized ORM.

It's also true that stored procedures, triggers and other database functions can make it a lot faster and quicker to write to a database. It also makes it a lot more complex, while using an ORM makes programming more accessible.

In the end it all comes down to preference. If you want the fastest and most optimized code, you'll want to use procedures and such, but you can also make good software by using an ORM.

Collapse
 
maxgoryunov profile image
MaxGoryunov

The truth is, you do not have to map data to objects(models). I would even say this is a horrible idea. You should always separate data and objects, otherwise your models will become huge inevitably.