<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/medium-rcrfyhv6d" -->

---
title: Medium | daily.dev
description: An introductory guide to concurrency and async/await in Python, specifically in the context of FastAPI. Explains what concurrency means using real-life...
canonical: https://daily.dev/posts/medium-rcrfyhv6d
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Medium | daily.dev
og:description: An introductory guide to concurrency and async/await in Python, specifically in the context of FastAPI. Explains what concurrency means using real-life...
og:url: https://daily.dev/posts/medium-rcrfyhv6d
og:image: https://api.daily.dev/og/posts/rCrfyHV6D.png
og:image:alt: Medium
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Medium

**[Medium](https://daily.dev/sources/medium_js)** · 5 min read · 0 upvotes · 0 comments

## Summary

An introductory guide to concurrency and async/await in Python, specifically in the context of FastAPI. Explains what concurrency means using real-life analogies, how async and await keywords work, and when to use asynchronous programming. Includes code examples with asyncio.gather for running multiple tasks concurrently, and guidance on when async is appropriate (I/O-bound operations) versus when to avoid it (CPU-intensive tasks).

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@sinturana07/what-is-concurrency-and-async-await-in-fastapi-fastapi-tutorial-series-chapter-01-bb67defd5c89>

## Questions this post answers

### When should I avoid using async in Python for FastAPI endpoints?

Avoid async for CPU-intensive tasks that keep the CPU busy rather than waiting, such as image processing, video encoding, machine learning training, large mathematical computations, and heavy data processing. Async is best suited for I/O-bound operations like database queries, HTTP API calls, file reads/writes, cloud services, message queues, and email sending, where the program can do other work while waiting.

_Developers deciding where async fits in a FastAPI codebase can find similar practical breakdowns on daily.dev._

### What is the difference between async and await in Python?

The async keyword defines a function that may need to pause and wait for an operation, while await is used inside an async function to pause execution until a specific operation completes, letting other asynchronous tasks continue running in the meantime. For example, 'async def get_user()' declares an async function, and 'await database.fetch_one(query)' pauses only that function while FastAPI processes other requests.

_Anyone learning async patterns in Python can keep digging into async/await examples via daily.dev._

## Similar posts on daily.dev

- [Sync vs. Async in Python](https://daily.dev/posts/sync-vs-async-in-python-pa3hu1n2j) · Daily Dose of Data Science \| Avi Chawla \| Substack · 3 upvotes · 0 comments
- [Use Python’s asyncio for Async Development and Testing](https://daily.dev/posts/use-python-s-asyncio-for-async-development-and-testing-ua5dnytke) · Atomic Spin · 0 upvotes · 0 comments
- [Hands-On Python 3 Concurrency With the asyncio Module Quiz – Real Python](https://daily.dev/posts/hands-on-python-3-concurrency-with-the-asyncio-module-quiz-real-python-2js1klxji) · Real Python · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#fastapi](https://daily.dev/tags/fastapi)

[View this post on daily.dev](https://daily.dev/posts/medium-rcrfyhv6d)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Medium","url":"https://daily.dev/posts/medium-rcrfyhv6d","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/medium-rcrfyhv6d"},"datePublished":"2026-07-22T07:08:35.625Z","dateModified":"2026-09-13T20:54:08.677Z","description":"An introductory guide to concurrency and async/await in Python, specifically in the context of FastAPI. Explains what concurrency means using real-life...","image":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","thumbnailUrl":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/medium-rcrfyhv6d","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,fastapi","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Medium"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/medium-rcrfyhv6d#faq","mainEntity":[{"@type":"Question","name":"When should I avoid using async in Python for FastAPI endpoints?","acceptedAnswer":{"@type":"Answer","text":"Avoid async for CPU-intensive tasks that keep the CPU busy rather than waiting, such as image processing, video encoding, machine learning training, large mathematical computations, and heavy data processing. Async is best suited for I/O-bound operations like database queries, HTTP API calls, file reads/writes, cloud services, message queues, and email sending, where the program can do other work while waiting. Developers deciding where async fits in a FastAPI codebase can find similar practical breakdowns on daily.dev."}},{"@type":"Question","name":"What is the difference between async and await in Python?","acceptedAnswer":{"@type":"Answer","text":"The async keyword defines a function that may need to pause and wait for an operation, while await is used inside an async function to pause execution until a specific operation completes, letting other asynchronous tasks continue running in the meantime. For example, 'async def get_user()' declares an async function, and 'await database.fetch_one(query)' pauses only that function while FastAPI processes other requests. Anyone learning async patterns in Python can keep digging into async/await examples via daily.dev."}}]}
```

