Hi Folks,
James Foster gave a very nice presentation this evening--Panera Bakery
literally had to kick us out. If you're not familiar with MagLev, I
think it's something to keep an eye on. It was pretty amazing to see
it in action.
MagLev does two very important things: 1) eliminates the need for a
data persistence layer (traditionally this is a relational database
and an ORM such as ActiveRecord), and 2) provides caching and indexing
of your data in a completely transparent manner. You no longer need to
have something like memcached running for object caching and lose the
performance hit of object serialization.
Below is a practical example of how MagLev makes data persistence both
natural and completely transparent. Assume we have two consoles
running with IRB (two separate VMs) on the same physical machine. We
also have a Person class defined with instance variables/methods for
name and location:
# VM 1
>> $people = []
>> person = Person.new
>> person.name, person.location = 'Jordan Fowler', 'San Diego, CA'
>> $people << person
>> COMMIT # <-- this will save the current object space to the MagLev
data store
# VM 2
>> $people
=> [#<Person:0x5eba3c @location="San Diego, CA", @name="Jordan
Fowler">] # the object from a completely separate VM is part of the
$people collection
>> person = Person.new
>> person.name, person.location = 'James Foster', 'Portland, OR'
>> $people << person
>> ABORT # <<-- this will reload the current object space with the
current state of the MagLev data store. Nothing above is persisted and
is completely forgotten
What I like most about this approach is not having to reinvent the
wheel for things such as finding, sorting, etc. With ORMs like
ActiveRecord, you have to redefine these methods so that finding and
ordering are offloaded to the relational database, then returned to
Ruby-land. I'd rather have the convenience of using saying
$people.sort_by { |p| p.name }.reverse and be done with it.
To conclude, I thought the presentation was great. The Seaside part
was pretty standard and showed off the magic of in-browser
continuations and Smalltalk in general. Hope this recap sparks some
interest and conversation.
-Jordan
---------------------------------------------------------------
Jordan A. Fowler
2928 Fir St.
San Diego, CA 92102
E-mail: [email protected]
Website: http://www.jordanfowler.com
Phone: (619) 339-6752
--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---