#37165: Update Async Topic Docs
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Carlton Gibson:
Old description:
> The [https://docs.djangoproject.com/en/6.0/topics/async/ Asynchronous
> support] topic doc was written when we first introduced async support.
> It's outdated, and the warnings it gives are misleadingly negative. Time
> to refresh it.
>
> The main problems are:
>
> 1. It strongly implies that Django's asynchronous story is unfinished.
> It's **often** liked to in blog posts. And it's totally misleading. The
> user API is essentially finished. From the PR: """Many parts of Django
> provide asynchronous APIs, including :ref:`the ORM <async-queries>`, the
> cache framework, authentication, sessions, mail, and signals. For other
> code, the :func:`sync_to_async` adapter is a low-cost bridge (see
> :ref:`async_performance`)."""
>
> 2. The performance warnings are severely outdated.
> `sync_to_async`/`async_to_sync` usage is in the order or microseconds
> with modern versions of Python. This plays directly into implementation
> considerations where we're constantly pulled towards duplicating whole
> code trees, on the mistaken assumption that `sync_to_async` usage (in
> particular) incurs a (relatively) massive performance hit.
>
> 3. It makes no mention of the remaining async difficulties — such as
> concurrent DB queries — which are **not Django specific**. In particular
> connection pooling is the appropriate lever to increase throughput,
> regardless of whether you're using Django, any other async orm, or raw
> connections by hand. (The current phrasing implies it's the ORM that's at
> fault here: it's not!)
>
> The topic doc here is a big source of the negative narrative about
> Django's async story. It's time to correct that.
New description:
The [https://docs.djangoproject.com/en/6.0/topics/async/ Asynchronous
support] topic doc was written when we first introduced async support.
It's outdated, and the warnings it gives are misleadingly negative. Time
to refresh it.
The main problems are:
1. It strongly implies that Django's asynchronous story is unfinished.
It's **often** linked to in blog posts. And it's totally misleading. The
user API is essentially finished. From the PR: """Many parts of Django
provide asynchronous APIs, including :ref:`the ORM <async-queries>`, the
cache framework, authentication, sessions, mail, and signals. For other
code, the :func:`sync_to_async` adapter is a low-cost bridge (see
:ref:`async_performance`)."""
2. The performance warnings are severely outdated.
`sync_to_async`/`async_to_sync` usage is in the order or microseconds with
modern versions of Python. This plays directly into implementation
considerations where we're constantly pulled towards duplicating whole
code trees, on the mistaken assumption that `sync_to_async` usage (in
particular) incurs a (relatively) massive performance hit.
3. It makes no mention of the remaining async difficulties — such as
concurrent DB queries — which are **not Django specific**. In particular
connection pooling is the appropriate lever to increase throughput,
regardless of whether you're using Django, any other async orm, or raw
connections by hand. (The current phrasing implies it's the ORM that's at
fault here: it's not!)
The topic doc here is a big source of the negative narrative about
Django's async story. It's time to correct that.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/37165#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019ebfbc2dfd-3e486c65-80c9-41fe-834c-4103c4ac9672-000000%40eu-central-1.amazonses.com.