Materialized views are obviously useful – Sophie Alpert
As programmers we spend a lot of time shuttling data back and forth between different systems and transforming it from one format to another. Sometimes it gets pretty miserable! Let’s say you’re making a fancy task tracking app. Tasks belong to projects, and on the projects page, you want to show how many tasks are in each project. Maybe you start with a little SQL that you call from your “get info about project” view model code: Wow! So easy. Uh oh, someone is tapping you on the shoulder and saying this is too slow because it has to do a complete index scan of the tasks for the project, every time you load the page. That’s fine, we’ll just put a… Redis cache on it? Works great. It’s fast enough. (Technically speaking, if 100 people load the same page at the same time and the cache isn’t populated yet, then we’ll end up sending 100 queries to the database which isn’t amazing, but let’s just pretend we didn’t hear that.) Unfortunately our users are complaining that the count is wrong a
Materialized views are obviously useful August 22, 2025 As programmers we spend a lot of time shuttling data back and forth between different systems and transforming it from one format to another. Sometimes it gets pretty miserable! Let’s say you’re making a fancy task tracking app. Tasks belong to projects, and on the projects page, you want to show how many tasks are in each project. Maybe you start with a little SQL that you call from your “get info about project” view model code: async function getTaskCountForProject ( projectId ) { return await db. query ( 'select count(1) from tasks whe
saved by
related reading
- Everything I know about good system designseangoedecke.com
- Building data-centric apps with a reactive relational databaseriffle.systems
- Cognitive load is what mattersminds.md
- A More Human Approach To Databasesccorcos.github.io
- Against SQLscattered-thoughts.net
- Build Your Own Databasenan.fyi
- PostgreSQL View vs Materialized View: A Guidedbvis.com
- A Bunch of Programming Advice I'd Give To Myself 15 Years Ago | Marcus' Blogmbuffett.com
- Designing Data-Intensive Applications: Chapters 1 and 2youtube.com
- A Graph-Based Firebasestopa.io
- (Quite) A Few Words About Asyncyoric.github.io
- You might not need Redisviblo.se