Geometry and Invariance in Stochastic Dynamics