views:

491

answers:

3

So I've been using Smalltalk for about 6 months now (Squeak and Pharo), mostly doing data analytics, and I'm about to start my first Seaside app. So my question to all you Smalltalkers out there is, what is your favorite persistence solution? I've been looking at Magma, GOODS, and GLORP. I'm a long-time python hacker, so I get ORM, but it seems like Magma or GOODS would be a better solution, since they seem object-oriented.

A quick note: I want to scale my app across multiple VM's, so just saving data to the image wont really work.

Thanks!

+9  A: 

If you want to scale across multiple VMs, you might want to to take a look at GemStone/S.

Be aware, however, that GemStone is a proprietary, commercial product. So, you will have to pay for it. However, the pricing model is generally designed in such a way, that if you need a bigger edition then you will generally also have the users to pay for that edition. The prices start out at 0 $ for the 4 GiByte disk / 1 GiByte RAM / 1 CPU version.

Another thing to note is that GemStone Smalltalk is its own dialect, so your Squeak code will probably not run unmodified, but should be fairly easy to port. (For example, the GemStone engineers have created an adapter that allows you to load Monticello (Squeak's version control system) packages into GemStone/S, also they generally make sure that Seaside runs.)

So, what is GemStone? Basically, it's a distributed VM with automatic object persistence. It's easiest to explain compared to a normal Smalltalk VM. If you have two Smalltalk VMs running side-by-side, each of them has its own Object Memory (i.e. the thing the garbage collector manages). And that Object Memory is in RAM. In GemStone, all VMs in a cluster share the same Object Memory and it lives on disk, not in RAM. So, you don't need a database, not even an object-oriented one, because your objects are "just there", everywhere, all the time.

(That's only a very simplistic description. For example, the heap is not really shared across VMs. That wouldn't make sense, you wouldn't want to replicate every temporary object you create across the network. Instead, you have a global repository object (basically, a dictionary) and just like the garbage collector will start at some well-known root object and then keep all objects that are reachable from there, and delete those that aren't, GemStone will start at the global repository object, and persist/replicate only the objects that are reachable from there.)

GemStone also has database-ish features, so access to the global repository is wrapped in ACID transactions, and there is a SQL-inspired but Smalltalkish query language.

GemStone has a nice appliance that they call "GLASS" (for GemStone, Linux, Apache, Seaside and Smalltalk) analogous to the well-known "LAMP" (Linux, Apache, MySQL and PHP). GLASS includes the gratis edition of GemStone with Seaside preinstalled and everything setup with Apache running on top of Xubuntu, everything neatly packaged into a VMWare disk image.

Jörg W Mittag
I completely agree, GemStone/S is the way to go.
Damien Cassou
Interesting... so if I had a collection with 10 million objects contained within it would the *whole* collection be in my local memory? - I'm just trying o figure out where my data would be.
KHWP
The whole collection does not have to be in _local_ memory ... large objects are implemented internally using btrees (basically) so partial collections can be loaded into local memory - your working set is kept in local memory and the rest is on disk
Dale Henrichs
Its kind of a bummer that there's no really good open source solution, but I've been looking into Gemstone, and it seems really slick
Alex
GemStone also has a Java product, and in the Java community, there are open source competitors (e.g. Terracotta). I guess the Smalltalk community doesn't really bother, they just want the best solution, and if it turns out that that the best solution costs them a bit of money, then so be it.
Jörg W Mittag
+1  A: 

If you can choose, I would also choose GLASS or Magma (it depends of how big is the project).

Take into account that GLorp in Squeak only works with PostgreSQL. We developed SqueakDBX which is a database driver to communicate with most databases. We are now modifying Glorp so that you can use it with all of them (not only PostgreSQL). But this won't be until end of this year.

+2  A: 

GLASS alone doesn't really help to give you an overview over your data. SandstoneDB does. You can use SandstoneDB with both GOODS and GLASS, (or even alone), depending on how much money you wish to spend (Sandstone is free in all senses, GLASS is commercial, but free as in free beer for small installations).

Check out the sandstoneDB page. And here's the adaptor for GOODS. To use SandstoneDB with GLASS, just switch the store to SDMemoryStore, see the class comments on SDMemoryStore in SandstoneDB.

nes1983