Photosynthetic microbial mats are remarkably complete self-sustaining ecosystems at the millimeter scale, yet they have substantially affected environmental processes on a planetary scale. These mats may be direct descendents of the most ancient biological communities in which even oxygenic photosynthesis might have developed. Photosynthetic mats are excellent natural laboratories to help us to learn how microbial populations associate to control dynamic biogeochemical gradients.