This is kind of a complicated question.
I used to train in Schutzhund, which is a protection dog sport based out of Germany. I've known many internationally known protection dog trainers and competitors as well.
Likewise I've had german shepherds and belgian malinois.
Your question totally depends on how much you actually expect your dog to do. As most have said, and most in the dog world will agree. If you really need to protect your family. Get a gun.
That being said, what you need to understand about protection dogs is that when you're talking about finding that dog that will truly go after an attacker, and still be a good family dog, that's a very rare animal.
All due respect to all the other dog owners here. But I don't get the sense many train in the protection disciplines.
Many many dogs will pretend to be aggressive. Like someone said, a Labrador will do that. If that's all you need that's totally fine. Nothing wrong with that. But when you're asking your dog to defend your life, that's a very different situation.
What most don't understand is that protecting you, is asking the dog to fight. And just like people, most dogs aren't fighters. They don't have the confidence for it, they don't like getting hit, they aren't controllable in that situation, etc etc. It's a great deal to ask of the dog.
Dogs only basically have 3 drives: Food, Prey, Defensive drives. Food drive is obvious, prey drive is what makes them chase balls and is basically how you train almost everything that requires them to do it quickly. Defensive drive is what makes them want to fight back. In order to train that, you have to literally make the dog think he needs to defend himself in some fashion.
It's something most trainers/helpers (the guys wearing the bite sleeve or suit) are not very good at. Do it too harshly or to early in life, and you DESTROY his confidence for life. Additionally, most of the defensive drive is being bred out of dogs today. And any decent trainer, can train a dog in prey drive, and make it look super flashy and wow you. But to the trained eye, you can tell the dog is in prey drive. And you can see that with REAL pressure, he'll cave.
If you go looking for a protection dog from a good trainer. Realistically you'll have 2 options: The German Shepherd Dog (GSD) and the Belgian Malinois. There are more obscure options, like dutch shepherds, dobes, rotties, etc but no one uses those seriously. And it's not breed bias. There are real reasons. Within GSD, there are show lines, and working lines. Within those, you'll have American vs German/European of each. You'll want working lines. Show lines are shit, on both sides of the pond. Period. The working lines are the ones that are typically sable colored. Show lines are your classic saddleback color. Within the working lines it's pretty much all European lineage. All the stuff in America is bred from European stuff. If you want to get into it, you have many sub lines of european working GSD's. You've got your german dogs, which are further divided into West German vs East german Lines. Czech lineage dogs that go back to the old Czech border patrol kennel. Etc.
I wanted to touch on 2 more facets.
Back in the 90's a lot of people/police depts/military moved to the Belgian Malinois. Which are more akin to a border collie that likes to bite. But in truth, many are going back to the GSD.
The mali is a very sharp dog. Which means he's very sensitive and on edge to things. He comes at a million miles an hour, but it's a trade off with environmental stability. They can be handler aggressive under stress, more so than that GSD as well. They're far more athletic than the GSD though. So in the sport world, they're easier to make look good. They do everything quicker, flashier, etc. But in the police/military world they're more hit or miss.
If you go buying. It's easier to find a good GSD than a good mali. And when I say good. I mean one that has most of it ALL. Good malis are out there, but malis in general are a different kind of dog.
The last big facet I wanted to touch on deals with dog types and expectations.
When you start talking real protection dogs, they basically fall into 2 categories: Sport Dogs and Protection/Police dogs.
Being a sport dog usually means the dog has more flash, MORE CONTROL, more prey drive, but may lack some of that true defensive drive. You can teach this dog to do it all. Good obedience, wants to be with you and work with you, will bite the helper with confidence, etc. But you're not truly asking this dog to protect your life. Not that they necessarily wont, but you're not hinging its worth on that.
The protection/police dog is usually very different. They usually are hard to motivate in ways other than what they want to do. They're usually more head strong and stubborn. But they're defensive drives are very good. These are the dogs that are true "fighters". They like it, they fight harder after they get hit. But this is a trade off. These are the dogs that you see police pulling off of a perpetrator cause they wont let go (they don't want to listen under stress/in drive). This is the dog that will challenge YOU as the owner if it doesn't agree with you. These are the dogs that you do some stupid "alpha role" shit and he'll rip your face off. It's really not for most people, and not for the uneducated.
A well known trainer used to tell me that he went to a european club once where they'd take a green adult dog. And to test them. They'd line the guy in a bite suit up across the football field with some chains. They'd send the dog. As the dog was coming they'd be swinging the chains and screaming and running at the dog. As the dog bit they'd hit the dog with the chains a few times. Then go grab the dog and do it again. If the dog came at the helper a second time. They'd stop and decide he was worthy of continuing training. A bit old school but it starts to paint the picture of the expectation.
Hopefully no body tries to nit pick everything I just wrote. Just trying to give you the perspective from someone who was involved with real protection dog "stuff" for a while. Please recognize that a lot of the qualities are talked about are generalities. There are exceptions to everything of course. But hope that helps.