3 ms·
If your application does something stupid with SQL, your whole awesome C10K-solving epoll-based framework comes to a halt waiting for the database to read 1M ro
by jrockway 16y ago
If your application does something stupid with SQL, your whole awesome C10K-solving epoll-based framework comes to a halt waiting for the database to read 1M rows off disk.
No, a database connection is just another socket in your "awesome epoll-based framework".
Worst of all, your ORM likely hides the facts from you
Maybe if you're writing your app in BASIC? A good ORM doesn't hide the query logic from you, and there are plenty of popular languages that have good ORMs. The difference between using an ORM and not using an ORM is that you don't have a bunch of code to map SQL rows to application domain objects in your app. That's it.
(Note: Active Record and Class::DBI from 5 years ago aren't good ORMs. But people have written good ones in the intervening time, like DBIx::Class.)
- IgorPartola 16y agoTo your first point, at least libmysqlclient blocks and any wrapper around it does too. To your second point, my most recent experience is with sqlalchemy, which is really pretty powerful, but also produces some hideous SQL when using the ORM layer. It does not hide the query logic from you, but conceals it just enough that I have to check every time that it is not lazy-loading 10,000 rows or not returning 10,000 rows when I only need 10.
- jrockway 16y agolibmysqlclient sucks. :)