Use SQLite or possibly BadgerDB. This includes recording the chain-sync cursor information so the sync can be resumed after a restart.