Thursday, May 14, 2009

SandstoneGOODS

SandstoneGOODS brings SandstoneDB (you might have to click that link twice) a backend to the GOODS object database. Using SandstoneGOODS, you can have the easiest thinkable persistence and transaction safety for your objects coupled with reasonable performance and scalability in Squeak Smalltalk.

SandstoneDB is the coolest OODBMS I am aware of, but until now there were only two ways of using it: either from Squeak using only one Squeak instance, or from a full-blown Gemstone. SandstoneGOODS allows to use SandstoneDB and one session per client in squeak seaside, which, some argue, is a very performant way to host Seaside web pages.

So, how does it work?


  1. get a working copy of GOODS from http://www.garret.ru/goods.html and install it.
  2. Put the following file into the directory where you want the database to reside:
    1
    0: localhost:6000

    and call this file goods.cfg.
  3. Enter a shell and navigate to the directory where you put the goods.cfg file. Execute goodsrv goods
  4. Start up Squeak and install SandstoneGOODS (and all its requirements, namely GOODS, BTree, SandstoneDb).
  5. shut down the image and restart it
  6. You're ready to go! Use SandstoneDb as described by Ramon Leon


Performance


I can execute 1000 small commits in 30 seconds:

[ 1000 timesRepeat:[ SDChildMock new save] ] timeToRun.


I can execute one commit of 1000 small objects in 3 seconds:

[ SDActiveRecord commit:[ 1000 timesRepeat:[ SDChildMock new save ] ] ] timeToRun.

Read speed is excellent: reading 5000 objects from the db can be done in 1 second:

[SDChildMock findAll ] timeToRun--and once they're in cache, they are read in 0.1 seconds.

Altogether, I think SandstoneGOODS totally rocks and you can write your whole app using SandstoneGOODS faster than it took you before to write the ORM mapper definitions. Please tell me any bugs you find at niko.schwarz@googlemail.com. The repository allows public writing. You can find the sourcode on squeaksource.

6 comments:

  1. wow, this looks very cool!!! time to revert back to sqlite to OODB?(goods + sandstonedb)

    ReplyDelete
  2. Thanks for liking it! There have been 44 downloads already on SqueakSource, although I'm not sure how many of them I am responsible for.

    ReplyDelete
  3. Niko, this is great and I'll be playing with this very soon. Does this work with VisualWorks? Thanks again for the post.

    ReplyDelete
  4. Con: I don't know. If something doesn't work, feel free to tell me, I'll look into it.

    ReplyDelete
  5. Have you gotten this to run on Pharo?

    I had to add BTree>>removeKey:ifAbsent: in order to get SDActiveRecord>>delete to work.

    BTree>>at:ifPresent is missing if you try to save an existing SDActiveRecord, and I can't figure out the intent.

    Should I be installing a different version of BTree?

    Thanks!

    Rob

    ReplyDelete

Note: Only a member of this blog may post a comment.