write on database once for a new graph