I just watched Turning the database inside-out and noticed a similarity between Samza and Redux: all state consists of a stream of immutable objects.
This made me realize that if you edited the stream after-the-fact, you could in theory regenerate all materialized views based on the new list of transactions and in effect "undo" a past change to the database.
As an example, suppose I had the following series of diffs:
1. Add user "tom"
2. Add user "bob"
3. Delete user "bob"
4. Change user "tom"s name to "joe"
5. Add user "fred"
After this series of changes, our database looks like:
+-------+
| users |
+-------+
| joe |
| fred |
+-------+
Now what if I wanted to undo number "3"? Our new set of diffs would be:
1. Add user "tom"
2. Add user "bob"
4. Change user "tom"s name to "joe"
5. Add user "fred"
And our database:
+-------+
| users |
+-------+
| joe |
| bob |
| fred |
+-------+
While this sounds good in theory, can this actually be done using Samza, Storm, or Spark? Can any transaction-stream database do this? I'm interested in such functionality for administrative purposes. I have some sites where clients have accidentally deleted an employee or modified records they didn't mean to. In the past I solved this by creating a separate table which recorded all changes to the database, then when an issue arose I could (manually) look at this table, figure out what they did wrong, and (manually) fix the data.
It would be SO much cooler if I could just look at a transaction stream, remove the bad one, and say "regenerate the database"