We study a mechanism, inspired from the mechanism for generating the gauge hierarchy in Randall-Sundrum model, to investigate the cosmological constant problem. First we analyze the bulk cosmological constant and brane vacuum energies in RS model. We show that the five-dimensional bulk cosmological constant and the vacuum energies of the two branes all obtain their natural values. Finally we argue how we can generate a small four-dimensional effective cosmological constant on the branes through modifying the original RS model.