You should try to place structures close together and place as many walls as you can between your resources.
The attacking troops will have to break through the wall to move forward and it will give your defense additional time to deal with more damage.