What does it do?
Motor is MongoDB’s official asynchronous driver for Python, meaning it lets a program fire off a database request and keep doing other work while waiting for the answer, rather than freezing until the database responds. It’s built on top of the same ideas as PyMongo but designed specifically for async frameworks like asyncio and Tornado, which are common in applications that need to juggle many simultaneous connections, like a busy chat server or a real-time API. Using it feels similar to using PyMongo, just with an extra step of explicitly waiting for results, the tradeoff async code generally requires. It exists because a synchronous database driver would become a bottleneck in an application otherwise built to handle many things concurrently.
See it in action
This code connects to a MongoDB database, adds a new product record, and prints every product stored, all without freezing the program while it waits.
import asyncio
import motor.motor_asyncio
async def main():
client = motor.motor_asyncio.AsyncIOMotorClient("mongodb://localhost:27017")
db = client["shop"]
await db.products.insert_one({"name": "Widget", "price": 9.99})
async for product in db.products.find():
print(product)
asyncio.run(main())
Why would a non-developer care?
Applications that need to handle thousands of simultaneous connections — a chat app, a live sports score tracker, a busy API — can’t afford to have every database call freeze the whole program while waiting for a response. Motor matters because it lets MongoDB-backed applications scale to that kind of concurrent load without the database becoming the weak link. Without it, developers building async Python applications on MongoDB would be stuck bolting on unofficial, less reliable workarounds.
Real-world examples
Motor is commonly used in async Python web services, particularly those built with Tornado or newer async frameworks, that are backed by MongoDB and need to handle many simultaneous users efficiently. It’s the natural choice whenever a team is already committed to MongoDB but is also building with modern async Python patterns. Without an official async driver, teams would have to run PyMongo in a way that blocks other work, undercutting the benefits of building an async application in the first place.
Who uses it
Developers building async Python applications on top of MongoDB, especially high-concurrency services handling many simultaneous connections.
How it compares to alternatives
PyMongo is Motor’s synchronous sibling and the better choice for simpler scripts that don’t need to juggle many operations at once. Tortoise ORM and SQLAlchemy’s async mode solve a similar concurrency problem but for relational databases rather than MongoDB. Motor is specifically the MongoDB team’s own answer to that same async database problem.