It was routine for homeowners to hire armed nightwatchmen. In Nigeria, we had a Touareg guy, with a scimitar. In Morocco, our neighbor had guys with machine guns (which meant we didn’t need much more than a wall), but we lived in a nice area. Our neighbor had some relation to the King. In Uganda, our watchman had a staff (and a holstered pistol).
South Africa has so much crime, that even the poorest neighborhoods have broken-glass walls.