Prevayler 2.0, a prevalent persistence engine, was released a few days ago.

This is the first time I have heard about this project or about this type of persistence engine, but it sounds very promising. Prevayler can be used in lieu of a (relational or object-oriented) database in many cases. It is based on simple mechanisms that are built into the Java language, in particular serialization. The idea is that the engine tracks and logs any changes in (due to commands being run on) your business objects. Upon restarting your application, Prevayler is able to bring it back into the state it was in before it was shut down simply by re-executing the commands based on the log file. It also supports saving snapshots (I believe these are stored using XML), to avoid having to recreate the entire history since the beginning every time the application is restarted. The general usage pattern seems to be to save a snapshot in a regular interval (such as every day) and log changes in between snapshots.

Supposedly, queries are lightning fast (several orders of magnitude faster than relational databases), and the paradigm fits nicely within object oriented development; much nicer than relational databases, which always have to be bridged in some way in order to work with object oriented applications.

One drawback is that Prevayler requires the entire application’s data to be stored in memory. While this is certainly feasible for small to mid-size applications, I am concerned about larger applications. Also, future scalability may be more difficult. For example, with a traditional database-based server-side application, it is easy to start small with a single application server and a single database. If the system later evolves into a larger application with more sophisticated concurrency requirements, the system can easily be scaled by adding additional application servers and potentially database servers. In contrast, using Prevayler as the persistence mechanism, simply adding another application server is not possible, as the entire data exists in memory in the one and only JVM. Of course, there might be ways of migrating the application to another persistence mechanism when it comes to this. In this case, object-relational mapping frameworks such as Castor, Hibernate, or JDO would probably be good candidates.

I might check Prevayler out at some point, as it definitely sounds like a promising alternative to databases for certain types of applications.

TheServerSide discussion