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

> If app is repeatedly asking DB for same data and it's immutable for a period -- the persistance choice is wrong

Says who? ACID databases are the norm for a reason.

> There is potentially a whole lot of memory/callstack overhead involved in a request like that even when memoised

So because there is overhead elsewhere you shouldn't optimize here?

> It likely should be in a memory structure all the time or Redis if sufficiently complex / shared across processes etc. as all the other processes will likely be doing same

Redis doesn't help if the issue is the network io. Accessing anything out of process memory will objectively be slower than accessing in process memory. Doesn't matter if the data is coming from pg, redis, or wherever. If its going across the wire, there will be io latency.

> Only in Ruby world would someone say yeah what we need right there is a Gem with some define_method sprinkles

Ah, I see this is based on a negative view of ruby in particular. Memoization is a common pattern in basically every language, and can net significant performance wins with very little effort (low hanging fruit). Is it a magic bullet? Nope. But it's nice to have in the tool belt when dealing with an app that's falling on its face and every improvment means you get to sleep better at night.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: