Most microorganisms live in complex communities, where they interact both synergistically and competitively. To explore the relationship between environmental heterogeneity and the spatial structure of well-defined biofilms, single- and mixed-species biofilms of Pseudomonas aeruginosa PAO1 and Flavobacterium sp. CDC-65 was grown in a planar flow cell under highly controlled flow gradients. Both organisms behaved differently in mixed cultures than in single-species cultures due to inter-species interactions, and these interactions were significantly affected by external flow conditions. Pseudomonas and Flavobacterium showed a competitive relationship under slow inflow conditions, where the supply of growth medium was limited. Under such competitive conditions, the faster- specific growth rate of Flavobacterium allowed it to secure access to favorable regions of the biofilm by overgrowing Pseudomonas. In contrast, Pseudomonas was restricted to nutritionally depleted habitat near the base of the biofilm, and its growth was significantly inhibited. Conversely, under higher inflow conditions providing greater influx of growth medium, both organisms accumulated greater biomass in mixed biofilms than in single-species biofilms. Spatial segregation of the two organisms within the biofilms contributed to enhanced overall exploitation of available nutrients and substrates, while morphological changes favored better adherence to the surface under high hydrodynamic shear. These results indicate that synergy and competition in biofilms vary with flow conditions. Limited resource replenishment favors competition under low-flow conditions, while high flow reduces competition and favors synergy by providing greater resources and simultaneously imposing increased hydrodynamic shear that makes it more difficult to accumulate biomass on the surface. Ecological interactions that produce mechanically stronger and more robust biofilms will support more extensive growth on surfaces subject to high hydrodynamic shear, but these interactions are difficult to predict from observations of the behavior of individual organisms.