Change search
ReferencesLink to record
Permanent link

Direct link
Comparison of performance between Raw SQL and Eloquent ORM in Laravel
Blekinge Institute of Technology.
Blekinge Institute of Technology.
2016 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Abstract [en]

Context. PHP framework Laravel offers three techniques to interact with databases, Eloquent ORM, Query builder and Raw SQL. It is important to select the right database technique when developing a web application because there are pros and cons with each approach.

 Objectives. In this thesis we will measure the performance of Raw SQL and Eloquent ORM, there is little research on which technique is faster. Intuitively, Raw SQL should be faster than Eloquent ORM, but exactly how much faster needs to be researched.


Methods. To measure the performance of both techniques, we developed a blog application and we ran database operations select, insert and update in both techniques.


Conclusions. Results indicated that overall Raw SQL performed better than Eloquent ORM in our database operations. There was a noticeable difference of average response time between Raw SQL and Eloquent ORM in all database operations. We can conclude that Eloquent ORM is good for building small to medium sized applications, where simple CRUD operations are used for the small amount of data. Typically for tasks like inserting a single row into a database or retrieving few rows from the database. Raw SQL is preferable for the applications that are dealing with huge amount of data, bulk data loads and complex queries.

Place, publisher, year, edition, pages
Keyword [en]
ORM, Object Relational Mapping, SQL, Database, Relational database
National Category
Computer Science
URN: urn:nbn:se:bth-13232OAI: diva2:1014983
Subject / course
PA1418 Bachelor's Thesis - Large Team Software Engineering Project
Educational program
PAGWE Web Programming
Available from: 2016-10-04 Created: 2016-10-03 Last updated: 2016-10-04Bibliographically approved

Open Access in DiVA

BTH2016Halimi(1092 kB)19 downloads
File information
File name FULLTEXT02.pdfFile size 1092 kBChecksum SHA-512
Type fulltextMimetype application/pdf

By organisation
Blekinge Institute of Technology
Computer Science

Search outside of DiVA

GoogleGoogle Scholar
Total: 19 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

ReferencesLink to record
Permanent link

Direct link