<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Duong Phuc Khanh (Kido)</title>
    <description>The latest articles on DEV Community by Duong Phuc Khanh (Kido) (@khanhduong22).</description>
    <link>https://dev.to/khanhduong22</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4184329%2F2074b15e-4422-443e-9025-bbb3758f46a5.jpg</url>
      <title>DEV Community: Duong Phuc Khanh (Kido)</title>
      <link>https://dev.to/khanhduong22</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khanhduong22"/>
    <language>en</language>
    <item>
      <title>"Zero-TBT &amp; 8-Minute Mobile Sessions: Engineering a 60FPS Offline-First PWA on iOS Safari"</title>
      <dc:creator>Duong Phuc Khanh (Kido)</dc:creator>
      <pubDate>Wed, 14 Oct 2026 13:13:39 +0000</pubDate>
      <link>https://dev.to/khanhduong22/zero-tbt-8-minute-mobile-sessions-engineering-a-60fps-offline-first-pwa-on-ios-safari-ffj</link>
      <guid>https://dev.to/khanhduong22/zero-tbt-8-minute-mobile-sessions-engineering-a-60fps-offline-first-pwa-on-ios-safari-ffj</guid>
      <description>&lt;h2&gt;
  
  
  Read More from Kido (Dương Phúc Khánh)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🌐 &lt;strong&gt;Official Engineering Hub&lt;/strong&gt;: &lt;a href="https://khanhdp.com" rel="noopener noreferrer"&gt;https://khanhdp.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🏛️ &lt;strong&gt;Biography &amp;amp; Career Timeline&lt;/strong&gt;: &lt;a href="https://khanhdp.com/about" rel="noopener noreferrer"&gt;https://khanhdp.com/about&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📖 &lt;strong&gt;Kido Chronicles (114 Real Engineering Stories)&lt;/strong&gt;: &lt;a href="https://truyen.khanhdp.com" rel="noopener noreferrer"&gt;https://truyen.khanhdp.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/khanhduong22" rel="noopener noreferrer"&gt;@khanhduong22&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nextjs</category>
      <category>webperf</category>
      <category>pwa</category>
      <category>javascript</category>
    </item>
    <item>
      <title>"Why I Refused a $500/mo Cloud Bill: Running 1,100+ Active Users at 1.12s LCP on a Single 8GB Linux VPS"</title>
      <dc:creator>Duong Phuc Khanh (Kido)</dc:creator>
      <pubDate>Wed, 14 Oct 2026 13:12:27 +0000</pubDate>
      <link>https://dev.to/khanhduong22/why-i-refused-a-500mo-cloud-bill-running-1100-active-users-at-112s-lcp-on-a-single-8gb-linux-192p</link>
      <guid>https://dev.to/khanhduong22/why-i-refused-a-500mo-cloud-bill-running-1100-active-users-at-112s-lcp-on-a-single-8gb-linux-192p</guid>
      <description>&lt;h2&gt;
  
  
  About the Author
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Duong Phuc Khanh (Kido / Khánh Dương)&lt;/strong&gt; is a Senior AI-Native Lead &amp;amp; Systems Architect based in Da Nang, Vietnam, alumnus of &lt;a href="https://vi.wikipedia.org/wiki/Tr%C6%B0%E1%BB%9Dng_%C4%90%E1%BA%A1i_h%E1%BB%8Dc_Kinh_t%E1%BA%BF,_%C4%90%E1%BA%A1i_h%E1%BB%8Dc_%C4%90%C3%A0_N%E1%BA%B5ng" rel="noopener noreferrer"&gt;Da Nang University of Economics (DUE)&lt;/a&gt;, and creator of &lt;code&gt;agent-harness-kit&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌐 &lt;strong&gt;Portfolio &amp;amp; Systems Benchmarks&lt;/strong&gt;: &lt;a href="https://khanhdp.com" rel="noopener noreferrer"&gt;https://khanhdp.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🏛️ &lt;strong&gt;Encyclopedia Biography&lt;/strong&gt;: &lt;a href="https://khanhdp.com/about" rel="noopener noreferrer"&gt;https://khanhdp.com/about&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📖 &lt;strong&gt;114 Production War Stories&lt;/strong&gt;: &lt;a href="https://truyen.khanhdp.com" rel="noopener noreferrer"&gt;https://truyen.khanhdp.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>performance</category>
      <category>postgres</category>
    </item>
    <item>
      <title>How I Built a 7-Gate Multi-Agent Engineering Harness (And Survived a 6:00 AM Race Condition Storm)</title>
      <dc:creator>Duong Phuc Khanh (Kido)</dc:creator>
      <pubDate>Wed, 14 Oct 2026 09:59:27 +0000</pubDate>
      <link>https://dev.to/khanhduong22/how-i-built-a-7-gate-multi-agent-engineering-harness-and-survived-a-600-am-race-condition-storm-3kkk</link>
      <guid>https://dev.to/khanhduong22/how-i-built-a-7-gate-multi-agent-engineering-harness-and-survived-a-600-am-race-condition-storm-3kkk</guid>
      <description>&lt;p&gt;At 06:00 AM in Da Nang, Vietnam, while most people are just waking up, nearly &lt;strong&gt;1,000 calisthenics athletes&lt;/strong&gt; open the &lt;strong&gt;Winter Arc&lt;/strong&gt; mobile PWA simultaneously to log their morning workouts and protect their daily streaks.&lt;/p&gt;

