Added support to not keeping all DB records in memory