MagLev was a show from the last RailsConf (2008). Presentation and demos of the product are really impressive.
Recently, Brian Takita asked in the JRuby mailing list:
JRuby + TerraCotta == Maglev?
What an idea! In the last few days I’ve tried to make something useful and I’m happy to have something to show.
The first demo runs with Nailgun. The basic idea is to share a single Java VM across all clients, so they can share some objects. The second is much more complete, as its clients have their own Java VM. There are many true interpreters running, and they are sharing objects through Terracotta. Terracotta is responsible for sharing memory in Java VM clusters and, despite of its slow startup, has much more to offer. The shared objects (hats and rabbits) could be automatically persisted by Terracotta, as MagLev also does.
I’ve patched JRuby and configured Terracotta to make demos run. I’ll upload the patches and configuration somewhere, ASAP.
Working on JRuby to make it run multiple runtimes (VMs) at the same time is being really fun!

Awesome demo, very clever solution to the multi-vm problem, this is a very approachable solution, specially for server-side stuff where startup time is not that relevant.
Very interesting. Honestly this is what really gets me going when I hear Maglev: sharing automatically replicated/persisted objects through workers. I guess I’ll have to read up more on Terracota.
Pretty interesting demo. As a Terracotta developer I am happy to see ppl poking our product in interesting ways like this.
One of my collegue had once played around clustering Jruby with Terracotta sometime back.
Dunno if you had checked it out or not.
http://jonasboner.com/2007/02/05/clustering-jruby-with-open-terracotta/
cheers,
Saravanan
Thanks for the link Saravanan. Yes, I’ve seen it, but I took a different approach.
The main difference is that in my version of the Terracotta integration, all global variables are automatically shared across JVM cluster nodes. It is “transparent”, as it doesn’t require any explicit control in the Ruby code.
Muito bom!
I love it! Transparent JRuby clustering. Good idea there.
–Ari
Very impressive! Just as impressive as the original MagLev demo that I was lucky enough to see at RailsConf.
Very nice.
1) Are the required JRuby changes likely to make it into a released JRuby?
2) Was the Terracotta ’side-of-things’ written as a Terracotta Integration Module (TIM)?
@Mark
1) Unfortunately not in the next (1.1.5). There are things that must be tuned yet. I’ve already discussed a bit with Charles Nutter. The main points are: a) global object identity, b) shared metaclasses. But it is already usable.
2) Not yet. That is my next step; or perhaps I will open the source in github first.
[...] o Ribs do Ola Bini, que permitirá o uso do Hibernate em projetos JRuby. O segundo foi o demo do JMaglev, usando Nailgun, já que tinha bastante gente que achava que o vídeo que postei era [...]
[...] to watch my friend Fabio Kung present on JRuby and give a real-life demo of his experiments with JMagLev. After that, we all went to watch the closing keynote, by Obie Fernandez. It was a great talk about [...]