How not to structure database-backed web apps: performance bugs in the wild
Give me an O! Give me an R! Give me an M!<p>What does that spell? SLOW PERFORMANCE!<p>Todays programmers dont understand data. They understand frameworks. To find the nr of all cars that are out of insurance they write:<p><pre><code>    10 Nr=0
    20 Hey framework, give me all cars!
    Framework: Ok, here are 8001093 business objects representing all the cars in our DB. Each has all the attributes the car has. Color, mileage etc.
    30 Thanks!
    40 Foreach Cars as Car
    50 If Car-&gt;insurance_end_date &lt; FancyDateLib.now() Nr++
</code></pre>
I see variants of this everywhere. And the performance impact is just untoppable. It&#x27;s often several million times slower then a simple sql query.<p>But beefy hardware with lots of ram and memory takes care of it. &#x27;Our software is enterprise grade, so of course it cannot run on commodity hardware&#x27;.