What you see is a wow defence with scouts shielding the archers and mech from scoutbombs
You need:
6.3 scouts per archer (630k per 100k)
22.6 scouts per ballista (226k per 10k)
12.6 scouts per ram (126k per 10k)
30.1 scouts per pult (301k per 10k)
On top of those base figures you need enough scouts to allow for losses when bombed or scouted.
The benefit of using scouts is that unlike fodder, you don't have to move them out when attacked by archer rainbows so they work for bomb/rainbow camped attacks. Also, they are much more useful than fodder (attack, scouting, anti-scouting, bragging rights)
Mech waves can be defended by sending out your archers and fodder and using a ballista wow. The minimum balli should be 20k. if in the mech wave sent their are NO phracts then you also need at least 100 pults, if phracts are sent with the waves then just balis will do it
also if they are sending mech wow wave, lets say 60k balis and 35k pulta with a rainbow it's best to have 4k pults in your city defense also ....so you need 20k balis 4k pults and scouts for mech defense
defending: to defend against Arch waves that have a rainbow with them move ALL fodder out of city (war's, pikes, cav, and so on) just leave arch, balis and scouts (and pults if you got them) using this method they can send millions of arch at you and you will only lose a few hundred arch on each hit
Traps: ok traps are totally worthless and in some cases actually hurt your defending they do almost nothing and just take up space that could be used for abt or towers.
Gates: to defend the right way you should open\close gates depending on the wave that is coming (close gates on SB's and anything you dont think you can kill),
Spam waves: when someone is sending spam waves at you (1000-5000cav, phrats, and scouts) then move out all fodder except warriors, instead of killing any arch they will kill a few hundred war's on each hit.
p.s. it's good to have a couple thousand abt's in a city but remember the more you have the more they will kill on each hit when you get down to 10abts they will only kill 1 on every hit no matter whats in the wave.