It's hard to beat a dog as a security system. We have a mixed-breed Rotweiller, Boxer, Mastiff, and Dane.
I prefer the pistol, a Single/double Colt .357. I can shoot it without cocking, and so make no prep noise, or I can choose to cock it as a warning. It's only second to the "ratchet of doom" as far as easily identified noises in the dark go.
The way my house is laid out, there's only one entrance to the bedrooms, which is easily defended. The rest of the house, even the kitchen, is wide open and visible from that point. (Makes for great parties, too!) There's also enough ambient light from the street lights outside to be able to see clearly. So, given this, if someone tries to open the door, "Scout," our dog, will sound a warning that will make you jump out of your skin, if they still come in, she will have given me time to open the quick-access pistol safe under my bed, and told my wife to get down behind the bed. Then it's a matter of controlling that bottleneck until they submit, run, or otherwise.
IF they try to escape, I will be glad to let them go, my first priority is protecting my family, not thinning the gene pool, or enacting justice. They can't hurt my family if they're running away. If they decide to continue, then they are now attacking me, not robbing my house. Oregon is a modified "Castle Doctrine" state, which basically means that I only have to retreat as far as my home, and then retreat isn't really an option.
So, a "burglar" will likely not be killed. An "attacker" will get some after-market holes.