add database structure for heartbeat and safe update mechanism for db