Generally speaking I tend to go with Deflector shield, especially against the AI, but it really depends on the situation. Starbases have a hard time regenerating health, especially a starbase in a key chokepoint system under continuous attack; even if the amount of healing isn't too huge, a defensive starbase gets great use out of the debris cloud. While the deflectors are great on defense against the AI, a human opponent (or an AI who gets lucky) will surround the starbase and hit the unshielded side far too often.
An offensive starbase (one you build in an enemy well) attempting to destroy a defending starbase gets far more use out of deflector shield, since it'll always be facing its biggest threat.
But honestly, both are a bit iffy in my opinion when compared to the more mundane defensive boosts; you shouldn't consider either of these until you get to at least level 3 defense (12k base HP, +9 armor over the baseline), because so much is tied up in those core stats.
Compare a starbase with two ranks of defense and one rank of deflector shield to a base with three ranks of defense. The latter has +3 armor, meaning ~15% less damage from every source (barring those few not affected by armor). It also has 12k HP (before tech modifications) instead of 9k, giving it 33% more survivability (with HP regeneration increasing proportionally). Those, together, would give that base more than 50% more survivability than the one with the shield; even if every enemy was on the side with the shield, the fact that it's off part of the time would still make that come out about even. And a shield is dependent on antimatter, which can be drained, and is an ability, which can be blocked/interrupted/suppressed/whatever.
So, generally, for my "combat" bases I'll buy three ranks of offense, three or four ranks of defense, and the last one or two are flexible and will usually be something like the deflector. The notable exception are bases at a central star; since you can fit FOUR starbases in the star's well, I usually go 3 offense/2 defense/3 hangar for three of them, and the fourth loading up on utility stuff (phase stabilizer, trade port, etc.) instead of the hangars. No reason to go heavy on defense with THAT much firepower around; having forty or fifty fighters and bombers will do wonders on anyone passing through the well, and if they try to assault the bases, four stacked 3-offense bases will rip anyone apart quickly.