This study was conducted to evaluate the effects of two glucogenic diets (C: ground corn and corn silage; S: steam-flaked corn and corn silage) and a lipogenic diet (L: sugar beet pulp and alfalfa silage) on the ruminal bacterial and archaeal structures, the metabolomic products, and gas production after 48 h in vitro fermentation with rumen fluid of dairy cows. Compared to the C and S diets, the L dietary treatment leaded to a lower dry matter digestibility (DMD), lower propionate production and ammonia-nitrogen concentration. The two glucogenic diets performed worse in controlling methane and lactic acid production compared to the L diet. The S diet produced the greatest cumulative gas volume at any time points during incubation compared to the C and L diet. The metabolomics analysis revealed that the lipid digestion especially the fatty acid metabolism was improved, but the amino acid digestion was weakened in the L treatment than in other treatments. Differences in rumen fermentation characteristics were associated with (or resulting from) changes in the relative abundance of bacterial and archaeal genera. The rumen fluid fermented with L diet had a significantly higher number of cellulolytic bacteria, including the genera of Ruminococcus, Butyrivibrio, Eubacterium, Lachnospira, unclassified Lachnospiraceae, and unclassified Ruminococcaceae. The relative abundances of amylolytic bacteria genera including Selenomonas_1, Ruminobacter, and Succinivibrionaceae_UCG-002 were higher in samples for diets C and S. The results indicated that the two glucogenic diets leaded to a higher relative abundance of bacteria which functions in succinate pathway resulting in a higher propionate production. The steam-flaked corn diet had a higher gas production and lower level of metabolites in fatty acids and amino acids. Most highly abundant bacteria were observed to be not sensitive to dietary alterations of starch and fiber, except for several amylolytic bacteria and cellulolytic bacteria. These finding offered new insights on the digesting preference of ruminal bacteria, which can assist to improve the rumen functioning.