&lt;p&gt;Behind the scenes, there is no $5,000/month AWS Kubernetes cluster. The entire production ecosystem—serving &lt;strong&gt;1,100+ weekly active users&lt;/strong&gt; with an average session duration of &lt;strong&gt;8 minutes 04 seconds&lt;/strong&gt; and a &lt;strong&gt;P75 LCP of 1.12s&lt;/strong&gt;—runs smoothly on a single &lt;strong&gt;8GB RAM bare-metal Linux VPS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I'm &lt;strong&gt;Duong Phuc Khanh&lt;/strong&gt; (mostly known in the engineering community as &lt;strong&gt;Kido&lt;/strong&gt; or &lt;strong&gt;Khánh Dương&lt;/strong&gt;, &lt;a href="https://github.com/khanhduong22" rel="noopener noreferrer"&gt;@khanhduong22&lt;/a&gt;). Over the past 7+ years—from winning &lt;em&gt;First Prize at Startup Runway 2018&lt;/em&gt; (featured in &lt;a href="https://baodanang.vn/goi-mon-an-bang-dien-thoai-thong-minh-3174905.html" rel="noopener noreferrer"&gt;Báo Đà Nẵng&lt;/a&gt;) and spending 6 years architecting financial systems at &lt;em&gt;FPT Software (SBI Lab)&lt;/em&gt; to leading AI-Native systems at &lt;em&gt;Tech Pulse&lt;/em&gt;—I've obsessed over one question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How can a tiny, AI-augmented engineering team ship like a 20-person department without sacrificing production reliability?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are the two core architectural pillars that made it possible—and the full story behind my 114-episode engineering war journal, &lt;strong&gt;&lt;a href="https://truyen.khanhdp.com" rel="noopener noreferrer"&gt;Kido Chronicles&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pillar 1: Taming the 6:00 AM Check-In Storm with Valkey Distributed Locks
&lt;/h2&gt;

&lt;p&gt;When hundreds of athletes tap "Complete Workout" at the exact same second—often on flaky 4G connections inside basement gyms—double-taps and network retries create a textbook &lt;strong&gt;TOCTOU (Time-of-Check to Time-of-Use) race condition&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Without concurrency control, concurrent requests read the same streak state in PostgreSQL, resulting in duplicate streak increments, corrupted leaderboard scores, and database lock contention.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fix: Sub-5ms Idempotent Mutex in Valkey 8
&lt;/h3&gt;

