We study a microscopic derivation and the properties of the Dzyaloshinskii-Moriya interaction (DMI) between local magnetic moments in ferromagnet/heavy metal heterostructures. First, we derive DMI by Ruderman-Kittel-Kasuya-Yosida interaction through electrons in a heavy metal with Rashba spin orbit interaction (SOI). Next, we study the dependences of the DMI on the Rashba SOI, lattice constant, and chemical potential. We find that the DMI amplitude increases linearly when the Rashba SOI is small, has a maximum when the Rashba SOI is comparable to the hopping integral, and decreases when the Rashba SOI is large. The sign of the DMI not only changes depending on the sign of the Rashba SOI but also the lattice constants and the chemical potential of the heavy metal. The implications of the obtained results for experiments are discussed.