data write in database