How deep is the connection between $\mathcal{O}$ for a structure sheaf and $\mathcal{O}$ for a ring of algebraic integers? So clearly there's some connection because in both contexts you have a ring and its function field involved; in one setting that's $\mathcal{O}_X(U)$ and $\mathcal{O}_{X, \eta}$ and in the other it's $\mathcal{O}_K$ and $K$.  Is that as far as the analogy goes, or is there more?
(Also, my professor said something in this context about "orders," which were something like maximal torsion-free additive subgroups, but I didn't really understand.)
 A: I'm not seeing an especially close connection.  
To any commutative ring $R$ one gets an affine scheme with an associated structure sheaf, whose ring of global sections is precisely $R$.  There is a very close analogy between $\mathcal{O}$, where $\mathcal{O}$ is a (possibly nonmaximal) order in the number field $K$, and $K[C^{\circ}]$, where $C^{\circ}_{/K}$ is a (possibly singular, but integral and affine) curve over the field $K$.  On both sides we can pass to "Specs" to get structure sheaves and affine schemes if we like.  Or perhaps we'd like to compare $\mathcal{O}$ with a projective curve: that is also very natural.  
But to me the analogy is between commutative rings with very similar behavior, or to schemes with similar behavior (i.e., one-dimensional Noetherian and integral).  I don't see what the structure sheaf $\mathcal{O}_X$ has to do with the order $\mathcal{O}$ in a number field any more than it does with some other commutative ring.
Or for the executive summary: if we wrote $R$ instead of $\mathcal{O}$ then I don't see what we're losing.  
