G18 · Design Gmail Backend G18 · 设计 Gmail 后端
Verified source经核实出处
Gmail architecture published in various Google talks; SD interview staple. Credibility A.
Key decisions关键决策
- **Per-user shards** on Bigtable-like store; messages keyed by (user, message_id).**按用户分片**的 Bigtable 式存储;消息按 (user, message_id) 键。
- **Inverted index per user** for search; updated on mail arrival.**用户级倒排索引**;到件即更新。
- **Spam pipeline**: ensemble (reputation + content + ML) at MX layer.**反垃圾**:MX 层集成(信誉 + 内容 + ML)。
- **Large attachments offloaded** to blob store, referenced by content hash.**大附件落 blob**,内容哈希去重。
Follow-ups追问
- IMAP compatibility? labels act as folders, mapping layer synthesises.Label 如何兼容 IMAP 文件夹?映射层合成。