Initial code for more efficient db data sync