EDIT: The following post was written before the update which introduced the wave attack system and so is now partially outdated. Read the posts following for more current advice and tips.
I have already posted a guide on defending but it's very basic and is really for explaining to new/inexperienced players about how to defend. This guide will be focused on how best to defend an attack of 700-1000 strong units packed with ruby tools for levels 35+.
When defending an attack this large it is important to realise that the way you set up your tools and flanks can save you hundreds of defenders. If you are in a position where you are going to win anyway because of lots of support from your alliance or because of your own large defense numbers, the most important thing is to reduce losses so you have minimum rebuilding and can take on possible extra waves of attackers.
The most important thing when defending with large numbers is to make sure you do not get the -30% when fighting in the keep by losing on all the flanks. This is devastating if say 400 travelling knights make it thought to your keep and is where HEAVY losses are sustained which are UNNECESSARY!
TOOLS
If we take an example of 3 moat defense tools being used in a slot the difference between wooden stakes (35% each) and fire moats (110%) is 225%. This is the greatest difference between the effects of resource and premium ruby tools but it shows how much of an impact they can have on your battle report.
It should go without saying that for a large incoming attack you should always use your best tools which will hopefully be ruby ones.