I am writing a web application that uses nginx to serve static content and tornado to serve dynamic content. I was thinking of utilizing CouchBase as my datastore, but am having trouble locating a suitable client for use with the Tornado framework (i.e. asynchronous). Anybody know of one?

I've seen trombi: https://github.com/inoi/trombi but couldn't find much information on it. If anyone has had any experience with it (good or bad), I'd love to hear about it.

有帮助吗?

解决方案

I would really recommend sticking with the Couchbase released code for Python. While it isn't technically asynchronous, the queries are so fast that it really doesn't factor into things. Its not like building out a query for a Database which could easily lock up continued actions for a period of time. Not to mention the fact there is a lot of load balancing and bucket management code that you would lose in most situations by trying to find some third party module for it.

Also you can always build a multiprocessing package to create sub-processes to handle removing these calls from the primary process stream and reduce the impact to almost nothing.

UPDATE

Another option is to use Tornado's internal callback functionality to offset the blocking process so it doesn't impair browsing. A method for this is described here: http://tornadogists.org/2185380/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top