Optimizing Database Access Strategy: A Performance Analysis Comparison of Raw SQL and Prisma ORM

This study presents a performance benchmarking analysis comparing two database access strategies: Prisma ORM and optimized raw SQL on PostgreSQL. The evaluation involves eight distinct query patterns executed within containerized environments using a relational dataset comprising more than 15 interrelated tables. Key performance metrics observed include CPU utilization, memory consumption, query execution time, and overall system stability. The experimental results consistently demonstrate that raw SQL significantly outperforms Prisma ORM across all tested metrics. Specifically, raw SQL achieves execution speeds up to five times faster, while using 6 to 9 times less CPU and 2 to 3 times less memory compared to Prisma. These findings highlight the substantial overhead introduced by Object-Relational Mapping (ORM) abstractions such as Prisma, particularly in performance-sensitive environments. By isolating the performance impact of the ORM layer, this study provides critical insights into how abstraction convenience can come at the cost of efficiency. The results highlight the importance of deliberate consideration when selecting database access technologies, particularly for applications that require high throughput and minimal latency. While ORMs offer development speed and maintainability, raw SQL proves to be a superior choice when optimizing for execution performance and system resource utilization. This benchmark serves as a valuable reference for developers, architects, and researchers aiming to strike a balance between productivity and performance in modern software systems.

Authors

Institutions

Publication Details

Journal
Procedia Computer Science
Published
2025-01-01
DOI
https://doi.org/10.1016/j.procs.2025.09.061
Primary Topic
Advanced Database Systems and Queries
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Optimizing Database Access Strategy: A Performance Analysis Comparison of Raw SQL and Prisma ORM

Kristien Margi Suryaningrum, Rector Arya, Ricky Reynardo Siswanto, Joseph Christian Yusmita et al.
Procedia Computer Science
Advanced Database Systems and Queries
article

Optimizing Database Access Strategy: A Performance Analysis Comparison of Raw SQL and Prisma ORM

Kristien Margi Suryaningrum, Rector Arya, Ricky Reynardo Siswanto, Joseph Christian Yusmita, Jason Manuel Wijaya
article en

Abstract

This study presents a performance benchmarking analysis comparing two database access strategies: Prisma ORM and optimized raw SQL on PostgreSQL. The evaluation involves eight distinct query patterns executed within containerized environments using a relational dataset comprising more than 15 interrelated tables. Key performance metrics observed include CPU utilization, memory consumption, query execution time, and overall system stability. The experimental results consistently demonstrate that raw SQL significantly outperforms Prisma ORM across all tested metrics. Specifically, raw SQL achieves execution speeds up to five times faster, while using 6 to 9 times less CPU and 2 to 3 times less memory compared to Prisma. These findings highlight the substantial overhead introduced by Object-Relational Mapping (ORM) abstractions such as Prisma, particularly in performance-sensitive environments. By isolating the performance impact of the ORM layer, this study provides critical insights into how abstraction convenience can come at the cost of efficiency. The results highlight the importance of deliberate consideration when selecting database access technologies, particularly for applications that require high throughput and minimal latency. While ORMs offer development speed and maintainability, raw SQL proves to be a superior choice when optimizing for execution performance and system resource utilization. This benchmark serves as a valuable reference for developers, architects, and researchers aiming to strike a balance between productivity and performance in modern software systems.

Procedia Computer ScienceVol. 269
Binus University (ID)
Openalex Percentile: Top 62%
Advanced Database Systems and Queries
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.