Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,156,209 members, 7,829,336 topics. Date: Thursday, 16 May 2024 at 03:11 AM

Laravel Eloquent Or Query Builder? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Laravel Eloquent Or Query Builder? (375 Views)

Exploring The Power Of Laravel Eloquent Join / Need A Proficient And Eloquent Programmer On An API Video Course / Download: Eloquent Javascript PDF (FREE) (2) (3) (4)

(1) (Reply) (Go Down)

Laravel Eloquent Or Query Builder? by chukwuebuka65(m): 9:49pm On Aug 18, 2023
Which is better for performance ?
Re: Laravel Eloquent Or Query Builder? by emetisuccess(m): 9:57pm On Aug 18, 2023
I make use of both. In terms of speed of execution, it depends on how complex ur database is.
Re: Laravel Eloquent Or Query Builder? by chukwuebuka65(m): 11:05pm On Aug 18, 2023
emetisuccess:
I make use of both. In terms of speed of execution, it depends on how complex ur database is.

It’s an e-commerce tech store for a small business. I will try eloquent .
Re: Laravel Eloquent Or Query Builder? by peterincredible: 6:46am On Aug 19, 2023
Both are good depending on the programmer I use both but for more complex queries I use query builders for cases like (sub queries, or joining a sub queries or even doing some calculations directly on the database b4 spitting the result out) but I think when it is time to do things like organising the return data's base on relationship I thing eloquent is really good at it both when I think the power comes best is when you use both together

Using query builder for complex queries and then infusing/converting it to eloquent models for easy organization of relationship and ure next orgasm will be intense gracias

1 Like

Re: Laravel Eloquent Or Query Builder? by stanliwise(m): 7:02am On Aug 19, 2023
chukwuebuka65:
Which is better for performance ?
Performance in practical sense is not dependent on both of them. It’s about the actual query that eventually hit your db and how optimized is your db against such query. So use telescope to see the actual query that eventually gets to the DB
Re: Laravel Eloquent Or Query Builder? by chukwuebuka65(m): 8:52am On Aug 19, 2023
stanliwise:

Performance in practical sense is not dependent on both of them. It’s about the actual query that eventually hit your db and how optimized is your db against such query. So use telescope to see the actual query that eventually gets to the DB

Ok. Thanks
Re: Laravel Eloquent Or Query Builder? by chukwuebuka65(m): 8:56am On Aug 19, 2023
peterincredible:
Both are good depending on the programmer I use both but for more complex queries I use query builders for cases like (sub queries, or joining a sub queries or even doing some calculations directly on the database b4 spitting the result out) but I think when it is time to do things like organising the return data's base on relationship I thing eloquent is really good at it both when I think the power comes best is when you use both together

Using query builder for complex queries and then infusing/converting it to eloquent models for easy organization of relationship and ure next orgasm will be intense gracias

I didn’t know this was possible. I will research on that. Thanks for the insight.
Re: Laravel Eloquent Or Query Builder? by emetisuccess(m): 11:57am On Aug 19, 2023
chukwuebuka65:


It’s an e-commerce tech store for a small business. I will try eloquent .
okay It'll be faster then
Re: Laravel Eloquent Or Query Builder? by stanliwise(m): 12:10pm On Aug 19, 2023
chukwuebuka65:


Ok. Thanks
If it’s about searching let’s say for e-commerce. Be sure to start considering elastic search or something of that nature. DB spool for advance search aren’t optimal

(1) (Reply)

How Much Can It Cost To Develop Bill Payment App / Which Programming Language Is The Best Between Java And Python ? - Shomek / Help

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.