-
Notifications
You must be signed in to change notification settings - Fork 20
v4.13 Release #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4.13 Release #266
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,20 +18,29 @@ | |||||
.. meta:: | ||||||
:keywords: motor, async, refactor, migration, asynchronous | ||||||
|
||||||
.. include:: /includes/pymongo-async-experimental.rst | ||||||
|
||||||
Overview | ||||||
-------- | ||||||
|
||||||
The {+driver-async+} driver is a unification of {+driver-short+} and the `Motor | ||||||
The {+driver-async+} API is a unification of {+driver-short+} and the `Motor | ||||||
library <https://www.mongodb.com/docs/drivers/motor/>`__. In this guide, you can | ||||||
identify the changes you must make to migrate an application from {+driver-short+} or | ||||||
Motor to the {+driver-async+} driver. | ||||||
Motor to the {+driver-async+} API. | ||||||
|
||||||
Motivation | ||||||
~~~~~~~~~~ | ||||||
|
||||||
The {+driver-async+} API is designed to be a replacement for the Motor | ||||||
library. Motor was created to provide support for Tornado, with asyncio support | ||||||
added later. Because of this, Motor provides full asyncio and Tornado support, | ||||||
but still relies on a thread pool to perform network operations. In some cases, | ||||||
Check failure on line 35 in source/reference/migration.txt
|
||||||
this might lead to performance degradation when using the Motor library. To | ||||||
address this issue, the {+driver-async+} API includes asyncio support directly | ||||||
into {+driver-short+}. | ||||||
|
||||||
|
||||||
Synchronous Versus Asynchronous | ||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||
|
||||||
To determine whether to migrate to the {+driver-async+} driver or to continue using | ||||||
To determine whether to migrate to the {+driver-async+} API or to continue using | ||||||
Synchronous {+driver-short+}, consider the information in this section. | ||||||
|
||||||
Synchronous {+driver-short+} is preferable if the following criteria applies to your | ||||||
|
@@ -45,7 +54,7 @@ | |||||
|
||||||
- You prefer the simplicity of synchronous logic when debugging your application | ||||||
|
||||||
Consider migrating to the {+driver-async+} driver if the following criteria applies | ||||||
Consider migrating to the {+driver-async+} API if the following criteria applies | ||||||
to your application or use case: | ||||||
|
||||||
- Your application implements large, highly concurrent workloads (on the order of | ||||||
|
@@ -56,19 +65,187 @@ | |||||
|
||||||
- Your application relies on other asynchronous libraries or frameworks, such as FastAPI | ||||||
|
||||||
Performance Benchmarks | ||||||
~~~~~~~~~~~~~~~~~~~~~~ | ||||||
|
||||||
The following table shows the performance benchmarks for different tasks | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A short blurb to explain that in almost every case, the new asynchronous API performs better seems helpful here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 I was just going to add a comment for the same thing |
||||||
performed with the {+driver-async+} API and the Motor library. Each task was | ||||||
performed with 10 iterations of 1000 documents each. | ||||||
|
||||||
.. list-table:: | ||||||
:header-rows: 1 | ||||||
:widths: 20 40 40 | ||||||
|
||||||
* - Operation | ||||||
- Motor Performance | ||||||
- {+driver-async+} Performance | ||||||
|
||||||
* - ``TestFindManyAndEmptyCursor`` | ||||||
- 74.074 MB/s | ||||||
- 112.490 MB/s | ||||||
|
- 112.490 MB/s | |
- 112.490 MB/s |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a date
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit pick - "Asyncio" -> "asyncio"
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake on this earlier: the new API does support Tornado, as Tornado was made fully compatible in a release some time ago.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ``AsyncCursor.each()`` does not exist in the {+driver-async+} api-root. | |
- ``AsyncCursor.each()`` does not exist in the {+driver-async+} API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all mentions: