My mother's house was broken into 4 times while she was at work. Once, when she was ill with a migraine (I had to take her to the ER because her temp was way below normal), I visited her. She had a handgun on her nightstand. She, who had never handled a gun before, and had no training about that at all). A friend gave it to her so she could shoot any person who broke into her house while she was there.
I forced her to give it back to her friend. I called my brother, and he gave her his beloved Rottweiler. He had to trick her into taking the dog by telling her he was going to take it to the pound if she didn't give it a home. (I'm using "it" so I don't get mixed up with the he's and she's). This was the most gentle dog my mom had ever had. She dearly loved her(the dog). Anyway, just having the dog solved the problem.
My dog, OTOH, barks like he's going to eat someone for dinner. Then, if the stranger (just to him, always a friend) dares to come into the house, the dog transforms into the happiest, most affectionate creature around. He would lead a burglar to the family silver (or whatever is valuable these days). Of course, when we lived out in the country, no one was afraid of my dogs. It was a relief. In 12 years, no crime, and we never locked our doors. Mostly because we were in the habit of that having lived in a very low crime area for 15 years before that.