<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Systems on Stacknote Demo</title><link>https://stacknote.wanglong.cv/tags/systems/</link><description>Recent content in Systems on Stacknote Demo</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 17 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://stacknote.wanglong.cv/tags/systems/index.xml" rel="self" type="application/rss+xml"/><item><title>Trace the Request Before You Tune the Service</title><link>https://stacknote.wanglong.cv/articles/request-path/</link><pubDate>Mon, 17 Aug 2026 00:00:00 +0000</pubDate><guid>https://stacknote.wanglong.cv/articles/request-path/</guid><description>&lt;p&gt;A slow endpoint is rarely one indivisible wait. It is a chain: connection setup, queueing, application work, storage, and the trip back to the caller. The useful question is not simply “why is this request slow?” but “where did this request spend its time?”&lt;/p&gt;&#10;&lt;h2 id="start-with-one-trace"&gt;Start with one trace&lt;/h2&gt;&#10;&lt;p&gt;Pick one real slow request and write down its stages before changing a timeout or adding a cache.&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-block__copy" type="button" data-copy-code data-copied-label="Copied"&gt;Copy&lt;/button&gt;&#10; &lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gateway 18 ms&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;queue 142 ms&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;application 31 ms&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;database 24 ms&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;response 6 ms&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;The application function is not the bottleneck in this example. Making it twice as fast saves about 15 milliseconds while the request still waits 142 milliseconds before the function starts.&lt;/p&gt;</description></item><item><title>The Queue Is Part of Your API Contract</title><link>https://stacknote.wanglong.cv/articles/queue-contract/</link><pubDate>Mon, 10 Aug 2026 00:00:00 +0000</pubDate><guid>https://stacknote.wanglong.cv/articles/queue-contract/</guid><description>&lt;p&gt;Moving work behind a queue changes latency, ownership, and failure semantics. It does not make those concerns disappear.&lt;/p&gt;&#10;&lt;h2 id="acknowledgement-is-not-completion"&gt;Acknowledgement is not completion&lt;/h2&gt;&#10;&lt;p&gt;An HTTP &lt;code&gt;202 Accepted&lt;/code&gt; response says the server accepted responsibility for attempting the job. It should not imply that the job succeeded, or even that a worker has started it.&lt;/p&gt;&#10;&lt;p&gt;Clients need a durable job identifier and a status model they can understand:&lt;/p&gt;&#10;&lt;div class="code-block"&gt;&#10; &lt;button class="code-block__copy" type="button" data-copy-code data-copied-label="Copied"&gt;Copy&lt;/button&gt;&#10; &lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;#34;job_id&amp;#34;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;job_7f31&amp;#34;&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;#34;state&amp;#34;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;queued&amp;#34;&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;#34;status_url&amp;#34;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;/jobs/job_7f31&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;h2 id="retries-create-duplicates"&gt;Retries create duplicates&lt;/h2&gt;&#10;&lt;p&gt;A worker can finish the side effect and crash before acknowledging the message. The queue then delivers the same message again. That is ordinary at-least-once delivery, not an exotic edge case.&lt;/p&gt;</description></item></channel></rss>