Prevayler Performance Reality Check
Many people have seen the query performance results shown on the Prevayler home page. Although the performance numbers may appear impressive at first glance, there’s more to the story.
I worked on a team who evaluated Prevayler as an alternative to an RDBMS. The primary motivation was to improve application performance. It was interesting to us that we actually saw performance decreases with Prevayler compared to the existing RDBMS solution. After taking a closer look at the Prevayler web site we noticed some interesting facts.
Caching read-only RDBMS data will give similar query performance results as Prevayler.
The two Prevayler performance benchmarks are for query processing and transaction processing. The query performance is what’s been most emphasized. For example, it’s the only one mentioned on the Prevayler home page and the one I see repeated most often in online discussions. According to this benchmark, Prevayler is 10,000 times faster than Oracle and 3000 times faster than MySQL. The obvious reason for these performance differences is that Prevayler is loading all the data into memory before doing queries. The test is based on read-only data. Caching read-only RDBMS data will give similar query performance results as Prevayler. As an experiment, I made a very small change to the JDBC query benchmark to cache the persistent data and the performance was very close to Prevayler. It would be interesting if someone would implement the Prevayler query test using Hibernate and caching. I’m guessing the performance will be almost identical if the cache is preloaded like it is in Prevayler.
Prevayler is 2.6 times slower than SQLServer and 5.4 times slower than MySQL for transaction processing.
Most developers, including the Prevayler supporters, often don’t look past the query tests. That’s unfortunate, because the transaction tests are very telling. Prevayler is 2.6 times slower than SQLServer and 5.4 times slower than MySQL for transaction processing. Remember, these aren’t my results. These are the results posted on the Prevayler web site. However, we saw similar performance issues in our own testing.
The existing Prevayler performance reports will make it difficult for developers to compare their independent tests. The reports describe the database vendor and the processor speed but don’t specify the test computer’s memory size or network speed. Memory and network configuration can have a significant impact on performance results.
In summary, if you have read-only data in the RDBMS then simply caching it will yield similar query performance as with Prevayler. If you have update or insert transactions in your application you will probably get better performance using an RDBMS (3-5 times better).
There may be reasons to use Prevayler, but performance isn’t one of them.
Post a Comment