On Mon, Mar 20, 2000 at 11:45:05AM +1100, Adam Moore wrote:
> > Considering http is a stateless protcol How can you use the
> > transaction monitor if the middleware does not understand
> > transactions? Is there any advantages? Any comments / web sites would
>
> Take something like an online purchase (cdnow.com). When you enter details
> and hit purchase button, lots of things happen behind the scenes, take as
> example just three:
>
> [ transaction start ]
> 1. CDNOW update their stock tables.
> 2. Financial transaction is made.
> 3. Flag saying "send this crap to customer x" is updated.
> [..]
> 100. Nothing has gone wrong. Inform user that purchase is success.
> [ transaction complete ]
>
> With transaction support, you can rollback and exit with an error (maybe
> notifying a dba, whatever). Without.. well, painful..
A more common example is that of 'race' conditions. Once you get an active
enough system, they're very common. (On a side note, they're a common
discussion on the Linux Kernal mailing list as well)
An example:
User A User B
- Find highest number = 100 - Find highest number = 100
- add one to hightest = 101 - add one to highest = 101
- insert record 101 - insert record 101
The result is that you now have *2* (or more) records with the same
information. Not good.
With transactions the following occurs:
User A User B
- Start transaction - Start transaction
- Find highest number = 100 - System busy - please wait
- add one to hightest = 101 - System busy - please wait
- insert record 101 - System busy - please wait
- End transaction - Find highest number = 101
- add one to hightest = 102
- insert record 102
- End transaction
You'll notice that User B is waiting for his turn. This means that
databases that do full transaction support will always be slower
than ones that don't, such as MySQL.
However, there are ways around not having transactional support
and I believe MySQL have one (or more) of them in place.
> Mysql kicks bootie for raw speed[1], but the trade off (compared to
> postgres) is functionality. That said, I wouldn't consider deploying
> either in production.
Out of curiosity, which one(s) would you consider?
Cheers
Paul Haddon
Technical Services Manager
Hartingdale Internet
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text