| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: "Transactions are bad, real bad" - discuss
Paul Vernon wrote:
> "Costin Cozianu" <c_cozianu_at_hotmail.com> wrote in message
> news:b8mecc$bnbun$1_at_ID-152540.news.dfncis.de...
>
>>Ok, let's say you want only single statement updates,
>>with single >>statement supporting multiple database operations.
That's a useful abstraction for you to claim that your model can be sustained, it's not a useful abstraction for me at all as the user of the database.
How you're going to transport or refer to the new database value in a client server protocol ? It's not making sense at all.
What I do with INSERT , UPDATE, DELETE SELECT is that I apply a transformation to the old database value. I couldn't care less most of the times what was the old value and what is the new value, only some properties thereof.
As a consequence I'm not receiving database values nor am I sending database values, I am applying operations. Some operations are a composition of many simpler operations. This composition should obey the properties of transactions, and should support some concurrency control features.
Otherwise, I won't be using your model at all, no thank you very much.
> Remember INSET, DELETE and UPDATE are not primitives, only assignment is.
>
Quite. +,-,*,/ are not primitive only *succ* is succ(0)=1, succ(1)=2 ... , + n 0 = n, + n succ(k) = succ( + n k), ....
Let's set aside programming languages for a while and let's joyfully program in Peanno's arithmetic, with a little ambition we can do it :)
>
>
>>Now, how do you design a client server protocol, in which the client >>programmer wants to decide later in the host language some based on the >>results from database and other possibly external conditions, what is >>the next database update to be executed (of course in a transaction-like >>mode if you claim you don't support tansaction).
I'm sorry it is you who make claims here. If you don't have a systematic approach to address my needs, and claim you have a model that covers everything you're on the loosing side.
Here's a deal: I reserve a sum to be debited against a client account (the sum is not debited yet, just the available balance reflects the reservation - i.e. the client has committed to pay). Based on some other happenings in the client software (let's say I cannot performa the service, or I can, etc), I want either to go ahead with the debit, or cancel the transaction (ROLLBACK). Compose several of these happening
BEGIN
db->DB_STATEMENT1
client->ACTION1
db->DB_STATEMENT2
client->ACTION2
db->STATEMENT3
END
Where each consecutive action depends on some results of the previous
action, and at each point in time client should be able to decide a
rollback.
> My short answer is, if the 'client programmer' want to freeze time then
> tough - that is not allowed in this model of reality.
>
Tough luck indeed. So we are back to using better models of reality. Like transactions.
>
>
>>How do you integrate databases and others in a distributed transaction ?
Well, another reality check for you: not all participants in distributed systems are databases. Even if some are databases not all need to support relational algebra. Therefore you cannot say
BIG_VALUE_OFTHE_WHOLE WORLD := NEW_VALUE_OF_THE_WHOLE_WORLD Imagine the scenario above with DB and client, compounded by several participating resource managers.
>
>
>>How do you allow for rollback, possibly even in the middle of an update >>operation ?
The middle of an update means exactly what I said the middle of an update. I perform an update, I get some results back, do a computation in the client, depending on my results, I'll issue some more updates, or I want to issue a rollback.
>
>
>>Related to the above, what is your model for concurrency control ? Do >>you only allow for fully serializable executions ?
>>How is database going >>to decide that, if instead of a peacemeal statement by statement >>transaction, it will have to wait somehow for the full single statement >>behemoth ?
Yes. You just shifted the burden to the client programmer.
> Not ignoring this rule does
> deprive us of a possible hack to improve performance. but because we don't
> have transactions waiting on external code (or worse, external events) we
> don't have such serious concurrency issues. Anyhow is it better to be fast or
> correct?
>
> To be fair, I've not investigated this aspect all that thoroughly, but I only
> see benefits here. For example, the DBMS knows the full extent of the database
> that any statement will touch. With a transaction, the full scope is usually
> unknown at the beginning of the transaction. Second, transactions encourage
> users to alter data in place and in a piecemeal fashion, banning transactions
> encourages users to build up data elsewhere then apply it in one go. This
> frees the existing data from contention and helps concurrency. Third, for
> updates that can be proved to be correct (e.g. divide by zero not possible,
> duplicate violation not possible, ...), long running update statements (say
> DELETE FROM BigTable WHERE Date + 1 Month < TODAY) can actually be *included*
> in subsequent queries/updates. So SELECT COUNT(*) FROM BigTable becomes SELECT
> COUNT(*) FROM BigTable WHERE Date + 1 Month < TODAY, while the big delete is
> still running...
>
> BTW If you could come up with an example of where you think a 'large' single
> statement will under perform, or provide worse concurrency than many
> statements within a transaction, then that could be useful to our discussions.
>
No, you made a claim, you have to provide at least as good mechanism as transactions do. You have to do that in a consistent and systematic fashion, it's not like: "give me this particular use-case, I'll program something ad-hock,and see, it can be done without transactions". I know it can be done without transactions, by reinventing some wheels, that is.
>
>>This is just to begin with, depending on your responses we'll see what >>follows...
Best,
Costin Cozianu
Received on Tue Apr 29 2003 - 16:31:36 CDT
![]() |
![]() |