News for hackers. Stuff that matters.
Re:How I Reduced My DB Server Load by 80% by ebiester on Monday October 09, 2017 @02:33PM (#15436293)
So, you update a 5,000+ line file every time you need to change a query?

What do you do when you have five similar queries, and each needs to be changed if one changes?

This seems like smaller projects might work, but I'd be concerned about using a strategy on a larger project.

Re:How I Reduced My DB Server Load by 80% by bpicolo on Monday October 09, 2017 @02:54PM (#15436449)
Here's a clojure library designed around it. (https://github.com/layerware/hugsql)

Not a fan of this strategy in particular, but I can see arguments for it.

Re:How I Reduced My DB Server Load by 80% by mamcx on Monday October 09, 2017 @03:50PM (#15436879)
>What do you do when you have five similar queries, and each needs to be changed if one changes?

In short, I truly utilize a DB with full effects.

I don't follow the mantra of using a DB "only" as a dumb datastore. Something that I get validated as when people use NoSQL and have not option that use all of it.

This mean, that I use views and stored procedures/functions.

This cut a lot. Also, proper modeling of tables also help (a lot). I refactor DBs.

I mean, I truly treat a DB as "code".

Obviously, this strategy is not flawless, and it will benefit from some kind of ORM-ish layer to auto-generate the mechanical parts of the querys. I'm building that part myself.

But so far, is have show to be good.