db overhaul
active record for cache