save both in file and db, plus a method to retrieve between interval