Initial implementation of the persistence in database