Persist changes to database