ring buffer refactor, sqlite commits on worker thread