Glycogen, a large alpha-glucan, is a ubiquitous energy storage molecule among bacteria, and its biosynthesis by the classical GIgC-GIgA pathway and its degradation have long been well understood - or so we thought. A second pathway of alpha-glucan synthesis, the four-step GIgE pathway, was recently discovered in mycobacteria. It requires trehalose as a precursor, and has been genetically validated as a novel anti-tuberculosis drug target. The ability to convert glycogen into trehalose was already known, so the GIgE pathway provides a complementary way of cycling these two metabolites. As well as containing cytosolic storage glycogen, mycobacteria possess an outer capsule containing a glycogen-like alpha-glucan that is implicated in immune system evasion, so the GIgE pathway might be linked to capsular alpha-glucan biosynthesis. Another pathway (the Rv3032 pathway) for alpha-glucan biosynthesis in mycobacteria generates a methylglucose lipopolysaccharide thought to be associated with fatty acid metabolism. A comparative genomic analysis was carried out to evaluate the occurrence and role of the classical pathway, the new GIgE pathway and the Rv3032 pathway across bacteria occupying very different ecological niches. The GIgE pathway is represented in 14% of sequenced genomes from diverse bacteria (about half as common as the classical pathway), while the Rv3032 pathway is restricted with few exceptions to mycobacteria, and the GIgB branching enzyme, usually presumed to be associated with the classical pathway, correlates more strongly with the new GIgE pathway. The microbiological implications of recent discoveries in the light of the comparative genomic analysis are discussed.