Magnesium > Aluminum
Aluminum anodes have a few issues:
Aluminum anodes tend to swell and break up as they are consumed, aggravating sediment and raising blockage potential
Aluminum in our bodies is...not the greatest thing in the world
If an aluminum anode passivates, it may be very difficult to tell what is going on
Aluminum anodes can be difficult to ...
I go with zinc because aluminum swells more and when aluminum breaks down it can plug flow restrictor and ariators. you will need the model number of the water heater to get the correct length. I find solid rods last longer I have segmented break at the joints several times.
In 1 home I installed an electronic annode it was very expensive almost 200$ but ...