Mixing AC and DC power in a circuit
Some triacs, when controlled from a unipolar DC to the gate with respect to MT1, won't always conduct when the AC cycle goes negative i.e. they'll trigger during the positive cycle and reset as the voltage falls through 0V and won't retrigger again until the next positive cycle. The 2N6071 I have used before and this was OK - with unipolar DC control on gate the triac was basically equivalent to a closed contact.

Gate current needed to activate (say) the 2N6071A will need to be in excess of 10mA so this is a consideration to how you drive the gate from a MCU pin (quadrant IV is always the worst culprit for triggering with any triacs it seems). 2N6071B needs 5mA to guarantee conduction 360º.

If there is any doubt about the AC voltage possibly being at unsafe levels (i.e. connected to incoming main AC power) I'd use an opto triac circuit to isolate. BUT, with such a small working AC voltage (21Vac) trying to "manufacture" a gate drive circuit that "steals" power from the AC means volts dropped in driving the load.

So, given all this I'd probably go for a relay drive circuit unless you are totally happy that the AC you are switching is reasoably isolated from the incoming main AC