Motor——一個非同步MongoDB驅動器
[i=s] 本帖最後由 jieforest 於 2012-7-11 20:23 編輯
Tornado is a popular asynchronous Python web server, and MongoDB a widely used non-relational database. Alas, to connect to MongoDB from a Tornado app requires a tradeoff: You can either use PyMongo and give up the advantages of an async web server, or use AsyncMongo, which is non-blocking but lacks key features.
I decided to fill the gap by writing a new async driver called Motor (for "MOngo + TORnado"), and it's reached the public alpha stage. Please try it out and tell me what you think. I'll maintain a homepage for it here, including basic documentation.
Status
Motor is alpha. It is certainly buggy. Its implementation and possibly its API will change in the coming months. I hope you'll help me by reporting bugs, requesting features, and pointing out how it could be better.
Advantages
Two good projects, AsyncMongo and APyMongo, took the straightforward approach to implementing an async MongoDB driver:
they forked PyMongo and rewrote it to use callbacks. But this approach creates a maintenance headache: now every improvement to PyMongo must be manually ported over.
Motor sidesteps the problem. It uses a Gevent-like technique to wrap PyMongo and run it asynchronously, while presenting a classic callback interface to Tornado applications.
This wrapping means Motor reuses all of PyMongo's code and, aside from GridFS support, Motor is already feature-complete. Motor can easily keep up with PyMongo development in the future.
Tornado is a popular asynchronous Python web server, and MongoDB a widely used non-relational database. Alas, to connect to MongoDB from a Tornado app requires a tradeoff: You can either use PyMongo and give up the advantages of an async web server, or use AsyncMongo, which is non-blocking but lacks key features.
I decided to fill the gap by writing a new async driver called Motor (for "MOngo + TORnado"), and it's reached the public alpha stage. Please try it out and tell me what you think. I'll maintain a homepage for it here, including basic documentation.
Status
Motor is alpha. It is certainly buggy. Its implementation and possibly its API will change in the coming months. I hope you'll help me by reporting bugs, requesting features, and pointing out how it could be better.
Advantages
Two good projects, AsyncMongo and APyMongo, took the straightforward approach to implementing an async MongoDB driver:
they forked PyMongo and rewrote it to use callbacks. But this approach creates a maintenance headache: now every improvement to PyMongo must be manually ported over.
Motor sidesteps the problem. It uses a Gevent-like technique to wrap PyMongo and run it asynchronously, while presenting a classic callback interface to Tornado applications.
This wrapping means Motor reuses all of PyMongo's code and, aside from GridFS support, Motor is already feature-complete. Motor can easily keep up with PyMongo development in the future.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-735212/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MongoDB的Motor驅動器進度情況MongoDB
- 基於 mysql 非同步驅動的非阻塞 Mybatis 瞭解一下MySql非同步MyBatis
- Asyncdb(一):寫一個純函式式的Mysql非同步驅動函式MySql非同步
- 一文讀懂 MongoDB驅動程式 APIMongoDBAPI
- Log新增MongoDB驅動2MongoDB
- Zilla:一個事件驅動的API閘道器事件API
- 一個遍歷驅動器的c程式碼C程式
- MySQL 非同步驅動淺析 (一):效能分析MySql非同步
- How does an Electric Motor work? (DC Motor)
- 驅動Driver-阻塞&非阻塞
- Motor-CAD— 新能源驅動電機快速設計與優化工具優化
- 快速掌握mongoDB(四)—— C#驅動MongoDB用法演示MongoDBC#
- 分享一個LCD驅動框架框架
- laravel6 Log新增MongoDB驅動LaravelMongoDB
- mongodb c++ 驅動庫編譯MongoDBC++編譯
- 驅動Driver-非同步通知非同步
- mongodb的java驅動與spring的整合MongoDBJavaSpring
- 在C#中使用官方驅動操作MongoDBC#MongoDB
- C#基於Mongo的官方驅動手擼一個Super簡易版MongoDB-ORM框架C#MongoDBORM框架
- windows10系統下iCloud驅動器未同步怎麼辦WindowsCloud
- 【linux】驅動-13-阻塞與非阻塞Linux
- 同步非同步,阻塞非阻塞非同步
- 非同步、同步、阻塞、非阻塞非同步
- 同步、非同步、阻塞、非阻塞非同步
- 【linux】驅動-14-非同步通知Linux非同步
- 使用 spring reactor 非同步事件驅動SpringReact非同步事件
- 非同步通知和MISC裝置驅動非同步
- 製作一個文件同步工具,自動同步到gitee中。。。Gitee
- 一個事件驅動的圖片爬蟲事件爬蟲
- 第一個linux驅動開發包Linux
- 如何實現一個能精確同步滾動的Markdown編輯器
- 一篇文章讀懂阻塞,非阻塞,同步,非同步非同步
- MongoDB叢集同步MongoDB
- 如何編寫一個簡單的Linux驅動(三)——完善裝置驅動Linux
- 同步非同步 與 阻塞非阻塞非同步
- 理解阻塞、非阻塞、同步、非同步非同步
- 同步、非同步,阻塞、非阻塞理解非同步
- 同步、非同步、阻塞與非阻塞非同步