Get the latest tech news

Row Embedded Cache: Experimenting with a new pattern of caching


I've been experimenting with a new pattern of caching which uses types in Postgres to cache all relations of a particular record, within that record. It sou...

Orders are often shown in lists on many pages, and what needs to be displayed comes from the relations and other expensive calculations (e.g., total calculations, shipping costs) I don't want to have execute expensive LEFT JOINS especially as this data rarely changes (mostly on refunds) This felt like overkill because it made multiple network calls to display a simple list. It's not a silver bullet, nor is it sophisticated or technically impressive, but it is simple enough to make client code clean and makes cache invalidation easy: you have to update the record you're invalidating the cache for and don't have to dance through network traffic.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of new pattern

new pattern

Photo of Row Embedded Cache

Row Embedded Cache