Persistent counters

I’ve implemented the counter component but discovered that it’s value wasn’t persistent. Since I frequently adapt my system and would need to keep the value for a month, this is pretty suboptimal. Is there any way of making this persistent while keeping it easy to work with?