"Distributed-Counter"
- Firestore 高頻寫入與 distributed counter:單 document contention 邊界與分片計數 Firestore 單一 document 有持續寫入的軟上限、高頻計數寫爆 contention 是常見事故;本文展開寫入 contention 的成因、distributed counter 分片計數的實作與讀取彙總、shard 數量與讀寫成本的取捨、五個高頻寫入踩坑,以及計數需求超過分片能處理時改走外部聚合的邊界
- Firestore Distributed Counter Lab 在 emulator 上實作 distributed counter:建立 N 個 shard、隨機分片寫入、觀察 shard 分佈是否均勻、讀取彙總驗證總和正確,並說明 contention 本身是 emulator 不模擬的 production 特性