Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is something I've been through before.

The first version of an app I worked from was very SQL heavy. Almost every calculation was done in a stored proc and the app servers just formatted that.

As the product got popular this became the bottleneck. It's far easier to get more app servers than DB servers.

So we restructured it to do straight index reads and aggregations in the DB, but more complex calculations in the app itself.

It all depends on the circumstances, but I'd still advocate pushing as much in to the DB as you can without making convoluted SQL - your average RDBMS has amazing optimisations for aggregation, sorting and filtering.



But the problem with doing it on the app is that when you are joining huge rows, all of this unfiltered data gets sent over a relatively slow 100-1000 mbit port.


We push data over 10Gbit - 40Gbit ports, but the point still stands.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: