Home / Companies / Gel Data / Blog / Post Details
Content Deep Dive

Why ORMs are slow (and getting slower)

Blog post from Gel Data

Post Details
Company
Date Published
Author
Colin McDonnell
Word Count
2,021
Language
English
Hacker News Points
-
Summary

Object-relational mapping (ORM) libraries have gained popularity for addressing usability issues with relational databases, yet they introduce significant performance tradeoffs that are often misunderstood. To provide clarity on ORM performance, a new benchmarking tool called IMDBench has been developed, simulating a hypothetical IMDB-style movie database to evaluate major ORM libraries' performance. The study highlights that ORMs, including modern ones like Prisma, often execute multiple queries for operations, leading to slower performance compared to raw SQL or tools like EdgeDB, which can handle complex operations with fewer queries. The benchmarking environment replicates realistic server-database latency conditions and utilizes a large dataset to simulate a production environment. Results indicate that while ORMs are slower, they offer usability benefits, making them suitable for applications with lower traffic but less ideal as they scale. EdgeDB is presented as a middle ground, offering the advantages of both SQL and ORM without the associated tradeoffs. The findings emphasize the importance of understanding ORMs' limitations to make informed technology choices, especially as application complexity and traffic increase.