We redevelop persistent homology (topological persistence) from a categorical point of view. The main objects of study are diagrams, indexed by the poset of real numbers, in some target category. The set of such diagrams has an interleaving distance, which we show generalizes the previously-studied bottleneck distance. To illustrate the utility of this approach, we greatly generalize previous stab