Read and Write in database