magneticio/vamp

Vamp SQL persistence store flooded with workflow related records

olafmol opened this issue · 2 comments

when disabling a workflow it inserts multiple records in the SQL backend store every few seconds. It seems every disabled workflow inserts a record with a DELETE for 'workflow-breed', 'workflow-health' and 'workflow-instances' each.

screen shot 2017-10-26 at 14 41 44

Some additional info:

You have all mutations in the DB (events) and also Vamp keeps the current state in the memory - current artifacts.
For instance if you "add A", "add B" and "delete A" artifacts, you have 3 records in the DB but only one artifact B in the memory.
So you can dump memory state back to the DB (e.g. rotate DB or table) - in the above example you get the single record "add B".

and about purging/upgrading strategy involving Lifter

Using Lifter, it should:

  • stop Vamp first
  • copy state to the new DB's (or tables) - Lifter uses the Vamp code base so it's fully compatible with Vamp
  • update Vamp configuration - so the new DB/tables can be used
  • start Vamp
    You can implement persistence in classical way - data are compact by default, but using event store you can:
  • add also user information for each record - good for audit
  • better data protection because with encryption/hashing you can take into account also sequence of mutations not just their content (you can't just inject or remove a row)
  • supporting new DB, updating schema etc. is rather simple
    Also, data storage is cheap and after data compaction you can always archive old DB or even delete if you really don't want to keep the history (state is in the new DB).
    Only bigger downside that I can see is that Vamp needs to be down and Lifter needs to perform compaction now and then (otherwise also Vamp starting time increases)...

fixed in Vamp EE version.