New-age Transactional Systems - Not Your Grandpa's OLTP
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Pat Eyler on Dec 07, 2006
Last week's coverage of RSpec on Ruby (more coverage is available here) included the thought that JRuby was poised to start making waves by providing new, Ruby influenced tools to Java developers. Springy looks like just the kind of tool Michael Studman was thinking of when he wrote:
I hope that ... more Java developers to sit up and notice Ruby as a language with incredible potential for all manner of problems.
Springy is a simple DSL, written in JRuby, that lets Java developers wire up their Spring contexts without having to do "XML sit-ups". For example:
<bean id="bean3" class="springy.beans.Bean3">
<constructor-arg value="${vic}"/>
<constructor-arg ref="bean2"/>
<property name="aProperty">
<list>
<ref bean="bean1"/>
<value>A String</value>
</list>
</property>
</bean>
becomes:bean :bean3, "springy.beans.Bean3" do |b|
b.new(vic, :bean2).aProperty = [ :bean1, "A String" ]
end
(Contrived example taken from Jan Berkel's blog post about Springy.)
We [Trampoline Systems] use a hybrid development strategy, using (C)Ruby on Rails for the frontend and Java for all backend related things (actually with bits of Lisp in it as well). It's really a "best-tool-for-the-job" approach. Ruby/Rails is agile and productive whereas Java is the big guy in the background who does the heavy lifting.And Springy's not the only way they're using JRuby:
Our build system is based on Rake with some Java-related extensions (which we've opensourced recently — Jerbil). It reduced the complexity of our build system from ca. 1500 lines of XML to 180 lines of Ruby, largely thanks to Ruby's metaprogramming capabilities.
While Springy isn't in wide use yet (it's only been publicly available for about 2 weeks), it certainly shows promise. It also shows how well JRuby can leverage rubyisms for Java developers. Jan talked about this too:
JRuby makes it very easy to extend existing Java code: it is getting to a point now where the boundaries between languages almost completely disappear, at least from a Ruby perspective. You can use and extend Java classes in a very natural way whilst retaining Ruby's power and flexibility.
The question doesn't seem to be "Will JRuby have an impact on Java developers?", it's "Where in Java world will JRuby's impact be felt most strongly?". The first several 'cross-overs' have already occured. Where will JRuby show up next.
Improve Java Garbage Collection, Runtime Execution, and JVM visibility with Zing
Monitor your Production Java App - includes JMX! Low Overhead - Free download
Using Drools? See what you're missing! Get the Power of Drools with the Assurance of Red Hat
18 agile and lean practices for effective software development governance
bean :bean3, "springy.beans.Bean3" do |b|
b.new(vic, :bean2).aProperty = [ :bean1, "A String" ]
end
This isn't easy to read at all!!! Give me back my XML!
Here's how to do the same in Groovy using Grails:
grails.org/Spring+Bean+Builder
Easier to read than XML _and_ Springy, IMO.
Yeap! That looks much more elegant.
I have to agree with the others here. I'm not a Spring expert or a Ruby expert. Looking at the XML, I can pretty much figure out what it means without knowing all that much about Spring. But looking at the JRuby equivalent, my eyes glaze over and I find myself thinking, "WTF?" It also shows how well JRuby can leverage rubyisms for Java developers.
Well, being a Java developer myself, I'd rather see something that can leverage Java-isms for Java developers.
This isn't easy to read at all!!! Give me back my XML!
Who said anything about taking away XML? If you don't like it, don't use it.
Well, being a Java developer myself, I'd rather see something that can leverage Java-isms for Java developers.
Mabye you should take a look at JACN.
This isn't easy to read at all!!! Give me back my XML!
well, ruby allows you to specify blocks without do/end (and omit the block argument, as i've just found out), so you could write it as follows:
bean(:bean3, "springy.beans.Bean3") {
new vic, :bean2
aProperty [ :bean1, "A String" ]
}
with some tricks you could even get rid of the double quotes in the classname. the example from the blog post was just to show how concise bean declarations can be, you don't have to put everything in one line.
I meant "XML reads much better" so the approach presented in this article doesn't look nice/read nicely. And of course, if I don't like it then I won't use it. Thanks for stating the obvious. ;)
I think Yagiz point is quite correct: people with Java knowledge are not reading this ruby-ish format code, and so I would say that Springy is losing one important side: writting fewer configuration lines that are still readable.
./alex
--
:Architect of InfoQ.com:
.w( the_mindstorm )p.
Co-founder of InfoQ.com
ok, agreed, i should have written the blog post for an audience unfamiliar with ruby. while the syntax could definitely be improved on, the main goal of springy was not to make it more readable (to everyone) but more powerful. i guess it's a simple trade-off and a lot more interesting to developers already familiar with ruby.
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.
Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
10 comments
Watch Thread Reply