if your waking in pain I would definetly try not to sleep on your back.

You don't have to sleep completley on your side iether though.

You can sleep with a pillow under half your bum, just to prop you on a little angle.
It's mainly to take the pressure off your back and the blood supply that goes to your legs and bubs. I think it's the inferior vena carva. Although sleeping on your side can encourage bubs to move into position.

I have been lucky an havn't had too many problems with sleeping. I wake up on my side, no matter how I go to sleep.