From the start, the developers had performance in mind, with ehcache[6] used to help speed response times for users. The developers contributions back to
http://www.h-online.com/open/features/print/113118 22 April 2009, 08:33 BullionVault.com - Gold with an open source soul by Dj Walker-Morgan Gold and open source do not normally go together, but at BullionVault, the combination of both has created an innovative way of trading in the precious metal BullionVault Front Page ZoomThe BullionVault Front Page Back in 2003, Paul Tustain, founder of BullionVault[1], wanted to buy some gold and went to Switzerland to do so. It turned out that what was being sold wasn't actually the gold though, but a "promise of a promise" of some gold. This is what is called "unallocated gold" where there are various financial instruments between the buyer and the actual gold. Tustain thought that this wasn't what people wanted to do and inspired by the idea of online betting exchanges, brought together a team to create an online gold exchange which became BullionVault.com. Users can sign up and buy gold, which is physically held in secure vaults in London, Switzerland and New York, hold on to it for a storage fee or sell it, all through an online front end. This is called "allocated gold"; outright ownership of the physical metal. The vaults themselves are managed by another company and are so secure that it is almost impossible to get access, even for BullionVault. Users of the BullionVault systems, once they have bought gold, can offer to buy or sell at the price they select and the system matches up buyers and sellers. Now, with 100,000 registered users and 13,000 funded clients using the English, French, German or Italian translations of the site, the service is international and well established. BullionVault's "tame" Gold Bar ZoomBullionVault's "tame" Gold Bar Despite the large amounts of gold and money involved, at the heart of BullionVault is an open source soul. The systems behind BullionVault were created by Kris Jenkins, CTO and Alex Edwards COO and they say they couldn't have done it without open source. In late 2003, Tustain, Jenkins and Edwards started development on the software for the back office system for BullionVault. Some decisions were already made for them though; they had inherited a real time accounting and settlement system which used Oracle as the database. The real time nature of the accounting system was essential to the plan as they would need to be able to create financial reporting by the day and by the minute. But around this accounting system, open source would be used to develop the exchange. Next: Developing the exchange Developing The exchange software itself is Java based, using Apache Tomcat for serving web pages and Spring as an application framework. Originally, the system was developed using the Apache Struts[2] web framework, but over time, frustrations with Struts led them to move to SpringMVC[3] which has made development a lot easier. "When we started experimenting with SpringMVC, it quickly made Struts feel like a first attempt at a web framework" says Jenkins "SpringMVC doesn't take away any control - it's still fairly low-level - but it has made development much simpler and faster". As an example, Jenkins pointed to SpringMVC's flexible data binding "which became vital when we went multi-language as it made it possible to be more intelligent about number formatting styles across multiple locales". The switch reduced the size of the code base significantly and the change "just made life much simpler". "Spring has one of the cleanest architectures I've ever encountered" adds Jenkins. Kris Jenkins ZoomKris Jenkins, CTO of BullionVault For mapping their Java classes to the database, they went with iBatis[4] while for reporting, they use Eclipse BIRT[5] for creating internal reports. "It's great that we can go from a working SQL query to a web report with standardised formatting very quickly" which has allowed them to produce intranet reports like "How much gold have we sold each day in the past week?". BIRT's PDF generation is also used to generate statements and contract notes as it is fairly easy to integrate into batch processes; "It's also good at not getting in our way. Easy stuff's easy, hard stuff's harder". Jenkins says they recently looked at Oracle's Apex but found it "made easy stuff trivial, tricky stuff impossible ... even the set up was tricky". BIRT is not without it's issues though. "The documentation is patchy and almost always out of date. Compiling the source code is a real headache". the open source community have typically been performance patches for libraries as a result of this work. Development, of course, is not just about code but also about maintaining the code. Open source plays its part here with the company using Bugzilla[7] to track issues with the software and ensuring quality by using JUnit[8] and Spring mocking to create tests for the system. The switch to SpringMVC made creating unit tests much easier. One element which isn't open source are the BullionVault bots. The company uses bots, software programmes which act as customers, to trade within the exchange on its behalf. Bots are used to create liquidity in the exchange by encouraging trade in gold to take place, using simple trading strategies. The bots are proprietary to BullionVault, but the company has an open API[9] to allow third party bots and applications to trade such as Bullionbetting.com[10]. The bots do have an impact on code quality though as they do exercise the system; often, the bots are the exchanges heaviest users. Jenkins recommends the use of automated bots as part of a quality strategy for online exchanges because of their ability to generate work for the system and report back on the systems' function. He adds that they have considered open sourcing the bots themselves, but it "hasn't happened yet". Next: The back and front office The back office Beyond the development of code, there's the deployment of the result of the code. Again, BullionVault have evolved their approach thanks to not being locked in by proprietary software. Initially, the servers ran the Fedora Core Linux distribution. As time moved on though, Fedora became more experimental, feeding back into Red Hat's Enterprise Linux, but always running ahead. With this in mind, BullionVault moved to CentOS, the Linux distribution which is compiled from the Red Hat Enterprise Linux source. This allows the company to use an operating system which is deployed as an enterprise operating system without having to subscribe to Red Hat's subscription offerings, keeping costs closer to zero. The move has also given them a more stable Linux and a more predictable roadmap for operating system deployment. Infrastructure management also relies on open source. The network is monitored with Nagios[11], systems are mirrored with Drbd[12], jobs are scheduled with Quartz[13], loads are balanced with Heartbeat[14] and the site content is managed with Subversion[15]. With Nagios, BullionVault contributed to the community with patches to add encryption to the Java/Nagios interface. Alex Edwards ZoomAlex Edwards, COO of BullionVault Not everything is part of the exchange system though. While the help and support pages are static HTML with Apache Lucene[16] based searching the BullionVault Gold News site[17] is managed using the open source Drupal[18] content management system. Edwards found Drupal "a good balance of open source, easy to set up and straight forward for our human editors", though there have been occasional frustrations with database and formatting problems. Jenkins points to the range of Drupal modules; "I've lost count of the times I've been asked to add a feature to Drupal and found there's already a module to do it for me". Drupal has also allowed them to create fully featured websites "in an afternoon" and then hand these on to someone non-technical to create content and maintain. "Drupal's not perfect", he adds, "I try never to look at the underlying database structure for fear it will haunt me at night - but as techies we can fire & forget and our editors almost never need sup requirement, for security purposes, is the recording of all calls. For this, BullionVault used the Asterisk PBX software; Edwards implemented this using the TrixBox[19] distribution, which bundles Linux, Apache, Asterisk, MySQL and PHP. Trixbox was simpler to set up than assembling their own Asterisk system and is already based on CentOS. Next: Lessons worth learning Lessons worth learning We asked what advice the BullionVault team would offer to other companies. Edwards suggested a process of constant change; "Evolve your systems, It's amazing how much you don't have to spend for good quality components". Jenkins added to that saying "Pick good active open source growing with you, even if they are in beta". As for architecture and deployment, Edwards offered "Plan for clustering and scalability and redundancy" while Jenkins offered the simpler "Plan for one machine blowing up". Both agreed on the importance of adopting open source as fundamental part of developing and deploying an online service, but also the open source is a means to an end, rather than an end in itself. Lego BullionVault Logo ZoomThe BullionVault logo, rendered in Lego The team at BullionVault are proud of what they have created with limited people resources. "For two of us to create a service this big using open source and banking technology is impressive", says Jenkins. The company now has fifteen employees, mostly in the front office dealing with customers. Asked what features they'd like to see in open source in the future, Edwards hoped to see Thunderbird expand its capabilities to include a customer relationship management extension and make the front office more integrated. Jenkins was looking for more real time accounting applications for the back office to handle the flow of transactions that a web site which manages money (or gold) needs to keep tabs on their financial status. Conclusion Using a pragmatic mix of open source and proprietary software, BullionVault has created a novel way to deal in gold twenty four hours a day. It's that approach which has seen them awarded a Queens Award For Enterprise for Innovation[20] this year. URL of this article: http://www.h-online.com/open/features/113118 Links in this article: [1] http://bullionvault.com [2] http://struts.apache.org/ [3] http://static.springframework.org/spring/docs/2.0.x/reference/mvc.html [4] http://ibatis.apache.org/ [5] http://www.eclipse.org/birt/phoenix/ [6] http://ehcache.sourceforge.net/ [7] http://www.bugzilla.org/ [8] http://www.junit.org/ [9] http://www.bullionvault.com/help/xml_api.html [10] http://www.bullionbetting.com/ [11] http://www.nagios.org/ [12] http://www.drbd.org/ [13] http://www.opensymphony.com/quartz/ [14] http://www.linux-ha.org/Heartbeat [15] http://subversion.tigris.org/ [16] http://lucene.apache.org/java/docs/ [17] http://goldnews.bullionvault.com/ [18] http://drupal.org/ [19] http://www.trixbox.org/ [20] http://live.bullionvault.com/Queens_Award_2009.do