I'm in the handgun crowd for home defense, even though I also have a handful of other guns as well. Shotguns are great, until you have to shoot past someone you don't want to hit.
Glock 19 Gen 3 9mm with a flashlight on the rail and tritium sights, standard 15 round magazine, I keep a round in the chamber. Having a light on your weapon and shining it on someone can immediately ID friend from foe, and potentially even cause the assailant to run away. A 15 round magazine can be sufficient when dealing with 2-4 assailants. I've carried both 1911s and Glocks as sidearms, have thousands and thousands of rounds through both, and would trust my life to a Glock over a 1911, just my opinion. ( I still love 1911s though)
In dynamic situations like a home invasion many things are out of your control. Being able to shine a light and fire your weapon with one hand and still have one hand free is extremely advantageous for a number of reasons...
1. you can engage a shooter while on the phone with the police (you laugh, but this can help you in court)
2. you can gain control of someone like a kid, or someone in your house to move them if necessary if they aren't responding to your verbal commands (think freaked out child in the middle of the night waking up to loud noises, they aren't going to be as responsive as they should be when you're directing them to safety, you'll see this same thing with PSD units or Secret Service, they take physical control over who they need to keep safe)
3. you can still fight if one of your arms has been hit and you lose the use of it
4. you can open a door with your weapon close to your body and at the ready very quietly
If you live somewhere that round over penetration is a consideration, look into frangible rounds.
As others have said..... train, train, train. Learn some first aid as well, how to apply a pressure dressing and a tourniquet (this can literally be the difference between life and death and is very simple to learn)