MagLev is a 64-bit open source implementation of the Ruby programming language and libraries built on top of VMware’s GemStone/S 3.1 Virtual Machine.
MagLev
MagLev is a ruby implementation which allows to store ruby objects persistently. Quoting from the MagLev site:
MagLev is a fast, stable, 64-bit open source implementation of the Ruby programming language and libraries built on top of VMware’s GemStone/S 3.1 Virtual Machine.
Why it differs
On the first look, MagLev is just another implementation of ruby 1.8.7. The big difference between MagLev and other ruby interpreters is, that it carries its own database with it. This is not just your ordinary sqlite3 database which lives in its own file, its a fully persistent object store which allows to store any kind of objects, inheritance hierarchies and object relations. Calling it a mere "database" is therefore a gross understatement. However, introducing a new model does come with new responsibilities, as the MagLev model does not quite fit in with rails and it is not quite the same as the Smalltalk model in which everything in an image is persistent. Let me try to summarize this in a little table:
| Rails | Maglev | Smalltalk
------------+---------------------+---------------------+-----------------------
data | database | image / stone | image / stone
------------+---------------------+---------------------+-----------------------
logic/code | files/VCS | ?files/VCS?/image | ?files/VCS?/image
------------+---------------------+---------------------+-----------------------
classes are | open, transient | open, persistent | invariant, persistent
| | single definition | version history
------------+---------------------+---------------------+-----------------------
structure | DB-structure | class definitions, | class definitions,
definition | | persistent objects | all objects persist
------------+---------------------+---------------------+-----------------------
metadata | schema.rb automatic | ?? | ?not necessary?
------------+---------------------+---------------------+-----------------------
migrate | database structure | data structure | data structure
| | some code changes | all code changes
------------+---------------------+---------------------+-----------------------
deployment | deploy VCS delta | ?deploy VCS delta? | ?run all data and
| run all migrations | run all data and | code migrations?
| | some code migrations|
At the moment there is little explicit metadata for MagLev objects, only the ruby methods
method which does not include type information. For basic rails this should not be a big deal, as schema.rb
seems to be mostly used to cast database data correctly as it basically comes across an SQL connection as a string. Maglev does not need to do this as it is very well aware of the type of data it stored.