The short answerSynchronous code does one thing at a time and waits for each step to finish before starting the next, while asynchronous code can start a slow step, such as a network call, and do other work while it waits, so async only makes a program faster when it spends its time waiting and those waits can overlap.
This page is the free part.
The course goes deeper on Synchronous and Asynchronous
₹499 in India/$49 everywhere elseonce, for the whole course
The System Design course covers Synchronous and Asynchronous across a run of lessons, not one page. These 4 alone are about 80 minutes of step-by-step reading, every one with a quiz.
Ive started this course by accident - LLM advised me this site. When I passed few free lessons, I had no doubt - this course should be bought. And I did it with special pleasent price and it was best decision of the month. Content is great, interesting to read and with a lot of practial cases (what makes it different from other souces and books) I hope to teach all the lessons, that will be my supergoal. Glad that I found this resource and speacial Thank You to Roni Das - Great Job!
Oleksander, Backend Engineer · System Design Masterclass · read 15 lessons · all reviews
A slow call blocks: nothing else runs in that thread meanwhile.
Easy to read, easy to debug, order is obvious.
Total time is the sum of every wait.
vs
Non-blocking, start now, collect later
Asynchronous
order, then sit down until your number is called
Starts a slow task and moves on instead of waiting.
An event loop picks the work back up when the answer arrives.
Many waits can overlap, so total time can shrink to the longest one.
Harder to follow: order and errors need more care.
Fifty slow calls, drawn to scaleOne after another, the waits add up to over 5 seconds. Started together, they overlap and the whole batch takes about as long as one call.
Synchronous vs Asynchronous, side by side
Read across a row to compare one thing. Every word that may be new is explained just below the table.
Synchronous compared with Asynchronous
Aspect
Synchronous
Asynchronous
How steps run
One after another. Step 2 waits for step 1.
Slow steps are started and left running; the program moves on.
During a slow network call
The thread sits idle until the answer comes back.
The event loop runs other tasks until the answer comes back.
Total time for N independent waits
About the sum of all N waits. Ours: 5.15 s for 50 x 100 ms.
About the longest single wait, if started together. Ours: 0.16 s.
CPU-heavy work
Runs at full speed on one core.
No faster. Our 50 hash jobs took 0.26 s either way.
Reading the code
Top to bottom, like a recipe.
Needs async/await, and you must think about what runs when.
Errors
Raised at the line that failed.
Raised when you await the task. Forgetting to await can hide them.
Typical tools
requests, urllib, plain function calls.
Python asyncio and httpx, JavaScript Promises, Node.js.
Best for
Scripts, steps that depend on each other, CPU work.
Servers with many clients, fan-out to many APIs, chat, streaming.
Words on this page, in plain English
Synchronous
Happening in order: a step starts only after the step before it has finished.
Asynchronous
Not tied to that order: a step can be started now and its result picked up later.
Blocking call
A call that stops the program (or the thread) until it gets an answer, such as reading from a slow server.
I/O
Input and output: talking to anything outside the CPU, such as the network, a disk or a database.
Concurrency
Having many tasks in progress at the same time, even if only one is running at any instant.
Event loop
The part of an async runtime that keeps a list of waiting tasks and resumes each one when its answer is ready.
await
A keyword (Python, JavaScript) that pauses this task until a result is ready and lets other tasks run meanwhile.
Coroutine
A function that can pause at an await and carry on later. Python added async def and await for this in 3.5 (PEP 492).
CPU-bound
Work that is slow because of computing, not waiting, such as hashing or resizing images.
When to use Synchronous, when to use Asynchronous
Real situations, and the pick we would make in each one.
Pick Asynchronous
A web server handling thousands of open connections that mostly wait.
Each connection spends most of its life waiting on the network. An event loop can hold many of them with very few threads.
Pick Asynchronous
Fetching prices from 50 suppliers for one page.
The 50 calls do not depend on each other. Start them together and the page waits about as long as the slowest supplier.
Pick Synchronous
Charge the card, then create the order, then send the email.
Each step needs the result of the one before it. Running them in order is correct, and async would not make it faster.
Pick Synchronous
Resizing 10,000 images.
This is CPU work. Async cannot overlap computing; use several processes so more CPU cores share the job.
Pick Synchronous
A small one-off script that calls one API.
There is nothing to overlap. Plain synchronous code is shorter and easier to debug.
Pick Both
Sending a welcome email after sign-up without making the user wait.
Answer the user synchronously, and hand the email to a background queue that sends it asynchronously.
Two questions decide if async will helpAsync pays off only on the far right path: waiting, and waits that do not depend on each other.
we ran this, here is what happened
Hands-on: We made 50 slow calls, four different ways
Many explanations stop at "async is faster". We wanted to know when it is faster, and when it is not.
We ran a tiny web server on one laptop that waits 100 milliseconds before answering every request, like a slow database or API. Then a client asked it 50 times: synchronously one by one, with async code but awaiting each call before the next, and with async code that starts all 50 together.
As a control we also timed 50 pieces of pure computing (hashing), with no waiting at all, done in order and through asyncio. We ran the whole script three times.
Where it ran: Apple M4, macOS 15.6, Python 3.13.15, httpx 0.28.1, a local asyncio HTTP server on 127.0.0.1 that sleeps 100 ms per request. Three full runs on 4 October 2026.
def sync_sequential() -> dict:
t0 = time.perf_counter()
for _ in range(CALLS):
with urllib.request.urlopen(URL) as r: # blocks here until the answer arrives
r.read()
return {"seconds": round(time.perf_counter() - t0, 3)}
async def async_one_by_one() -> dict:
async with httpx.AsyncClient() as client:
t0 = time.perf_counter()
for _ in range(CALLS):
await client.get(URL) # async code, but each await finishes before the next starts
return {"seconds": round(time.perf_counter() - t0, 3)}
async def async_gather() -> dict:
limits = httpx.Limits(max_connections=CALLS)
async with httpx.AsyncClient(limits=limits) as client:
t0 = time.perf_counter()
replies = await asyncio.gather(*(client.get(URL) for _ in range(CALLS)))
return {"seconds": round(time.perf_counter() - t0, 3), "all_200": all(r.status_code == 200 for r in replies)}
The three clients from scripts/labs/compare/sync_vs_async.py, unedited. The only difference between the last two is a for loop versus asyncio.gather.
Full output of run 1 (out-sync-async-run1.json). Runs 2 and 3: sync 5.157 and 5.174 s, gather 0.133 and 0.171 s.
The results
What we measured
Synchronous
Asynchronous
50 calls, 100 ms each (3 runs)30x to 39x faster
5.15 to 5.17 s, one by one
0.13 to 0.17 s, gathered
Async code, but awaited one at a timeno gain at all
5.15 to 5.17 s
5.21 to 5.23 s
50 CPU jobs (hashing, no waiting)no real gain
0.26 to 0.29 s
0.25 to 0.27 s
All 50 answers came back OKevery gathered reply was HTTP 200
yes
yes
Three runs, measuredThe async keyword alone changed nothing. Starting the calls together cut the time by about 30 times.
What this shows
Async was 30 to 39 times faster, but only in one of its two forms. Code that used async and await yet waited for each call before starting the next took just as long as plain synchronous code, slightly longer in fact. The speed came from starting the waits together, not from the keyword. And for computing with no waiting, async changed nothing.
What this test does not show: One machine and one artificial 100 ms delay. Real APIs vary, can limit how many calls you make at once, and can slow down when you send many together. Threads are another way to overlap waits; we did not test them here. The script is scripts/labs/compare/sync_vs_async.py in our repository.
Common mistakes
"Async makes code faster."
Only waiting can overlap. In our test, 50 hash jobs took 0.26 s with or without asyncio. For CPU work, use more processes or cores.
Writing await inside a loop and expecting a speed-up.
That still runs one call at a time: 5.23 s in our run. Start the tasks first, then wait for all of them (asyncio.gather, Promise.all).
Calling a blocking library from async code.
A blocking call such as requests.get or time.sleep inside an async function freezes the whole event loop. Use an async library (httpx, aiohttp) or run it in a thread.
Firing 10,000 calls at once.
The other side may refuse or slow down. Limit how many run together, for example with a semaphore or the client's connection limit.
Confusing asynchronous with parallel.
Async means many tasks are in progress and take turns while they wait. Parallel means several run at the very same instant on different cores. Our event loop used one thread.
Questions people ask
What is the difference between asynchronous and synchronous?
Synchronous steps run in order, and each waits for the one before it to finish. Asynchronous steps can be started and left running, so the program can do other work while it waits for an answer.
What is an example of asynchronous programming?
A page that asks 50 suppliers for prices at the same time and shows the results when they arrive. In our lab, starting 50 slow calls together took 0.16 seconds instead of 5.15.
Does asynchronous mean online?
Not in programming. In education, an asynchronous course means you study at your own time instead of joining a live class. In programming, asynchronous means a task can run while the program does something else. This page is about the programming meaning.
Is JavaScript synchronous or asynchronous?
JavaScript runs your code on one thread, one step at a time, but browsers and Node.js give it asynchronous tools (callbacks, Promises, async and await) so a slow network or disk call does not block everything else.
Is Python asynchronous?
Plain Python is synchronous. The asyncio library and the async and await keywords, added in Python 3.5 by PEP 492, let you write asynchronous code. You also need async libraries, such as httpx, for the slow calls themselves.
When should I not use async?
When the steps depend on each other, when the work is mostly computing, or when the program is small. In those cases async adds complexity and, as our CPU control showed, no speed.
Lessons that go deeper
From the System Design course, in the order we would read them.
HTTPX async supportEncode (HTTPX project) · docs for 0.28 · opened 2026-10-04
Know why, not just which
Synchronous vs Asynchronous is one row in a much bigger table. Our System Design course has 770 lessons on networks, databases, caching, scaling, messaging, security and reliability, each drawn step by step, so you can explain the trade-off in an interview and pick right at work. 18 lessons are free to read, with no card needed.
the hands-on parts are real runs, like this one
course 1
System Design Masterclass
From absolute beginner to principal engineer, drawn step by step.