Hacker News new | past | comments | ask | show | jobs | submit login

So long as everyone, everywhere, always remembers to calculate it in the same way for all inserts and updates.

This seems a lot more robust to me.




You can use abstractions that push such code out of the developers concern, into the "code infrastructure" layer.

But there are also plenty times where I'd rather compute at the database side; there are no silver bullets.


And then someone at support comes along and updates the data via SQL and forgets to update the derivative field because he got woken up at 2am for an emergency.

Using a computed column ensures the data is consistent.




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

Search: