system design · system-design
Design Outlook / Exchange (Enterprise Mail Server)
Storage, search, calendar integration, anti-spam. Enterprise mail + calendar + tasks combined.
Theory
Explanation
Intuition first, formal definition second. Skim the bullets if you already know this; read the prose if you don't.
Email + calendar + tasks as one product. Enterprise-grade: shared mailboxes, delegate access, retention policies, eDiscovery. Multi-tenant Cosmos partitions per org.
Inbound SMTP → anti-spam + DLP → mailbox writer. Mailbox partitioned per user. Search index per user. Calendar stored separately, free/busy queries cross-tenant via federation. Anti-spam combines reputation, ML classifier, attachment sandbox. eDiscovery indexes all org mail searchable by admin queries.
When to use
Enterprise mail products.
When not to
Consumer free mail (use Gmail-style).
flowchart LR SMTP[Inbound SMTP] --> Anti[Anti-spam + DLP] Anti --> MB[(Mailbox · per user)] MB --> Search[(Per-user Search Index)] Cal[(Calendar Store)] --> FB[Free/Busy Service] Admin[Admin] --> ED[(eDiscovery Index)] Outlook([Outlook Client]) --> EWS[Exchange Web Services] EWS --> MB EWS --> Cal
Key insights
- Per-mailbox isolation is the durability boundary.
- Free/busy queries are cross-tenant, federation protocol negotiates without exposing detail.
- eDiscovery is separate index because admin search must not be on hot path.
- Retention policies + legal hold need careful design to interact correctly.
- Anti-spam ML retrains on user spam-marking signals.