This paper studies the following three problems: when does a measure on a self-similar set have the volume doubling property with respect to a given distance? Is there any distance on a self-similar set under which the contraction mappings have the prescribed values of contractions ratios? And when does a heat kernel on a self-similar set associated with a self-similar Dirichlet form satisfy the Li-Yau type sub-Gaussian diagonal estimate? These three problems turn out to be closely related. The author introduces a new class of self-similar set, called rationally ramified self-similar sets containing both the Sierpinski gasket and the (higher dimensional) Sierpinski carpet and gives complete solutions of the above three problems for this class. In particular, the volume doubling property is shown to be equivalent to the upper Li-Yau type sub-Gaussian diagonal estimate of a heat kernel.