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 Dilip Krishnan on Jun 02, 2010
In an effort to bring the expressiveness of ruby and the REST frameworks in Java, Charles Nutter makes the case for delevoping RESTful services using JRuby+Rails. He observes the inherent thought leadership in the Ruby and Rails communities in building RESTful applications that leverage the web.
[…] Rubyists have been helping to lead the way, building restfulness into just about everything they write. Rails itself is built around REST, with most controllers doubling as RESTful interfaces, and it even provides extra tools to help you transparently make RESTful calls from your application. If you're doing RESTful services for a typical Ruby application, Rails is the way to go.
To demonstrate the ability to define a RESTful service in JRuby, he surveys the solution landscape for libraries and frameworks for building RESTful services in Java. He starts with a simple example service using the standard JAX-RS API
I followed the Jersey Getting Started tutorial using Ruby for everything (and not using Maven in this case). My version of their HelloWorldResource looks like this in Ruby:
require 'java'java_import 'javax.ws.rs.Path'
java_import 'javax.ws.rs.GET'
java_import 'javax.ws.rs.Produces'
java_package 'com.headius.demo.jersey'
java_annotation 'Path("/helloworld")'
class HelloWorld
java_annotation 'GET'
java_annotation 'Produces("text/plain")'
def cliched_message
"Hello World"
end
end
He describes the internals of how the ruby class gets compiled and the internals of the in memory representation of the object.
Under the covers, this class will load in the source of our restful_service.rb file and wire up all the Ruby and Java pieces so that both sides see HelloWorld as the in-memory representation of the Ruby HelloWorld class. Method calls are dispatched to the Ruby code, constructors dispatch to initialize, and so on. It's truly living in both worlds.
With the service in hand, we now need a server script to start it up.
He proceeds to deal with the notoriously-hard-to-get-right CLASSPATH so that the example can run.
I've tossed them into my CLASSPATH env var, but you're free to do it however you like
jersey-core-1.2.jar
jersey-server-1.2.jar
jsr311-api-1.1.1.jar
asm-3.1.jar
grizzly-servlet-webserver-1.9.9.jar
The first four are available in the jersey-archive download, and you can fetch the Grizzly jar from Maven or other places.
He concludes with a call for “examples of other nice annotation-based APIs we could test out with JRuby?” Do share interesting examples in the forum and visit the original post for details on writing RESTful services in JRuby.
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.
No comments
Watch Thread Reply