Simple database flushing mechanism