Forum: Managing VoltDB

Post: How to keep daily/weekly worth of data and auto delete old data

How to keep daily/weekly worth of data and auto delete old data
energyd
Nov 19, 2015
Hi there,
I'm designing an application that constantly dump live data into voltDB. The data is gonna fill up the memory pretty quickly (like a week), I need to put in some mechanism that could cleanup(and persist to disk) old data so that I only keep the most recent one week worth of data in the DB. How do I make this happen?

Di
pzhao
Nov 23, 2015
energyd,
So we have a few approaches to cleaning up data. Here's the documentation on selective data purging:
Limit rows - http://docs.voltdb.com/UsingVoltDB/ddlref_createtable.php
VoltDB Blog of Aging data - http://voltdb.com/blog/aging-out-data-voltdb

Assuming you get a very predictable and constant amount of data each week, I'd suggest our export data feature and a stored procedure that will insert the last week's worth of data into export table and then deleting the exported data.

The chapter on exporting data is located here: https://docs.voltdb.com/UsingVoltDB/ChapExport.php
For your information, @SnapshotSave system procedure can be utilized to save a table's data to csv.

Peter Zhao