process from the beginning of each stream You can do that by materializing a view of the stream: You might want to frequently check the current average of each sensor. INSERT INTO readings (sensor, area, reading) VALUES ('sensor-3', 'engine', 37) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-4', 'engine', 55) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-3', 'wheel', 52) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-3', 'engine', 67) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-4', 'motor', 95) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-2', 'engine', 90) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-2', 'engine', 13) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-1', 'wheel', 92) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-2', 'motor', 41) INSERT INTO readings (sensor, area, reading) VALUES ('sensor-1', 'wheel', 45) It would be like the toll-worker adding to the running sum immediately after each driver’s fee is collected. That is why we say stream processing gives you real-time materialized views. The view updates as soon as new events arrive and is adjusted in the smallest possible manner based on the delta rather than recomputed from scratch. In stream processing, maintenance of the view is automatic and incremental. The materialized views might even need to be rebuilt from scratch, which can take a lot of time. And when you do, the triggered updates can be slow because every change since the last trigger needs to be integrated. When does this read-optimized version of your data get built? In a traditional database, you have to trigger it to happen.
#Materialize io driver
But another way is to maintain a running total, by remembering the current amount, and periodically adding new driver fees. The worker can, of course, count every bill each time. When the worker wants to know how much money is in the register, there are two different ways to find out. Imagine a toll-booth worker that collects fees from cars as they drive by. The goal of a materialized view is simple: Make a pre-aggregated, read-optimized version of your data so that queries do less work when they run.