This week I started migrating an internal application for MyJibe to JRuby 1.6 and was pleasantly surprised with the results. After seeing that others didn’t have the same positive experience as I did, I thought I would go into a little more detail about how we are using JRuby/Rails and the results we have seen.
You can use SOAP4R and WSSE (for basic ws-security), but they are both light on the SOAP/WS stack as a whole.
My life before MyJibe was almost all Web Services. SOAP everywhere and lots of Java, C++, C# and Visual Basic (yep, VB). The reality of the daily life of a technologist in large financial institutions is tons of Java/.Net/SOAP and software built with those tools (Oracle, Spring, Struts …..) This is both good and bad, but this is not a post on the virtues of Java vs Ruby vs .Net vs Python vs C++ (my native language)
Long story short, I know how to utilize Java’s support for SOAP and have found myself needing the same support for SOAP in Ruby and wanted to find a solution to link the two, so I chose JRuby (as it would be impossible to rewrite the volume of “Enterprisey” API’s for the financial industry on another “platform” …. for this context [impossible = improbable = unprofitable])
After recognizing that I could use jars with JRuby I decided to create a translation layer for any endpoint that we needed to integrate with that didn’t have native support for REST/JSON. Pretty straight forward.
A request comes in and is routed via Rails, the controller parses out the JSON request, the model performs any validation and uses Java’s extensive protocol support to call out to services that don’t speak a “native” JSON. (Services have different levels of configuration/structure which is typically setup during startup through an initializer)
The primary focus of my testing was request parsing/dispatching and connection overhead. Since the primary function of the JRuby/Rails application is to route requests and do very little in the execution chain my tests were specialized. When multiple endpoints are being accessed by multiple Rails servers simultaneously the dispatching and parsing routines are the primary controllable bottleneck because they are executed for every request. (Validation is important, but some services never use validation as they are either unidirectional requests or fail proof requests that queue background work for delayed execution)
(Note: After reading Jeff Dean’s post on lightweight Rails services we removed some of the Rails overhead for the service translator, which resulted in ~10% increase in request-response performance.)
(disclaimer ** we had no issues or perceived slowness with JRuby 1.5.6 before testing the upgrade and were happily surprised by the performance boost from JRuby 1.6 and Trinidad 1.0.5)
Since I was largely testing the “Time to Service-call” or “dispatching time” it was not necessary to call a web service for the test as the primary controllable overhead would be in dispatching/parsing requests. Although I will continue to investigate parsing times and service responses.
Using the ruby “Benchmark” library I ran this snippet of code against each server listening on a local port. (Tester is a Ruby Object that communicates to the the JSON service endpoint)
JRuby 1.5.6 with Trinidad 1.0.3
JRuby 1.6.0.RC1 with Trinidad 1.0.5
JRuby 1.6.0.RC1 with Trinidad 1.0.3
After seeing the changes from JRuby and Trinidad versions I decided to also check the Ruby MRI interpreters on my machine (1.8.7-p302 and 1.9.2-p136)
The difference between JRuby 1.5.6 and JRuby 1.6.0 is relatively small. 4-9 seconds over 3000 requests is not “significant” by my measure however, it does account for the 20-25% increase in performance across requests running through the JRuby 1.6.0 install in our testing environment. It has also set a new record for fastest full request cycle of our most complex remote calls (multi-key, session based SOAP calls), beating our former record by ~25%.
I was very surprised with the difference in speed between JRuby and Ruby 1.9.2. I assumed that they would perform in the same ballpark when it came to routing requests and basic responses. I still need to investigate further on why such an extreme difference, but it does show that if you are considering running a lightweight REST or Remote Invocation service you should entertain JRuby/Trinidad/Rails as the platform and framework of choice.
If you read my first blog post you know that recently I have been working on launching a new company http://myjibe.com
While this is probably one of the most rewarding periods in recent memory I have to say that actually bringing something from idea to production is more difficult than it seemed (3 months ago). I used to have the luxury of “the machine” around me. While working for large companies the process of product launch was largely formulaic:
Will we get paid back within 3 years? IF yes, we will put it in the product pipeline. IF no, we won’t do it.
How many of our 1000 customers will buy it? IF more than 200, put it in the product pipeline. IF less, refer to ROI calculation.
The pieces of the puzzle that needed solving were algebraic. Write down the formula and solve. Very straight forward, very “simple”.
You still need to do the above:
But starting a business means you also need to EXECUTE the outcome of the above analysis, not identify who should do it
The number of factors that can go into a market identification model are mind numbing in themselves. The ROI of new company needs to be balanced against the ramp up time for the product and adoption rate of a new brand, new idea, new processes, and new people.
Before starting MyJibe I was weighing the option of pursuing my MBA. I believed that pursuing an MBA would help me find more formulas, more tricks for a balance sheet, or more people to network with. While I readily admit that I am in need of an expanded toolset for building and managing businesses I think I made the right decision for me, start a business.
The last 3 months have been an education. That is what has made it so difficult and so rewarding. I have a predisposition for only soaking up new knowledge through experience. I really never understood physics and calculus until I programmed my first 3D world, I never really understood music until I played on stage and I know I didn’t really comprehend business when I was playing “find the right formula”. Business is in the everyday monotony of life; what can I do or provide that creates value for you? what concerns you? what concerns me?
Will I go get my MBA one day? maybe
Will I regret not getting it today? definitely not
After recently quitting my job to become a full time “entrepreneur” I was sent a picture that was taken by former colleagues. It came with a sub-title that read ” …. devised a plan to lure you back”.
I know I was not supposed to get all philosophical about the meaning of the picture or conjure up any analogies, but I couldn’t help it. I started thinking about the simplicity of the meaning: we can lure someone in with something they need and/or want.
I started thinking “what do I personally put in that box to ‘lure’ service from companies?” [Reframed] “What am I providing that gives incentive to businesses to provide their service to me?” Time for transparency; this scared me. I recently quit a great job in order to start a new company and had yet to really think through this fundamental exchange with customers: consumers provide X and companies find it valuable enough to return in kind with Y (in goods or services).
Common case. A customer puts money out and businesses provide services in exchange for it.
[ Ex: Google, Pandora.com ]
A customer looks at advertisements, or provides opinions, or simply exists in an area and thus the company can sell that advertising space, opinion or presence to other companies for ……. money. In return the customer gets the advantage of the service .. (without direct cost)
[ Ex: PriceGrabber.com ]
A customer uses a program and/or service that is offered as “free”, but the company has to “keep the lights on”. Data is aggregated, at times anonymized and sold to other users/services for …… money. In some businesses this is considered a viable model of sustainability.
This may be a confusing analogy, but I believe that we (as consumers) have a significant amount of power in how we “vote” with our resources. We choose to pay money or provide time or provide opinion or provide audience or provide data; and in turn we utilize the services of companies and organizations. The key here is that we get to choose how we “pay” for our goods and services. We are empowered and we have choices.
So, here I stand on the precipice of launching a new company and a simple picture (sent as a joke) has me questioning the fundamental underpinnings of the web application software world. What works? What sustains? What am I willing to put under that box to attract goods and services? I think we should all ask that question more often in our increasingly connected world.