3 ms·
My experience has been, especially if your application layer's in a scripting language, pushing as much data-fiddling to the DB as possible will save you seriou
by shantly 7y ago
My experience has been, especially if your application layer's in a scripting language, pushing as much data-fiddling to the DB as possible will save you serious performance headaches down the road, even if the application layer implementation looks OK at first. They're all really slow and memory-inefficient, and often moving that stuff to the application layer also means more queries (else, typically, why not do it in the DB?) which means more network latency, which an be a real killer. In a lot of cases fixing the performance means, at the very lease, re-implementing a bunch of what your DB already does to support fast & efficient data manipulation.
I've also seen the application change on top of the DB way more than I've seen the reverse, so I'm inclined to avoid putting data manipulation in the application when possible. That way it's there, for free, when we need a second application to access the same thing, or when we break off some chunk of a program into its a separate service and re-write it in Go because it turns out to be a performance bottleneck, or WTF ever.
- deleted 7y ago[deleted]
- UK-Al05 7y agoThe problem is when the database becomes the performance bottleneck. Scaling a database is incredibly difficult, and requires a lot of expertise. Some of the biggest engineering projects I've been a part of is removing a central db that everybody connects to in large companies.
- kragen 7y agoMy past experience generally agrees with yours, but I'm not confident that it generalizes to recursive CTEs.