Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: =?UTF-8?B?TWljaGHFgiBQYXN0ZXJuYWs=?= <michal.dtz <at> gmail.com>
Subject: Re: database best practices
Newsgroups: gmane.comp.python.twisted.web
Date: Tuesday 25th November 2008 14:09:28 UTC (over 8 years ago)
Martin Bright wrote:
>
> Hi!
>
> What is the best way to implement synchronous DB access in a twisted 
> application?
>

For newly created software I would use Divmod Axiom. It uses SQLite as a 
backend.

For already existing databases (in MySQL or PostgreSQL) I would use 
Canonical Storm. It even has a branch for integreation with Twisted, 
which uses separate thread to access database.

> Do I have restructure my code such that everything that depends on 
> results from a database query is in a callback to a deferred object?
>
I believe it was Glyph Lefkowitz who once said, that he finds 
asynchronous data access APIs extremely painful (and that's why Divmod 
Axiom has synchronous API). I could not agree more; I think this is also 
a concern for you, that's why you asked this question. Even if using SQL 
with Twisted is not a problem, basing on my experience I would rather 
suggest one of mentioned approaches, than anything else.

-- 
m
 
CD: 5ms