DEV Community

Gunabalan.S
Gunabalan.S

Posted on • Edited on

ORM vs SQL vs query builder

ORM may initially provide a comfortable development experience, but its efficiency diminishes when dealing with a user base as small as 10,000. The slowdown becomes noticeable, especially with multiple joins or lengthy logic. In my personal experience with Laravel PHP projects, I opted to move away from ORM.

While direct SQL introduces challenges, such as data marshaling between JSON and objects or the serialization and de-serialization process, using query builders like Medoo PHP proved to be a wise choice. These tools are lightweight and alleviate some of the burdens, allowing for a smoother development process.

However, in situations where extensive processing is required, like generating invoices for over 10,000 users, employing stored procedures becomes a preferable solution.

Top comments (0)