When I was a kid living overseas in an Asian Country, the house we lived in had a nice high concrete wall with broken glass cemented into the top of it. All of the windows had bars on them even the Garage had a barred cage door. You might have thought we lived in a prison and therefore was ‘safe’.
Ha! The thieves could break in, strip you bare in less than five minutes if they thought you had something they wanted. I learned there that one of the best defense was total obscurity, drive a dirty looking vehicle, wear plain looking clothes, try to blend in, even if that worked only from a distance. It could mean a big difference, if you were being profiled in preparation for... whatever.
I worked in several posts in Africa that were a bit shaky. Many of the staff quarters were away from the embassy and were protected, as you described, with high walls with broken glass embedded on the top. Many of the quarters also had “rape rooms,” usually the master bedroom, protected by bars. I stayed in one in Lusaka, Zambia, like that. It also had a local unarmed guard patrolling during the night. Just to be safe inside the Rape Room, it was best to keep a shotgun.