▲ | mike_hearn 7 days ago | |
Yes the idea it's newfangled is odd. It's only newfangled if you ignore the existence of database engines that are better than the open source ones. Oracle's implementation scales horizontally and can do incremental view maintenance using commit logs: https://oracle-base.com/articles/misc/materialized-views But it may not even be necessary because Oracle also supports query caching both server and client side. By default you have to opt-in on the query level:
but if you do then queries might not even hit the database at all, the results are cached by the drivers. The main limitation of that feature is that it's meant for read-mostly tables and cache keys are invalidated on any write to the table. So for aggregating counts in a large multi-tenant table the hit rate would be low and a materialized view is more appropriate.It's a bit unclear why the author of the article ignores triggers as not "in vogue" though. That's supported by every DB and will work fine for this use case. You do have to learn how to use these features but it can save a lot of work, especially when introducing non-consistent data sources like a Redis cache. Consistency is so valuable. Disclosure: work for Oracle, opinions are my own (albeit in this case, presumably highly aligned). |