Although the etiology of obesity is not well-understood, genetic, environmental, and microbiome elements are recognized as contributors to this rising pandemic. It is well documented that Roux-en-Y gastric bypass (RYGB) surgery drastically alters the fecal microbiome, but data are sparse on temporal and spatial microbiome and metabolome changes, especially in human populations. We characterized the structure and function (through metabolites) of the microbial communities in the gut lumen and structure of microbial communities on mucosal surfaces in nine morbidly obese individuals before, 6 months, and 12 months after RYGB surgery. Moreover, using a comprehensive multi-omic approach, we compared this longitudinal cohort to a previously studied cross-sectional cohort (n = 24). In addition to the expected weight reduction and improvement in obesity-related comorbidities after RYGB surgery, we observed that the impact of surgery was much greater on fecal communities in comparison to mucosal ones. The changes in the fecal microbiome were linked to increased concentrations of branched-chain fatty acids and an overall decrease in secondary bile acid concentrations. The microbiome and metabolome data sets for this longitudinal cohort strengthen our understanding of the persistent impact of RYGB on the gut microbiome and its metabolism. Our findings highlight the importance of changes in mucosal and fecal microbiomes after RYGB surgery. The spatial modifications in the microbiome after RYGB surgery corresponded to persistent changes in fecal fermentation and bile acid metabolism, both of which are associated with improved metabolic outcomes.npj Biofilms and Microbiomes (2020) 6:12 ; https://doi.