Compound is always more safe but off course expensive than the villa/apartments.
Normally safety is not a big issue here in Qatar, as we didn't heard any such case.