Everyone has a cache for database results, right? Something like redis or memcached to prevent unnecessary and comparatively slow calls to the database. No? Worry not, for with Postgres and some trigger magic, we can produce a cache where there was none before. Don’t let complicated and expensive queries limit your application throughput when you really need to put the pedal to the metal. Let us show you how!
Interesting. I always thought triggers will turn out to be an expensive overhead and avoided them. Now I know I should have benchmarked my gut feeling 😅