Extracellular enzymes allow microbes to acquire carbon and nutrients from complex molecules and catalyse the rate-limiting step in nutrient mineralization. Because the factors regulating enzyme production are poorly understood, I used a simulation model to examine how competition, nutrient availability and spatial structure affect microbial growth and enzyme synthesis. In simulations where enzyme-producing microbes competed with cheaters (who do not synthesize enzymes but take-up product), higher enzyme costs favoured cheaters, while lower rates of enzyme diffusion favoured producers. Cheaters and producers coexisted in highly organized spatial patterns at intermediate enzyme costs and diffusion rates. Simulations with varying nutrient inputs showed that nitrogen supply can limit carbon mineralization, microbial growth and enzyme production because of the nitrogen-demanding stoichiometry of enzymes (C : N = c. 3.5 : 1). These results suggest that competition from cheaters, slow diffusion and nitrogen limitation may constrain microbial foraging and the enzymatic decomposition of complex compounds in natural environments.