Good question. I’m not totally sure but here is my best guest. The body rots because of the bacteria. If there was no air your body would rot initially, but without any air or carbon dioxide to replace that which they used, the bacteria would not survive. So the rotting process would stop. There are two types of bacteria. Some use oxygen and are called aerobic, others use carbon dioxide and are anaerobic. If there was a good balance of these I imagine that both could continue for a while longer, but neither of these will survive a vaccum. Also the vacuum will cause the body to dry out a bit like an egyptian mummy. When people preserve bodies in formaldehyde, what is happening is that the formaldehyde kills all the bacteria and dries out the tissues so that the body cannot rot and a vacuum would work similarly.
If you do a search on body farms, I bet people have tried that experiment so you can find out exactly.
Yes your body does rot after death and it is caused by a combination of things; your own chemicals and enzymes cause some breakdown of tissue but this is helped by bacteria and fungi, and if your are left out totally in the open by flies, maggots and animals!
An air tight room and a vacuum are quite different things so I think you would decompose slightly different in each. Like Sam said said the bacteria need the oxygen or carbon dioxide in the air to stay alive, an air tight room contains air so they would be able to do quite a lot of decomposing whereas a vacuum has no air so I think you would decompose less, you would probably just dry out a lot. Other things have an effect on how much you rot too like what you died of, how fat you are and what was inside you stomach when you died!
Normally the body rots because bacteria basically eat up all the tissues. In an airtight room i think the bacteria would eventually die so the rotting process would stop. In a vacuum there would be no air at all so the bacteria would also die. In a vacuum all the air inside the body (like in your lungs) would also be sucked out so you would probably look a bit squished :/