Maglevity

MagLev, Ruby, …

Archive for the ‘MagLev’ Category

Simple Worker Queue with Procs in MagLev

with 4 comments

At the last PDX.rb meeting, Jesse Cooke presented “A very simple implementation of a background queue/worker” in MagLev. His program uses ruby Proc objects as the unit of work. Since procs are just objects, MagLev can save them to disk and run them in any MagLev VM connected to the repository. Instant, native distributed worker queue!
Read the rest of this entry »

Written by maglevdevelopment

July 8, 2011 at 8:51 am

Posted in MagLev, Ruby

Indexing Collections in MagLev

leave a comment »

MagLev brings built-in, scalable object persistence to Ruby. You can store large numbers of objects persistently on disk and retrieve them from any VM connected to the repository, all with ACID transactions. Large collections of data often need to be searched. This post introduces MagLev’s indexing and collection querying features.

Read the rest of this entry »

Written by maglevdevelopment

April 30, 2010 at 3:01 pm

Posted in MagLev

Multiple Repositories in MagLev

leave a comment »

MagLev stores all of its state, including application classes and code, in a repository. By default, MagLev has one repository named “maglev”. But there are times you may want to have multiple repositories. If you have multiple applications, you may want to store each in its own repository. Or, you may want one repository per developer, or different repositories for development, test, staging and deployment. MagLev provides some management tools that allow you to create, destroy, start, stop and perform other tasks on repositories.

Read the rest of this entry »

Written by maglevdevelopment

January 29, 2010 at 2:16 pm

Posted in MagLev

Persistence by Reachability

with 6 comments

MagLev stores ruby objects in a persistent repository using “persistence by reachability”: given a well known, persistent object, the “root object”, all objects that are reachable from the root will also be persistent (saved in the repository). The most common form of reachability is for one object to refer to another in an instance variable. ObjectA is reachable from ObjectB if ObjectB has ObjectA as the value of one of its instance variables. There are a some other cases as well. An object’s class is reachable from the object (as are any mixed in modules). Constants of a persistent class or module are also reachable from that class or module.

Read the rest of this entry »

Written by maglevdevelopment

January 17, 2010 at 8:11 pm

Posted in MagLev

KD-Trees and MagLev

with 4 comments


MagLev KD-Tree Example

A few weeks ago, I came across this blog post by Adam Doppelt from Urbanspoon. In the post, Adam describes how Urbanspoon solved a problem they had managing their data to enable nearest neighbor searches. They need to find the nearest N items to a given location, e.g., find the 10 nearest coffee shops to my current location. It’s an interesting post and I encourage you to read it to see the various solutions they tried and rejected. In the end, they solved their problem by writing a KD-Tree C-extension, which they have published as a RubyGem.

When I read the post, it seemed that the problem was a natural fit for MagLev. So, I implemented a pure ruby version of a KD-Tree and compared it to the kdtree gem and to the pure ruby solution running on MRI 1.8.6 and 1.9.2 1.

Read the rest of this entry »

Written by maglevdevelopment

December 17, 2009 at 12:21 am

Posted in MagLev

VM(s) + Repository = MagLev

with 5 comments

MagLev is a new Ruby VM with built-in object persistence. GemStone has recently released a public alpha of MagLev.  I’m going to give a quick overview of how the VM and the object Repository work to serve up Ruby objects.
Read the rest of this entry »

Written by maglevdevelopment

December 3, 2009 at 2:33 pm

Posted in MagLev

Welcome

leave a comment »

About a year ago, I joined GemStone Systems to work on MagLev (an implementation of the Ruby language on the GemStone/S Virtual Machine).  Back then, MagLev could run just enough Ruby to make a decent demo, but not much else.  While the underlying VM was mature and stable, the Ruby implementation was a prototype with gaping holes. E.g., the parser was an MRI process running WEBrick that we sent ruby source via http, and got back a string of s-expressions. The (partial) IRB implementation was written in Smalltalk. We had no idea what the persistence API would look like. Etc.

We’ve come a long way in the past year.  We’ve embedded Ryan Davis’ pure ruby parser, MagLev has gone from passing fewer than 5,000 RubySpecs to passing over 27,000. MagLev runs RubyGems, and we have several demos using the Rack and Sinatra gems. We run a (patched) version of the real IRB, we have implemented a substantial portion of the Rubinius /JRuby Foreign Function Interface, and we have most of the core libraries implemented. While there is still work to do, MagLev is beginning to feel like a real Ruby implementation.

In future posts, I plan on discussing some of the features unique to MagLev (native object persistence, distributed architecture, etc.), walk through some demo code and discuss whatever I think is interesting about MagLev, Ruby and related topics.

Written by maglevdevelopment

November 20, 2009 at 4:39 pm

Posted in MagLev