interface for datastructures for writing to the database,
db writes now in seperate thread