<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog on Laputa</title>
    <link>https://chenjianyong.com/blog/</link>
    <description>Recent content in Blog on Laputa</description>
    <generator>Hugo</generator>
    <language>en-GB</language>
    <lastBuildDate>Sun, 07 Sep 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://chenjianyong.com/blog/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Durable Object Write Coalesce</title>
      <link>https://chenjianyong.com/blog/2025/durable-object-write-coalesce/</link>
      <pubDate>Sun, 07 Sep 2025 00:00:00 +0000</pubDate>
      <guid>https://chenjianyong.com/blog/2025/durable-object-write-coalesce/</guid>
      <description>&lt;p&gt;In the blog post &lt;a href=&#34;https://blog.cloudflare.com/durable-objects-easy-fast-correct-choose-three/&#34;&gt;Durable Objects: Easy, Fast, Correct — Choose Three&lt;/a&gt;, Kenton introduces two critical implementation concepts of Durable Objects: the input gate and the output gate. These mechanisms work in tandem to address data races and enable seamless in-memory caching, ensuring both correctness and performance.&lt;/p&gt;&#xA;&lt;p&gt;However, I&amp;rsquo;m particularly intrigued by another feature Kenton highlighted as a bonus of the output gate implementation: automatic write coalescing.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;    &lt;p&gt;&amp;ldquo;First, writes are automatically coalesced. That is, if you perform multiple &lt;code&gt;put()&lt;/code&gt; or &lt;code&gt;delete()&lt;/code&gt; operations without &lt;code&gt;await&lt;/code&gt;ing them or anything else in between, then the operations are automatically grouped together and stored atomically.&amp;rdquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Write Atomicity in MongoDB</title>
      <link>https://chenjianyong.com/blog/2025/write-atomicity-in-mongodb/</link>
      <pubDate>Wed, 16 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://chenjianyong.com/blog/2025/write-atomicity-in-mongodb/</guid>
      <description>&lt;p&gt;Recently, I’ve been building a task system with the following workflow:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A user submits a task.&lt;/li&gt;&#xA;&lt;li&gt;The task is immediately stored in MongoDB.&lt;/li&gt;&#xA;&lt;li&gt;The task ID is returned to the user, who can poll for its status.&lt;/li&gt;&#xA;&lt;li&gt;A background worker periodically fetches pending tasks and executes them.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;This model is quite common when task execution can take a long time.&lt;/p&gt;&#xA;&lt;p&gt;However, here’s the catch: the service is deployed across multiple instances, and they may all fetch the same pending tasks from MongoDB. This creates a race condition — a task could be executed multiple times, and the final result becomes unpredictable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Way back to China</title>
      <link>https://chenjianyong.com/blog/2025/way-back-to-china/</link>
      <pubDate>Sat, 12 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://chenjianyong.com/blog/2025/way-back-to-china/</guid>
      <description>&lt;p&gt;Jing and I used to enjoy Japanese anime on BiliBili during lunch or dinner. However, due to political and commercial restrictions, many resources on Chinese platforms are inaccessible from overseas. Ironically, when we lived in China, we often used VPNs to bypass the GFW and access foreign platforms—now it&amp;rsquo;s the other way around.&lt;/p&gt;&#xA;&lt;p&gt;Fortunately, ChatGPT has once again proven to be a great companion for building small tools. With its help, I established a reliable connection that bridges the UK, Germany, and China—without writing a single line of code myself.&lt;/p&gt;</description>
    </item>
    <item>
      <title>My first English post</title>
      <link>https://chenjianyong.com/blog/2023/my-first-english-post/</link>
      <pubDate>Sat, 01 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://chenjianyong.com/blog/2023/my-first-english-post/</guid>
      <description>&lt;p&gt;This is my first English post, but won&amp;rsquo;t be the last, I promise &amp;ndash; all future posts will be written in English first from now on (may include an optional Chinese version, if I decide to make this site bilingual). Though my English is not very good yet(especially in terms of oral communication and writing skills), it won&amp;rsquo;t be always this case.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve thought a lot about it, and it&amp;rsquo;s undeniable that English is the de facto universal language around this world, not Chinese. And the English-speaking world is much more extensive and innovative compared to the Chinese-speaking world for some well-known reasons(at least in my field &amp;ndash; Computer Science, or Technology, many Chinese practitioners are fed with second-hand knowledge), so sad but true. As a person unwilling to be trapped by a single country (yeah, global citizen), I have no choice but to try to acquire English.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
