The defenses available at TH9 are enough to defend against other TH9 attacks and limit them to only 1 star. As a new TH9, just avoid being 3 starred by other TH9s. Being 2 starred by a strong th9 is also a win but not the best that you can do. However, once you get maxed, you should not be 3 starred by other TH9s. Unless they are really good, by this time you are strong enough to prevent 3 stars or sometimes even 2 stars on your base.
XBow
Of course, the biggest new addition to your defenses is the xbow. The xbow provides two options, a ground mode and an air-and-ground mode. The ground mode has a longer range but only shoots at ground troops while the air-and-ground modes shoots at both but with a slightly smaller range. As I am sure you already know, ground mode is great against ground attacks but is weaker against air and vice versa. Personally, I set both my xbows on ground because I am not as worried about air attacks. See below for air defense information.
Even though ground/ground-and-air mode is a huge factor, take into consideration the placement of both xbows. Having them too close together limits their long distance range (ground mode) and reduces the time that they can hit troops. But placing them too close to the edge allows for attackers to easily take out the xbow. Thus, finding a good way to find the perfect balance between protection and range is key for good xbow placement.
Archer Queen (AQ)
Even though most people consider the AQ to be solely an offensive weapon, she can also be great on defense. Most 3 star attacks, such as goho, govaho, golaloon, or lavaloon, have a “kill squad” that has the sole purpose to take out the queen and the CC troops. Hence, the placement of the AQ is very important. However, if you choose a ring base or some sort of base that has open compartments to reroute troops around the base, do NOT place the queen in the middle as this allows an attacker to use the queen to draw his troops toward the center of the base, which is what you are trying to avoid.
War Bases:
this base is hard to 2 star at th9 and can be anti 3 star against th10s.