News for hackers. Stuff that matters.
Re:Appropriate Uses for SQLite by petepete on Monday February 12, 2018 @07:37AM (#16358207)
> Dynamic content uses about 200 SQL statements per webpage.

Genuinely curious, what kind of page would require 200 queries? I've written plenty of moderately-complex applications and don't think I've come close to 10% of that on a single (non-crazy dashboard) page.

Re:Appropriate Uses for SQLite by zimpenfish on Monday February 12, 2018 @07:56AM (#16358282)
A Wordpress page with 12 posts will do 60 queries - shamusyoung.com/twentysidedtale/?p=41607

I should imagine something running on a generic ORM (ie without the optimised queries) would use considerably more (Rails, IIRC, will often do two queries to load a single object.)

Re:Appropriate Uses for SQLite by ju-st on Monday February 12, 2018 @07:48AM (#16358251)
Click on the linked site (or: https://sqlite.org/np1queryprob.html ), the sqlite project explains it
Re:Appropriate Uses for SQLite by petepete on Monday February 12, 2018 @08:40AM (#16358465)
Ah, thank you. Explains it perfectly.
Re:Appropriate Uses for SQLite by TimWolla on Monday February 12, 2018 @07:42AM (#16358224)
It doesn't say "require". Possibly they are selecting the same information over and over again, instead of passing it along the different functions, because it is fast enough.
Re:Appropriate Uses for SQLite by krylon on Monday February 12, 2018 @07:52AM (#16358266)
Even so, querying data once and reusing it is usually the more maintainable option and probably means less code, too. It is not only about performance.

(And just to be clear, for my use cases, I have been very happy with SQLite's performance.)

Re:Appropriate Uses for SQLite by hinkley on Monday February 12, 2018 @12:02PM (#16359968)
This requires an information architecture and these days those seem to be harder to come by. I think we may be favoring velocity over Stop and Think time a bit too much.

(If you’re thinking, “no dummy, just use caching” then I regret to inform you that cache invalidation and eviction without an info architecture are as hard if not harder. And caching bugs make you look like a clown in front of your bosses. Because the whack-a-mole process never looks professional)

Re:Appropriate Uses for SQLite by qlm on Monday February 12, 2018 @08:00AM (#16358302)
Worst I've seen is a CMS site which, with caching disabled, used upwards of 40,000 queries to load the homepage.
Re:Appropriate Uses for SQLite by hinkley on Monday February 12, 2018 @12:13PM (#16360061)
When the app is being dumb, people put caching in to hide the data flow problems. When the data flow problems are hidden, they multiply, and then turning it off again is highly improbable.

Caching has sucked all the fun out of too many projects I’ve been associated with.

Do cache headers and cache busting first. You can always put a transparent cache in front of your REST endpoints in prod. After debugging the browser caching. Don’t write your own caching implementation. Please.

Re:Appropriate Uses for SQLite by shoover on Monday February 12, 2018 @11:10AM (#16359541)
Please tell me you held down the zero key accidentally ;)
Re:Appropriate Uses for SQLite by collyw on Monday February 12, 2018 @09:29AM (#16358748)
Its common for people who don't know the Django ORM well to use it in a way that produces a lot of queries.
Re:Appropriate Uses for SQLite by Cyberdog on Monday February 12, 2018 @02:59PM (#16361505)
Unoptimized Drupal sites of moderate complexity with caches disabled (a use case only intended for development workflows, but it's of course quite simple to run a live site under such situations) can easily invoke 200-400 queries per page load.
Re:Appropriate Uses for SQLite by jackhack on Monday February 12, 2018 @08:54AM (#16358518)
Let me introduce you to the Rails ORM...