An alarm system of some sort is an excellent deterent for most situations but won't stop everything. I'm hestitant to site specific examples...
We keep dogs too, inside and out and an intruder would need more ammo than most handguns will hold. I stil don't bank on the dogs, but they do buy time.
So for us, dogs followed by enough firearms to arm every able hand... should it ever become necessary, and Lord willing, It won't.