<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Concurrency on 小惡魔 - AppleBOY</title><link>https://blog.wu-boy.com/categories/concurrency/</link><description>Recent content in Concurrency on 小惡魔 - AppleBOY</description><generator>Hugo</generator><language>en-us</language><managingEditor>appleboy.tw@gmail.com (Appleboy)</managingEditor><webMaster>appleboy.tw@gmail.com (Appleboy)</webMaster><lastBuildDate>Sat, 14 Nov 2026 11:00:00 +0800</lastBuildDate><atom:link href="https://blog.wu-boy.com/categories/concurrency/feed.xml" rel="self" type="application/rss+xml"/><item><title>8 Practical Go Concurrency Patterns from a Cache Performance Optimization</title><link>https://blog.wu-boy.com/2026/11/go-concurrency-patterns-cache-optimization-en/</link><pubDate>Sat, 14 Nov 2026 11:00:00 +0800</pubDate><author>appleboy.tw@gmail.com (Appleboy)</author><guid>https://blog.wu-boy.com/2026/11/go-concurrency-patterns-cache-optimization-en/</guid><description>&lt;p&gt;&lt;img src="https://blog.wu-boy.com/images/2026-11-14/cover-en.png" alt="cover"&gt;&lt;/p&gt;
&lt;p&gt;This article is drawn from a performance improvement to an authorization service written in Go. The subject is API key validation caching: how to shorten the query path on a cache miss, how to keep every request from being dragged down when Redis fails, and how to shut down background workers correctly. The code comes from a real project; I trimmed it for readability and renamed things to be generic.&lt;/p&gt;
&lt;p&gt;On the surface these are 8 independent Go patterns, but they serve one goal: &lt;strong&gt;under cache degradation, Redis failure, and service shutdown, hold the line that &amp;ldquo;a revoked key must never be allowed through&amp;rdquo; while still winning back latency and throughput.&lt;/strong&gt; Near the end, a Redis outage timeline strings all 8 patterns together on one request path.&lt;/p&gt;</description></item><item><title>從一次快取效能優化，看 8 個實用的 Go Concurrency Pattern</title><link>https://blog.wu-boy.com/2026/11/go-concurrency-patterns-cache-optimization-zh-tw/</link><pubDate>Sat, 14 Nov 2026 10:00:00 +0800</pubDate><author>appleboy.tw@gmail.com (Appleboy)</author><guid>https://blog.wu-boy.com/2026/11/go-concurrency-patterns-cache-optimization-zh-tw/</guid><description>&lt;p&gt;&lt;img src="https://blog.wu-boy.com/images/2026-11-14/cover.png" alt="cover"&gt;&lt;/p&gt;
&lt;p&gt;這篇文章整理自一個用 Go 撰寫的授權服務的效能改善。主題是 API Key 驗證快取：如何縮短 cache miss 的查詢路徑、在 Redis 故障時不拖垮每一筆請求，以及正確關閉背景 worker。程式碼取自實際專案，為了閱讀方便做了刪減，名稱也改成通用的寫法。&lt;/p&gt;
&lt;p&gt;表面上這是 8 個獨立的 Go pattern，但它們服務同一個目標：&lt;strong&gt;在快取降級、Redis 故障、服務關閉的各種情況下，守住「已撤銷的 key 絕對不能被放行」，同時把延遲和吞吐量換回來。&lt;/strong&gt; 文末有一段 Redis 故障時間線，把 8 個 pattern 串在同一條請求路徑上。&lt;/p&gt;</description></item></channel></rss>