The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Elephant to replace Prevayler

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Elephant to replace Prevayler Posted: Jun 28, 2005 3:45 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Elephant to replace Prevayler
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

For a while now I've had a package called Prevayler that basically ran as a local disk based object oriented database. It was really easy to use - read: completely transparent. But it did have its quirks:

  • While it was called Prevayler, it didn't work like Prevayler
  • It couldn't let two images access it at once
  • It's garbage collection only worked properly if every object was in memory
  • It liked to keep everything in memory, it never forgot stuff back to disk
  • It had no unit tests
  • It used BOSS files to store the data (good luck if something goes wrong!)
  • It didn't have a clear API for schema migration
  • It had no indexes
  • It did not guarantee ACID
  • You could only commit to disk, not other sources like a database
  • It did not do transactions
  • There was only ever one repository

So I've started a new project called Elephant that will replace Prevayler. I'm intending it to fix up all the issues described above so that it works as a real database. (All except making it work like Prevayler, since the way Prevayler works is plain dumb). It may even perform well - who knows.

This kind of technology is meant to make it easy to start persisting data without getting in to the nitty gritty of a database. It's not intended to replace a database that's going to hold millions of records. But honestly, how often do you make applications like that? Amusingly enough, if Elephant can commit to a database.. then it very well could support millions of records.

I've just published v1.0 of Elephant to the public store. It has unit tests and it has much simpler code. It's also based on Martin McClure's ImmutibilityPolicy framework which will become standard for VisualWorks in the future. Prevayler was incompatible with Martin's framework.

Elephant also can support multiple repositories, which is a bonus. In fact, the tests run in a 'test' repository so that if you have running objects, the testing system will not interrupt your data.

So of the list above, Elephant still has the following to go:

  • It can't let two images access it at once
  • It doesn't have a clear API for schema migration
  • It has no indexes
  • It did not guarantee ACID
  • You can only commit to disk, not other sources like a database
  • It does not do transactions

So the next version, 2.0 will tackle the following issues:

  • It can't let two images access it at once
  • It doesn't have a clear API for schema migration
  • It did not guarantee ACID
  • It does not do transactions

Then version 3.0 may tackle the rest of the issues.

I've been talking to Blaine Buxton about Prevayler and Elephant and I think I've convinced him to port the project to Squeak and VA. But it won't be worth him doing that until there is a 2.0 version.

But for now, Elephant is a viable replacement for Prevayler. I'll be using it in a few projects shortly to ensure that it is solid enough to be used as a replacement for Prevayler. My confidence is high as I have unit tests this time. Every thing that goes in to Elephant from here on is pure bonus on top of the old Prevayler feature set.

So how do you use Elephant? Well it's really simple actually. You make a Repository object and tell it where its data goes and that's it:

(myRepository := Repository new) path: 'my-data'.

Now you can call #trunk on it to put stuff in your Repository. Absolutely anything except system data can go in there (ie: classes, blocks, UI stuff, etc).

myRepository trunk at: #settings put: mySettingsObject.

For more detail on how to use it, take a look at the test cases.

Read: Elephant to replace Prevayler

Topic: For the Wine collector who has everything Previous Topic   Next Topic Topic: Sunday Theme parking

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use