<?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: Denny Harijanto</title>
    <description>The latest articles on DEV Community by Denny Harijanto (@dharijanto).</description>
    <link>https://dev.to/dharijanto</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F127742%2Ff412c27d-df59-45d3-8609-6498249e0e8c.jpeg</url>
      <title>DEV Community: Denny Harijanto</title>
      <link>https://dev.to/dharijanto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dharijanto"/>
    <language>en</language>
    <item>
      <title>The Future of Concurrent Web Programming</title>
      <dc:creator>Denny Harijanto</dc:creator>
      <pubDate>Sat, 29 Aug 2020 04:16:59 +0000</pubDate>
      <link>https://dev.to/dharijanto/the-future-of-concurrent-programming-eha</link>
      <guid>https://dev.to/dharijanto/the-future-of-concurrent-programming-eha</guid>
      <description>&lt;p&gt;After spending most of time working on codebase with &lt;em&gt;event-loop based concurrency approach&lt;/em&gt;, I recently joined a project that uses a more conventional &lt;em&gt;thread-based concurrency approach&lt;/em&gt;. And wow, this makes me realize how unnecessarily complicated thread-based concurrency approach is, especially for the use case of building web applications. In this article, I want to talk about how I feel the future direction should be.&lt;/p&gt;

&lt;p&gt;For readers who are not familiar with the two common concurrency approaches, I suggest reading this wonderfully written Stack Overflow answer: &lt;a href="https://stackoverflow.com/questions/34855352/how-in-general-does-node-js-handle-10-000-concurrent-requests"&gt;https://stackoverflow.com/questions/34855352/how-in-general-does-node-js-handle-10-000-concurrent-requests&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;While &lt;em&gt;thread-based concurrency approach&lt;/em&gt; offers a more fine-grained control over the level of parallelism that can happen, it's just to complicated for general web-application use cases. Debugging where locks are incorrectly placed, and where potential race-conditions could happen is just too much work, especially considering any sizeable backend would eventually need to be horizontally scaled anyway. I also think the complexity costs to code and maintain &lt;em&gt;thread-based concurrency code&lt;/em&gt; is too much when compared to the performance gain it could create for typical web applications.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Given the number of cores and raw performance that hardware provides are improving in a much faster way than developers learning to write parallel code, the need of frameworks that makes it easy write parallelize code is the direction to go.&lt;/em&gt; And I do think &lt;em&gt;event-loop driven concurrency&lt;/em&gt; is the way to go. NodeJS, in my opinion, has done a great job on making &lt;em&gt;event-loop driven&lt;/em&gt; programming enjoyable. Through NodeJS, a lot of junior developers without any background in how computer memory model works have been able to write parallel programs without even realizing that! :)&lt;/p&gt;

&lt;p&gt;To summarize, I think &lt;em&gt;event-loop driven concurrency&lt;/em&gt; has been one of the best inventions in the past decade in the realm of web development. I'm totally looking forward to see how &lt;em&gt;event-loop driven approaches&lt;/em&gt; would evolve in the next phase. For example, I'm curious how would LibUV evolve next. As interesting fact, &lt;a href="https://deno.land/"&gt;Deno&lt;/a&gt;, which is created by the author of NodeJS, seems to use &lt;a href="https://github.com/tokio-rs/tokio"&gt;Tokio&lt;/a&gt; in favor of &lt;a href="http://docs.libuv.org/"&gt;LibUV&lt;/a&gt;. I am going to do more research on the reasons why.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
