At TH 9, hogs are one of the most, if not the most, powerful attacking strategy in the game. I believe one of the common misconceptions to stopping hogs involves the giant bombs. In my opinion having 2 DGBs is a good, but NOT the best, defense against hogs. It's impossible to have 2 pairs of DGB where neither can be tripped by the KS during the AQ kill. If you have the AQ and two pairs of DGBs 20 tiles away from each other, attackers can just send in 10 sacrificial hogs to eliminate all of the DGB because their distance from the AQ forces them to be reasonably close to the exterior of the base . Hogging is very dependent on spells and having 2 DGB, causes the attacker to only use 2 spells to eliminate them. A jump for the KS and a pre-heal over the other DGB set, leaving 1 or 2 remaining heals for the attacker to play with.
I believe the best defense against hogs to divide base into sections to slowly chip away at them. The days of watching attackers drop a pack of 20 hogs pathing into a DGB are over. Attackers are smarter, but as defenders, you have to be able to out-smart them. For instance with GoLaLoon, some attackers use the ADs to 'bait' or trick attackers into attacking from one side because the rest of the base can defend against air. By doing so, it only gives the KS one viable option to approach from, but the value the KS obtains is minimal. The attacker could come in from the opposite side and take the ADs with the SAMs, but then it's incredibly difficult, if not impossible to take out the AQ. The concept can be applied to hogs. Instead of the ADs, attackers look to eliminate DGBs with their KS. Since you know attackers will want to take out your DGB before with their KS, you may as well give them one, rather than letting them choose. Now you may think I'm crazy, but hold on a second. If you have a base with 1 DGB and two singles, I bet you that 99% of attackers are going to think it's most efficient to take out the DGB with KS before even evaluating the rest of the base. A lot of people make the effort to put BOTH their DGBs opposite the AQ, but since it's always going to be possible to trip a DGB and grab the AQ, what's the point?
It all boils down to the spells. Instead of having 2 DGBs, if you have 1 DGB and 2 singles, the attacker will likely have to take a jump to kill the AQ and eliminate the DGB while also pre-healing over the remaining 2 single GBs. Even though the singles don't necessarily kill hogs, it forces a heal in not necessarily the best place which is crucial. If you know the location of the heals before the raid even begins, then you know which areas of the base the attacker isn't going to heal and you can use those to chip away at hogs. I'll explain this more in detail below.
The Barbarian King
Often overlooked, the BK can be a great defense against hogs if used effectively. Generally people like to put their BK near the AQ to protect her, but this ultimately means that the KS will take out both heros during the hybrid. Since they're going to take out your AQ regardless, you're better off putting the BK on the far side of the base to keep him alive. To keep things in perspective, a lvl 25 BK does the same DPS as a lvl 9 AQ. Even on bases that have a lvl 9 AQ, most people are going to aim to take out her out beforehand. In retrospect, on a base with a lvl 25 BK, most people wouldn't plan to deal with the BK beforehand, nor would they know how too. They often prioritize the AQ and overlook the BK, but it generally turns out not to be an issue since most people don't know how to use their BK to defend against hogs.
The BK isn't that effective against hogs, because the hogs are constantly outrunning him. In order to counter this, you want a bunch of defenses close together to stall hogs. Not necessarily a bunch of DPS. Sure you can put 4 teslas all together with a BK, but then you would already assume a heal there. Instead you can use other defenses with HP that the attacker wouldn't want to heal over. ADs, Xbows, mortars, WTs. Having these defenses relatively close together stalls the hogs and gives the BK more time to smash them.
Figure 2: Barb King covering a lot of defenses.
Springs
While this is obvious, springs are usually one of the last resort defenses against hogs. In order to maximize their effectiveness, springs should be placed in the first layer of defenses where they're difficult to avoid, but have to be faced early on. You don't want to place springs in the core of your base because the hogs will have destroyed most of the defenses by the time they reach them, rendering them useless. Ideally you want springs between two defenses so hogs would run over them, but surgical or asian wall deployment can cause hogs to avoid them all together. Instead springs are a good solution to protecting teslas. Effective teslas are placed behind defenses instead of adjacent to them to avoid tanking onto giants. If you have two defenses side-by-side attackers will two-finger drop on the defenses so hogs kill them simultaneously and avoid the spring in between. By having the teslas behind the first layer of defenses, no matter how hogs are deployed, they're still going to approach the tesla from the same direction: from the front.
Another fancy way of using springs is to use trash buildings to funnel hogs so they approach the defense from one tile. Since hogs can't run through buildings, they'll run around either side. Since you know which direction the hogs will be approaching the defense from, you can use a trash building to funnel the hogs into a one tile space before they spread out 2 or 3 tiles along the edge of the defense. In figure 3 below hogs will take the shortest path of least resistance from the xbow to the WT, they'll run along the wall once they destroy the xbow toward the WT. Placing a spring and using another building to force hogs into that 1 tile region almost guarantees 3 hogs every time.
Figure 3: Spring with trash building to help funnel.
Teslas
Teslas dish out the most DPS in the game and it's surprising how many people don't seem recognize this. How many times do you see a TH 10 freeze an xbow instead of a tesla? It drives me nuts. In order to maximize their effectiveness, you need to use every feature of the teslas to your advantage.
For one, their trigger radius is smaller than their attacking radius. Meaning that a giant could be 7 tiles from a tesla within the attacking radius, but not tank the tesla because it hasn't been triggered. Therefore, I find teslas to be most effective when they're 3 to 6 tiles behind the outermost wall. This way they're deep enough that they don't lock onto giants, but they do lock onto hogs once they jump over the wall onto the cannon. In figure 4,, the tesla is close to the edge of the wall, but the exterior cannons draw giants making it impossible for them to enter the tesla trigger radius. The trash buildings also funnel hogs directly into the springs to protect the teslas.
Figure 4. A tesla that cannot be tanked by a giant
Second is their size. Teslas are 2x2 in size, meaning that hogs have less room to line up along the side. If a pack of hogs runs into an xbow, they'll all line up along the side, spreading over 3 tiles. Since teslas are only 2 tides wide, hogs going to end up staying closer together making springs more likely to spring 3 hogs.
Lastly is their 'stun' feature. Teslas stun all attacking units by resetting their attack. For loons this is really useful, because it takes loons roughly 5 seconds to drop their bomb. If a tesla stuns a loon that's half a second from dropping it's bomb, then it has to restart and essentially costs the loon 4.5 seconds of time. The same concept applies to hogs, but since hogs attack every one second, the effect is less noticeable, but is still there. In theory if you could have 4 teslas pop 1 second apart from each other, you could essentially delay attacking DPS for 4 seconds. Even though this is near impossible, causing the hogs to waste an extra second or two to kill a WT is substantial. Let's say you have 2 teslas and 2 WTs, if the teslas pop a second apart that's 2 seconds of wasted DPS and additional 160 damage to the hogs from the WTs.
Wizard Towers
Dual wiz towers are really effective against loons and hogs. They essentially become an archer tower dealing splash damage.