Re: ACIDity of Prevayler 2.6

Paul Bennett <[email protected]> Wed, 14 Nov 2012 19:22:11 -0500
Newsgroups gmane.comp.java.prevayler
Message-ID <[email protected]>
On Nov 14, 2012, at 4:07 PM, Robert Friberg wrote:

> Interesting discussion!
> 
> Klaus is right about the atomicity. But i would say system failure rather than system crash. Which conditions you choose to include in that category are arbitrary. 
> 
> For  LiveDB, we chose the rigid approach. Any other exception than CommandAbortedException thrown by a command is considered a system failure and triggers a rollback (full restore) to the previous state. The command author is responsible for validating and failing gracefully unless preconditions are fulfilled.
> 
> The royal food taster causes a severe performance hit for each well behaved command, better to take the hit only for the occassional rogue command.
> 
> But why does prevayler write to the journal before execution? We do it the other way around. If the command fails, either gracefully or fatally, nothing is persisted. If it succeeds but the append fails we halt the system and report falure to the calling code. If this is bad, please explain why!

That is also an interesting discussion. I've thought a lot about a similar change, that of writing the journal in parallel to executing transactions. An argument could be made that writing the log after execution leaves a point of failure that would make the transaction disappear on restart - if the system fails between execution and writing, the transaction won't be recored or replayed on restore. But I would say - so what? If the transaction conforms to prevalent constants, and only affects the prevalent system (i.e no side effects), there would be no lingering state to show it had executed - it would just be as if the transaction had never happened.

I think the same is true when writing in parallel, except that the loss could be more than one transaction, as the journal writes queue up. It might be required to throttle the transaction execution in that case if the backlog got too big.

Any comments welcome.

Paul Bennett
CTO, Metaficient Inc.

> 
> Robert Friberg
> http://livedomain.codeplex.com
> Sent from my iPad
> 
> On 14 nov 2012, at 20:06, "Klaus Wuestefeld" <[email protected]> wrote:
> 
>> Atomicity is not about detecting human errors in the coding that leads
>> to the operations in a transaction. It is about cleanly surviving
>> system crashes.
>> 
>> I would agree Prevayler provides less *Consistency* built in now, not
>> lack of Atomicity. Consistency, yes, is something that makes sense
>> from the point of view of a human being.
>> 
>> Even your best RDBMS with your typical constraints will not detect all
>> possible buggy SQL(DML) statements sent to it. That doesnt invalidate
>> its atomicity.
>> 
>> With the food taster we were consistent with regard to Java's strong
>> typing + RTEs. Now we are consistent only with regard to Java's strong
>> typing (which is already better than RDBMS constraints IMHO).
>> 
>> It was a conscious trade-off to become less consistent, on the one
>> hand, but faster, more newb-friendly, simpler and use half the RAM, on
>> the other.
>> 
>> It seems to be trivial to implement a Transaction base class that does
>> food tasting internally, orthogonal to Prevayler, if one so wishes.
>> 
>> Klaus
>> 
>> ------------------------------------------------------------------------------
>> Monitor your physical, virtual and cloud infrastructure from a single
>> web console. Get in-depth insight into apps, servers, databases, vmware,
>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>> Pricing starts from $795 for 25 servers or applications!
>> http://p.sf.net/sfu/zoho_dev2dev_nov
>> _______________________________________________
>> To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
>> _______________________________________________
>> "Databases in Memoriam" -- http://www.prevayler.org
>> 
> 
> 
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> _______________________________________________
> To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
> _______________________________________________
> "Databases in Memoriam" -- http://www.prevayler.org

-pb



------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org