Hacker News new | ask | show | jobs
by canada2020 1264 days ago
But when do you refresh the materialized views?
4 comments

In SQL Server it is part of the transaction that affected the underlying data. So you don’t worry about that. Instead you worry about lock escalations!
Lots of strategies are possible. I may only need to refresh the data in it once a day. I may need to refresh it on every write. It depends on the applications needs.
I see. Given it’s so flexible, is this pretty much like a caching layer?
For us, real-time refreshes weren't necessary. So we ended up refreshing it every 12 hours through application crons.
Presumably when underlying data are updated.