Building Reliable Distributed Systems in Node

<p>This post introduces the concept of&nbsp;<em>durable execution</em>, which is used by Stripe, Netflix, Coinbase, Snap, and many others to solve a wide range of problems in distributed systems. Then it shows how simple it is to write durable code using Temporal&rsquo;s TypeScript/JavaScript SDK.</p> <h1>Distributed systems</h1> <p>When building a request-response monolith backed by a single database that supports transactions, we don&rsquo;t have many distributed systems concerns. We can have simple failure modes and easily maintain accurate state:</p> <ul> <li>If the client can&rsquo;t reach the server, the client retries.</li> <li>If the client reaches the server, but the server can&rsquo;t reach the database, the server responds with an error, and the client retries.</li> <li>If the server reaches the database, but the transaction fails, the server responds with an error, and the client retries.</li> <li>If the transaction succeeds but the server goes down before responding to the client, the client retries until the server is back up, and the transaction fails the second time (assuming the transaction has some check&ndash;like an idempotency token&ndash;to tell whether the update has already been applied), and the server reports to the client that the action has already been performed.</li> </ul> <p><a href="https://blog.lorensr.me/building-reliable-distributed-systems-in-node-aff92fa45ad8">Visit Now</a>&nbsp;</p>