<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Sync-vs-Async on IT Comparison</title><link>https://comparison.metacog.co.kr/tags/sync-vs-async/</link><description>Recent content in Sync-vs-Async on IT Comparison</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 06 Sep 2026 10:05:37 +0900</lastBuildDate><atom:link href="https://comparison.metacog.co.kr/tags/sync-vs-async/index.xml" rel="self" type="application/rss+xml"/><item><title>Sync vs Async APIs: Blocking Calls vs Non-Blocking Callbacks</title><link>https://comparison.metacog.co.kr/posts/2026-09-06-sync-vs-async-apis-blocking-calls-vs-non-blocking-callbacks/</link><pubDate>Sun, 06 Sep 2026 10:05:37 +0900</pubDate><guid>https://comparison.metacog.co.kr/posts/2026-09-06-sync-vs-async-apis-blocking-calls-vs-non-blocking-callbacks/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;A &lt;strong class="kw"&gt;synchronous call&lt;/strong&gt; blocks the caller until the server returns a result, tying up a thread or connection for the full round trip. An &lt;strong class="kw"&gt;asynchronous call&lt;/strong&gt; returns immediately with an acknowledgment and delivers the actual result later via a callback, event, or poll, letting the caller do other work in the meantime.&lt;/p&gt;
&lt;h2 id="comparison-diagram"&gt;Comparison Diagram&lt;/h2&gt;
&lt;div class="compare-diagram"&gt;
&lt;svg viewBox="0 0 640 360" xmlns="http://www.w3.org/2000/svg"&gt;&lt;text x="320" y="40" text-anchor="middle" font-size="18" font-weight="bold" style="fill:var(--primary)"&gt;Synchronous API&lt;/text&gt;&lt;text x="60" y="99" font-size="13" style="fill:var(--content)"&gt;Client&lt;/text&gt;&lt;text x="320" y="80" text-anchor="middle" font-size="11" style="fill:var(--secondary)"&gt;blocked - thread waits&lt;/text&gt;&lt;line x1="100" y1="100" x2="580" y2="100" stroke-width="2" style="stroke:var(--compare-a)"/&gt;&lt;polygon points="580,94 592,100 580,106" style="fill:var(--compare-a)"/&gt;&lt;rect x="220" y="92" width="200" height="16" stroke-width="1.5" style="fill:var(--compare-a-soft);stroke:var(--compare-a)"/&gt;&lt;circle cx="220" cy="100" r="5" stroke-width="1.5" style="fill:var(--compare-a-soft);stroke:var(--compare-a)"/&gt;&lt;circle cx="420" cy="100" r="5" stroke-width="1.5" style="fill:var(--compare-a-soft);stroke:var(--compare-a)"/&gt;&lt;text x="220" y="122" text-anchor="middle" font-size="11" style="fill:var(--content)"&gt;request sent&lt;/text&gt;&lt;text x="420" y="122" text-anchor="middle" font-size="11" style="fill:var(--content)"&gt;response received&lt;/text&gt;&lt;line x1="220" y1="106" x2="220" y2="135" stroke-width="1" stroke-dasharray="3 3" style="stroke:var(--border)"/&gt;&lt;line x1="420" y1="106" x2="420" y2="135" stroke-width="1" stroke-dasharray="3 3" style="stroke:var(--border)"/&gt;&lt;rect x="220" y="135" width="200" height="10" stroke-width="1" stroke-dasharray="3 3" style="fill:none;stroke:var(--border)"/&gt;&lt;text x="320" y="161" text-anchor="middle" font-size="11" style="fill:var(--secondary)"&gt;server processing&lt;/text&gt;&lt;line x1="40" y1="188" x2="600" y2="188" stroke-width="1" stroke-dasharray="4 4" style="stroke:var(--border)"/&gt;&lt;text x="320" y="213" text-anchor="middle" font-size="18" font-weight="bold" style="fill:var(--primary)"&gt;Asynchronous API&lt;/text&gt;&lt;text x="60" y="259" font-size="13" style="fill:var(--content)"&gt;Client&lt;/text&gt;&lt;rect x="250" y="233" width="140" height="18" stroke-width="1" style="fill:var(--compare-b-soft);stroke:var(--compare-b)"/&gt;&lt;text x="320" y="246" text-anchor="middle" font-size="10" style="fill:var(--content)"&gt;client free: other work&lt;/text&gt;&lt;line x1="100" y1="260" x2="580" y2="260" stroke-width="2" style="stroke:var(--compare-b)"/&gt;&lt;polygon points="580,254 592,260 580,266" style="fill:var(--compare-b)"/&gt;&lt;circle cx="220" cy="260" r="5" stroke-width="1.5" style="fill:var(--compare-b-soft);stroke:var(--compare-b)"/&gt;&lt;circle cx="420" cy="260" r="5" stroke-width="1.5" style="fill:var(--compare-b-soft);stroke:var(--compare-b)"/&gt;&lt;text x="220" y="283" text-anchor="middle" font-size="11" style="fill:var(--content)"&gt;request sent&lt;/text&gt;&lt;text x="420" y="283" text-anchor="middle" font-size="11" style="fill:var(--content)"&gt;callback received&lt;/text&gt;&lt;line x1="220" y1="266" x2="220" y2="300" stroke-width="1" stroke-dasharray="3 3" style="stroke:var(--border)"/&gt;&lt;line x1="420" y1="266" x2="420" y2="300" stroke-width="1" stroke-dasharray="3 3" style="stroke:var(--border)"/&gt;&lt;rect x="220" y="300" width="200" height="10" stroke-width="1" stroke-dasharray="3 3" style="fill:none;stroke:var(--border)"/&gt;&lt;text x="320" y="326" text-anchor="middle" font-size="11" style="fill:var(--secondary)"&gt;server working&lt;/text&gt;&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id="comparison-table"&gt;Comparison Table&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;Sync API&lt;/th&gt;
&lt;th&gt;Async API&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Request initiation&lt;/td&gt;
&lt;td&gt;Caller invokes and immediately awaits the result on the same call&lt;/td&gt;
&lt;td&gt;Caller invokes and gets an immediate acknowledgment or handle (future, promise, message ID), not the result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response delivery&lt;/td&gt;
&lt;td&gt;Result returned in-line over the same connection/thread that made the call&lt;/td&gt;
&lt;td&gt;Result delivered later via callback, event, webhook, or by polling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Caller behavior while waiting&lt;/td&gt;
&lt;td&gt;Thread or connection is blocked and cannot do other work&lt;/td&gt;
&lt;td&gt;Caller is free to continue other work or serve other requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concurrency model&lt;/td&gt;
&lt;td&gt;Needs roughly one thread or connection per in-flight call&lt;/td&gt;
&lt;td&gt;A single thread or event loop can multiplex many in-flight calls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure handling&lt;/td&gt;
&lt;td&gt;Errors surface immediately as exceptions or status codes at the call site&lt;/td&gt;
&lt;td&gt;Errors arrive out-of-band later and must be matched back to the original request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ordering and sequencing&lt;/td&gt;
&lt;td&gt;Strict: caller code executes in the exact order calls complete&lt;/td&gt;
&lt;td&gt;Responses can arrive out of order, requiring correlation IDs to reassemble sequence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency impact on caller&lt;/td&gt;
&lt;td&gt;Caller&amp;rsquo;s total latency equals the full round trip&lt;/td&gt;
&lt;td&gt;Caller&amp;rsquo;s perceived latency is just the time to ack; real work overlaps with other tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Implementation complexity&lt;/td&gt;
&lt;td&gt;Simpler code: straightforward call and return&lt;/td&gt;
&lt;td&gt;More complex: needs callback/promise/event handling and explicit state tracking&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="key-differences"&gt;Key Differences&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Sync calls &lt;strong class="kw"&gt;block&lt;/strong&gt; the caller until the response arrives, while async calls return control immediately.&lt;/li&gt;
&lt;li&gt;Async APIs scale better under load because they avoid &lt;strong class="kw"&gt;thread-per-request&lt;/strong&gt; limits inherent to blocking calls.&lt;/li&gt;
&lt;li&gt;Sync errors surface in-line at the call site; async errors require &lt;strong class="kw"&gt;correlation&lt;/strong&gt; back to the original request.&lt;/li&gt;
&lt;li&gt;Async responses can arrive out of order, adding &lt;strong class="kw"&gt;sequencing&lt;/strong&gt; complexity that sync calls never face.&lt;/li&gt;
&lt;li&gt;Sync code is easier to trace and debug since execution follows a single linear &lt;strong class="kw"&gt;call stack&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="when-to-use-each"&gt;When to Use Each&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Sync API&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>