First version with read and update database