Implement database backend for buffer-activity patch