The agile software development philosophy suggests that it is wisest to code for immediate needs and not to plan ahead or become too attached to particular arrangements of system architecture. This is in part because future business needs are not knowable in advance, but also in recognition of the fluid, always-in-process nature of code. Because business needs can and do change rapidly, part of the discipline of coding is to become fearless in terms of changing existing code to drive it to fulfil those changing needs.
As Message Bus has continued to scale up, the original business need (to rapidly produce a working message sending system) has given way to a newer need, namely to dramatically increase the system’s performance and stability. Among the ways Message Bus engineers have come up with to accomplish this task, has been to change the primary language being used to construct the system from Ruby to Scala.
There is an inverse relationship between the degree of performance and control a computer language offers and the ease of using that langauge. Ruby is comparatively easy to use but next to Scala it offers poor performance and control. Scala’s performance derives from it being a pre-compiled language. The compiling process does in advance the hard work of interpreting what the computer must do at each moment of program execution – something Ruby does dynamically at run-time at great processing cost. The benefits of compilation come with their own expenses, however. Scala has more complex and demanding coding requirements than Ruby. As well, compiled languages introduce the need to manage the executable files produced by the compilation process.
We regard Scala not an end in itself but rather as a leading edge; a right tool to use for achieving present-moment business goals. We are seeing real performance gains associated with our use of Scala. Message throughput has been accelerated dramatically while our software’s resource consumption footprint has shrunk. Scala may or may not be the right tool for addressing future emergent business needs, however. Whatever challenges are ahead, we expect to meet them in a flexible manner.