Why bet365 is open sourcing its Erlang code

Bet365's Chandru Mullaparthi explains why the online betting giant has adopted Erlang - and why you should, too

The story of why bet365 has developed Erlang support libraries for the open source community begins with a challenge that is common in online businesses around the world.

How do you scale your systems to meet increasing demand, without having a detrimental impact on core services? The answer was nearly always the same: buy more powerful hardware.

However, by 2012, it became apparent to Martin Davies, bet365's CEO of technology, that scaling our SQL architecture upwards was no longer sustainable. We already had the biggest server money could buy, and it turned out that Microsoft SQL Server could only use about 25 per cent of the available computing power without going into meltdown.

Davies' investigation for a solution took him into the world of NoSQL, where he found what he was looking for. A functional programming language developed by Ericsson in the 1990s to help the telecoms industry overcome similar issues of scalability, resilience and concurrency. That language was Erlang.

Convinced by its successful use in the NHS and WhatsApp, Martin commissioned bet365's research and development team to build a prototype of bet365's Push System in Erlang.

The benefits were immediate: A profound reduction in the complexity of the code base. A 10-fold increase in the number of users supported on a single machine, and a significant increase in the speed of our product delivery.

Since then, Erlang has become an essential technology in our toolkit. It is helping us to create reliable, fault-tolerant systems that can be scaled incrementally to meet the growth in our business.

Erlang is ideally suited for domains that have to solve the challenges of massive concurrency. It has already proven itself in telecoms and messaging, with WhatsApp a particular high-profile success.

It is also being used in the fast-growing Internet of Things space by players such as GOFACTORY and FeuerLabs; in advertising by companies such as AdRoll; in games by Sqor, spilgames, MachineZone and many others; in healthcare by the NHS; and, in online payments by Klarna... the list goes on.

Help!

But to gain more widespread acceptance in more traditional enterprises, it's going to need some help.

Despite its maturity and obvious advantages, there are a number of barriers to entry. Some of which we hope to help remedy with the release of our Erlang code.

Erlang doesn't take long to pick up, but early on there is a steep learning curve. And because it suffers from poor documentation and tooling, it can be difficult to get up and running. This is clearly an issue and one that is affecting its adoption.

We hope to rectify that. We chose the SOAP and ODBC protocols first because they are widely used in organisations and would be likely starting points for anyone coming to Erlang for the first time.

Apart from a few arcane hacks, there was next to no support for SOAP available to help developers integrate Erlang with their legacy web systems. In addition, the existing ODBC support had various issues, which made it very difficult to integrate into relational SQL databases.

The SOAP library available at https://github.com/bet365/soap will enable Erlang developers to very easily consume or expose web services using SOAP. The ODBC library, which is an enhancement to the built-in ODBC application from Ericsson, will provide a better coverage of the ODBC feature-set and improve its performance. This will be released on GitHub in the coming weeks.

Why would we do this? Well, two reasons.

We've benefited a great deal from the work of the open-source community, having adopted many of its contributions. We wanted to give something back.

In addition, by supporting the development community in this way, we hope to start a cycle of advancement that will refine Erlang in new and exciting ways. It also helps us in the long-term. By focusing effort in both these areas we are hoping to reduce the barriers to entry for its use and create interest that will inspire technology vendors to build products that seamlessly integrate with Erlang driven platforms.

Chandru Mullaparthi is head of software architecture at online betting company bet365

Computing's Big Data and Analytics Summit 2016 is NEXT WEEK. To find out more, and to reserve one of the few remaining places, please see Computing's Events website.