As the primary raw material for Baijiu brewing, sorghum variety exerts an intricate influence on the taste profile of strong-flavor Baijiu. However, how sorghum variety comprehensively affects Baijiu flavor formation through fermentation by microorganisms and metabolites remains largely unknown. Using 16S&ITS rRNA gene sequencing and non-targeted metabolomics, in this study we comprehensively analyzed the changes in microbial communities and metabolites during fermentation of a glutinous and non-glutinous sorghum variety. The results showed that these varieties significantly affected microbial diversity and community structure, and their interactions, among which, there were particularly complex interactions among bacterial communities, while the effects of "functional differentiation" and "community aggregation" of fungal communities were prominent. Furthermore, three bacterial and nine fungal genera were identified as core microorganisms related to changes in glycerophospholipids during fermentation, that led to a change in ester content, ultimately improving Baijiu quality. These findings provide reference for the selection of brewing materials.