Elliot Murphy wrote: >> * Distributed database integrity using two-phase commit (if your Python >> driver and database backend support it). > > Can you tell me about how I would use this? Does it work with postgres?
When you are dealing with multiple databases, your application will often need to commit changes to more than one of them. So you commit changes to one, and then attempt to commit changes to another but this second attempt fails for some reason. You now have data in the first database that is inconsistent to all the others. Two-phase commit is the solution databases give us to resolve this situation (Well, some databases. Others just make you hope the situation never happens.) Instead of just having a COMMIT, it gives you a 'prepare to be committed' command. So you iterate over all your databases telling them 'get ready to commit and give me an error *now* if there is going to be any problem. If they are all happy, you issue the final commit on all the backends which is almost certainly guaranteed to work (how certain depends on how well the feature is implemented, but at a minimum you should have no trouble with stuff like deferred constraints or conflicts with another transaction). PostgreSQL now offers this feature (since 8.2 I think), but it is pretty new so I don't think any of the Python drivers expose it yet. So no, Storms two-phase commit is currently just a no-op with PostgreSQL (but as soon as psycopg or one of the other PostgreSQL database adapters support it, it will provide the data integrity required for ensuring data integrity over a cluster of PostgreSQL databases without requiring any sort of proxy like pgpool-II, and if you are using the API you won't even need to change any code). For psycopg: http://www.initd.org/tracker/psycopg/ticket/172 Hmm... perhaps that item doesn't belong on the front page - I don't know if any of the backends Storm currently supports supports it so it could count almost as vapourware. The API is still relevant though, as it gives a concrete use for the feature to the driver maintainers. -- Stuart Bishop <[EMAIL PROTECTED]> http://www.canonical.com/ Canonical Ltd. http://www.ubuntu.com/
signature.asc
Description: OpenPGP digital signature
-- storm mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
