THU · 07.30 · WEEK 01
Rate Limiter:原子性、分片与故障策略
完整覆盖算法、Redis 原子 read-modify-write、1M RPS 扩展、consistent hashing、hot key 与 fail-open / fail-closed。
原文定位
按顺序打开。链接直接指向当天需要阅读的小节。
- Rate Limiter / Potential Deep Dives
- Rate Limiter / 1) How do we scale to handle 1M requests/second?
- Rate Limiter / 2) How do we ensure high availability and fault tolerance?
- Redis
- Consistent Hashing
- Dealing with Contention
- Scaling Writes
- DDIA Ch7 / 按键的哈希分片
- DDIA Ch7 / 倾斜的工作负载与缓解热点
- DDIA Ch7 / 请求路由
- DDIA Ch9 / 故障与部分失效
- DDIA Ch9 / 超时和无界延迟
上午执行
| 时间 | 动作 |
|---|---|
| 08:50—09:20 | 画出两个 gateway 并发消费最后一个 token 的 race window。 |
| 09:20—10:05 | 读完 Potential Deep Dives;把 Lua 原子操作边界画成一个盒子。 |
| 10:05—10:30 | 读 DDIA Ch7 的哈希分片、热点与路由,修正 shard key 和 hot-key 方案。 |
| 10:30—10:45 | 读 DDIA Ch9 的部分失效与超时,明确 limiter unavailable 不等于 limiter failed。 |
| 10:45—10:55 | 分别为 login、防滥用、推荐 API 选择 fail-open 或 fail-closed。 |
必须产出:一页 Failure Policy:不同 endpoint 的 timeout、fail-open/closed、本地降级配额、告警和恢复。
掌握标准
- 知道 MULTI/EXEC 不自动覆盖事务外的 HMGET;原子边界必须包含 read-calculate-update。
- 能解释 consistent hashing 解决路由/重平衡,不解决 hot key 和跨区域强一致。
- 不会给全系统一个统一 fail-open/closed 答案;按风险和下游容量选择。
算法 · Arrays & Hashing
Tag 不切换。三题结束后只记录四个字段。
| # | 题目 | 留下的记录 |
|---|---|---|
| 1 | Longest Consecutive Sequence | Pattern / Invariant / Bug / Complexity |
| 2 | Subarray Sum Equals K | Pattern / Invariant / Bug / Complexity |
| 3 | Product of Array Except Self · 复刷 | Pattern / Invariant / Bug / Complexity |
晚上
Frontier 40 分钟:读 IBM Loop Engineering;只写 Claim、Mechanism、Failure、Transfer 四行。
Detailed lecture notes, audio, recall scripts, PDFs, Staff Q&A, and mock packs are archived locally and are intentionally not published on this site.