Bacterial communities thriving in various components determine the host health and water quality in biofloc technology (BFT)-based aquaculture system. Despite increasing utilization of BFT in aquaculture industries, studies distinguishing bioflocs (attached community) and rearing water (free-living community) microbiota compositions remain rudimentary. In this study, we compared floc-associated bacterial (FAB; size fraction ≥3 μm) and planktonic free-living bacterial (PFLB; 0.22–3.00 μm) communities from a commercial shrimp aquaculture system to investigate how their diversity, community compositions, inter-species interactions, and functional potentials varied. Based on 16S rRNA gene amplicon sequencing, the metataxonomic results indicated that though these communities share identical habitat, the FAB community possesses a higher bacterial richness and noticeably distinct community composition than its PFLB counterpart. The Alphaproteobacteria (mostly Rhodobacteraceae) preponderated in the FAB community, while Bacteroidetes (primarily Flavobacteriaceae) dominated the PFLB. By analyzing co-occurrence pattern, we portrayed a complex ecological network, strong inter-species interactions, and diverse keystone taxa in the FAB community. Intriguingly, Halieaceae and Rhodobacteraceae members were recognized as prominent keystone taxa in FAB and PFLB communities, respectively, highlighting their regulatory roles in sustaining stability of these communities. Furthermore, negative edges proportion varied considerably in ecological networks, suggesting that both communities experience distinct niche differentiation. PICRUSt2-based prediction demonstrated that functional pathways pertaining to membrane transporters, cell motility, and polymer degradation were enriched in the FAB community, suggesting their involvement in surface-adapted lifestyles. Altogether, we proved that attached and planktonic bacterial communities serve as two distinct microbial consortia, perform different tasks, and hence could have diverse ecological roles in biofloc aquaculture systems. Our findings advance scientific understanding of microbiota variations between planktonic and attached communities in aquatic environments, and strengthen the proposed species sorting hypothesis, which states that prevailing environmental factors determine bacterial community assembly.