have to differ a bit with some posts here.
You should absolutely NOT focus on military unless you plan to destroy Shaka very early.
Here is why;
Attila is a total pansy, he will just send a bunch of rams over. Rams can not attack units, just plant spearmen in their way and pick him off with archers. Assuming you settled defensive positions (river hills), Attila is about the easiest civ with an early unit to beat, so just basically ignore him and kill his units when/if he DoW's.
Shaka is a whole different animal. CB's are useless against Impi, so making a bee line to construction does absolutely nothing for you, and will in fact make things much worse. Bee line to education, then back track down to machinery, grab construction on the way only if he DoW's early - his spearman rush is easy to beat.
The reason you want to head to education first is because you also get civil service on the way. Swords are absolutely useless, so you need pikes for blockade duty, and x-bows to kill his Impi. Shaka will tech slowly on all difficulties, so you have plenty of time even on Deity to take machinery after education, and on King you should have absolutely no problem out teching him. 2 to 4 pikes depending on terrain is needed to protect your range units, and 3 to 5 x-bows to pick everything off. If you try to just run military techs, he will gain tech parity then advantage, and you are giving him more time to build a bigger army.
Alternately, get the NC up, tech phylo, build 4 archers and upgrade to CB's, and go take his capitol. Shaka always neglect his own defenses early, and is one of the easiest civs to take down in a CB rush.