To reveal the microbial community composition of regional shallow porous brackish groundwater and its response characteristics to groundwater environment, the first and second aquifers in Taocheng District, Hengshui City were selected, and 10 groundwater source samples were collected for hydrochemical analysis and microbial 16S RNA gene V4–V5 regional sequencing. The results showed that the shallow brackish groundwater in the study area is weakly alkaline and has high ion content. The hydrochemical types are SO4·Cl-Na·Mg type and HCO3·Cl-Na·Mg type as a whole. The spatial zonation of the abundance and diversity of groundwater microorganisms is obvious. The number of endemic bacteria in groundwater from upstream, midstream to downstream is 11, 135 and 22 respectively, with a total of 22 bacteria. Proteobacteria is the most dominant in groundwater level (38.82%–86.88%), and there are obvious differences in different sections. At the genus level, the main dominant species in each group and sample are Pseudomonas and Hydrogenophaga. In terms of composition difference, Pseudohongiella, Pseudorhodobacter and Limnohabitans are the representatives of UR, MR and LR. On the whole, the composition of flora in groundwater in the study area is sensitive and closely related to hydrochemical processes. Species abundance is affected by alkaline and high salinity environmental indicators, while species diversity is related to depth and dissolved oxygen in weak reduction environment.