Prevayling Stupidity

by Charles Miller on April 11, 2003

Prevayler, for those of us coming in late, is a rather nifty Java library that allows you to make persistent, atomic updates to your in-memory object model. I recently mentioned the massive hype-overkill that is their website. For a certain class of program, it's a very useful persistence solution. As an exercise in PR, it's a disaster.

One claim made on PrevaylerIsNotADatabase is that unlike RDBMS's and OODBMS's, Prevayler does not have to worry about RAM limitations. Excuse me? Huh? OODMBS's tend to suffer when your indexes can't fit in main memory any more. Prevayler will go completely to the dogs the moment any of your object model is swapped out. Surely Prevayler has to worry more about RAM than anyone else?

I posted a politely-worded query to this effect on the page, and received the following reply from the project lead:

No. Prevayler assumes the Prevalent Hypothesis. Databases do not.

To save you following the link, the Prevalent Hypothesis is (direct quote) “That there is enough RAM to hold all business objects in your system.” That's right. Users of Prevayler don't have to worry about there being enough RAM because... we assume there will always be enough RAM!

The logic is stunning in its simple, useless circularity. I shall now walk home without my umbrella, because I can just assume it's not going to rain. On the way, I will cross the road without looking, because I can assume there will be a gap in the traffic.

Travelling without an umbrella, or crossing the road, are both perfectly reasonable things to do, provided you have determined that it is safe to do so. You can't just assume everything's going to be OK. Neither can you decide everything's OK today, and then not worry about it changing in the future. The weather and traffic are changeable. So are the memory needs of an application as it grows.

Or, as I put it on another page:

If the proponents of Prevayler were a little less inflammatory, this site wouldn't leave me with such a bad taste in my mouth. I came here this evening because I thought Prevayler suited the application I was writing, but this site annoys me so much that the one thing it does convince me, is that I want very little to do with the obvious zealots running the project. You don't need to be this hype-heavy to sell a good product. The corollory is left to the reader.

For the project mentioned above, I'm going to use Hibernate and some nice aggressive caches instead. To be fair, it wasn't just the attitude that made the decision for me: I also realised I need to be quite frugal with memory, and other people might consider an SQL-accessable database a feature. It may be a little slower than Prevayler, but hey. I can just assume it'll be fast enough, right? :)

Previously: Publishing Woes

Next: Cutlery