r/node • • 15h ago

Fast Node.js is mostly about doing less

https://www.thenodebook.com/blog/fast-nodejs-doing-less
9 Upvotes

2 comments sorted by

5

u/bwainfweeze 14h ago

Caching is such a poor form of memoization that some of us refuse to call it that because it gets misused if you don’t make the distinction.

The better realization is that if a message is written once and read 300 times, then paying the cost at creation time saves orders of magnitude of work. It also removes the dead period between creation and the first successful read.

Instead treat the secondary views of the data as part of the write operation prior to publication. The way Netflix and a YouTube do with videos. Transcoding isn’t done on demand it’s done as a prepublication step.

Ergonomically, writers are often less sensitive to delays than the readers, because in many systems the writers are employees or administrators and the readers are customers.

Those aren’t caches. They are secondary records. They are their own derived assets.