Determing what to store in the db