We study the dynamic fair division of indivisible goods.

Suppose T items arrive online and must be allocated upon arrival to one of n agents, each of whom has a value in [0,1] for the current item. Our goal is to design allocation algorithms that minimize the maximum envy at time T, defined as the maximum difference between any agent's overall value for items allocated to another agent and to herself.

An algorithm has vanishing envy if the ratio of envy over time goes to zero as T goes to infinity. We design a polynomial-time, deterministic algorithm that achieves envy in $\tilde{O}(\sqrt{T/n})$, and show that this guarantee is asymptotically optimal. We also derive tight (in $T$) bounds for a more general setting where items arrive in batches.