[MUD-Dev] On Lockless Threading and X/Open XA

Bruce bruce at puremagic.com
Sun Jul 30 02:39:44 New Zealand Standard Time 2000


Good day list,

In thinking about a server architecture, I've been thinking about
transactional models lately, the use of multiple databases, and how that
fits in with a lockless threading system such as C&C.

In the system as I currently see it, I have many disparate sources of
data to be accessed and to be written to, within the context of a single
transaction.  This may include:

 * Spatial indices.
 * Game-related data.
 * User/Account information.
 * Log data, both databases and flat file.
 * Probably plenty of other stuff.

I would plan on using C&C for the game related data and spatial indices
which reside in our own OODBMS software.  For anything accessing SQL
servers, they would be providing their own deadlock detection and
prevention.

In the enterprise DB world, you can use a transaction manager (such as
MS Transaction Server, Tuxedo, among other products) to manage this
process.  Doing so requires that all resource managers (the DBs)
communicate with the transaction manager via the X/Open standard XA.  If
I can hook into this, I can get a lot of what I want by using (or
writing) a XA-supporting transaction monitor and XA-compliant databases
(PostGreSQL, DB/2, Berkely DB, Informix, Oracle, etc.).

The problem comes in though when the transaction manager is defined to
be using the two-phase commit process.  In the two phase commit process,
there are (duh) 2 phases.  The first phase is lock acquistion.  Once any
work is committed and a lock is released, all of the locks must be
released.  Any failure must occur before the first lock is released.

This doesn't mesh very well with the C&C method, where things proceed
merrily until they attempt to commit and then they fail.

I'd like to be able to use a system similar to C&C where in deadlocks
don't happen, but it'd also be nice to use industry standard protocols
and products apart from those that I write.

Apart from abandoning C&C-style plans, does anyone see a way to marry
these two types of systems, or even some other solution for lockless
threading that might mesh better with a 2 phase commit-based system? 
Are there other systems out there for handling distributed transactions?

Info on this stuff can be found at:

About XA in general:
http://www.aurorainfo.com/wp3/

Understanding Two Phase Commit:
http://nscpcw.physics.upenn.edu/db2_docs/db2d0/db2d073.htm#HDRXMP2PC

How to get the XA Specification:
http://www.opennc.org/pubs/catalog/c193.htm

What is XA?
http://www.transarc.com/~brail/training/xa.html

The Transaction Internet Protocol (IETF):
http://www.ietf.org/rfc/rfc2372.txt

Another alternative is to ignore existing XA-compliant software and the
specification itself and roll the handling of SQL transactions and
interactions with any other databases into the same mechanism used for
handling network and file i/o.

(And to think that one day I was happy with Cold ...)

 - Bruce



_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list