Discrete Ricci curvature of metric spaces and Markov chains