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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️