&lt;p&gt;Instead of relying on heavy &lt;code&gt;SERIALIZABLE&lt;/code&gt; database transactions that choke connection pools under burst load, we guard the state transition at the edge using an atomic &lt;strong&gt;Valkey/Redis Distributed Lock&lt;/strong&gt; (&lt;code&gt;SET NX PX&lt;/code&gt;) paired with an idempotency key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Atomic check-in guard (Valkey 8 + NestJS)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lockKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`lock:checkin:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;workoutDate&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;acquired&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;valkey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lockKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;requestId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;PX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;NX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;acquired&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Concurrent retry detected — return cached idempotent state in &amp;lt;2ms&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getCachedCheckInStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;workoutDate&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Combined with a &lt;strong&gt;Service Worker Offline Outbox&lt;/strong&gt; on the client and &lt;strong&gt;Caddy 2&lt;/strong&gt; native reverse-proxying, our p99 check-in latency dropped from &lt;strong&gt;800ms+ to under 5ms&lt;/strong&gt; with zero duplicate writes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pillar 2: The 7-Rung "Ponytail" Philosophy &amp;amp; &lt;code&gt;agent-harness-kit&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;To maintain &lt;strong&gt;4x delivery velocity&lt;/strong&gt; across products like &lt;a href="https://index.vn" rel="noopener noreferrer"&gt;Index.vn&lt;/a&gt;, &lt;a href="https://linkpul.com" rel="noopener noreferrer"&gt;Linkpul&lt;/a&gt; (50,000+ req/sec short-link gateway), and &lt;a href="https://vantoicalis.com" rel="noopener noreferrer"&gt;Winter Arc&lt;/a&gt;, I built &lt;strong&gt;&lt;a href="https://github.com/khanhduong22/agent-harness-kit" rel="noopener noreferrer"&gt;agent-harness-kit&lt;/a&gt;&lt;/strong&gt;—a multi-agent orchestration framework for Claude Code, Cursor, Gemini, and Google Antigravity.&lt;/p&gt;

&lt;p&gt;Every autonomous sub-agent operates in an isolated Git worktree and is governed by what I call the &lt;strong&gt;7-Rung Ladder&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Does this need to exist at all? (YAGNI)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Is it already in the codebase?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Does the standard library solve it?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Does a native platform feature (HTML/CSS/PostgreSQL constraint) cover it?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Does an already-installed package handle it?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Can it be written in one clear line?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only then: write the minimum production-grade code.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before any PR can merge, it must pass &lt;strong&gt;7 automated verification gates&lt;/strong&gt;: AST linting, strict TypeScript typecheck, SonarQube smell checks, unit tests, and headless &lt;strong&gt;Playwright E2E tests with real-time video telemetry&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Explore the Full Architecture &amp;amp; War Stories
&lt;/h2&gt;

&lt;p&gt;If you enjoy deep-dive postmortems, distributed systems math, and real production numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌐 &lt;strong&gt;Official Hub &amp;amp; Architecture Case Studies&lt;/strong&gt;: &lt;a href="https://khanhdp.com" rel="noopener noreferrer"&gt;khanhdp.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📖 &lt;strong&gt;Full Biography &amp;amp; Engineering Philosophy&lt;/strong&gt;: &lt;a href="https://khanhdp.com/about" rel="noopener noreferrer"&gt;khanhdp.com/about&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🔥 &lt;strong&gt;Kido Chronicles (114 Real Production Postmortems)&lt;/strong&gt;: &lt;a href="https://truyen.khanhdp.com" rel="noopener noreferrer"&gt;truyen.khanhdp.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;Open-Source Multi-Agent Harness&lt;/strong&gt;: &lt;a href="https://github.com/khanhduong22/agent-harness-kit" rel="noopener noreferrer"&gt;github.com/khanhduong22/agent-harness-kit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🏛️ &lt;strong&gt;Wikidata Entity&lt;/strong&gt;: &lt;a href="https://www.wikidata.org/wiki/Q141718572" rel="noopener noreferrer"&gt;Q141718572&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>agents</category>
      <category>architecture</category>
      <category>performance</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
