vege - Fotolia
In 2012, a team of three Google engineers released a new programming language, Go, designed to enable programmers to write code for multiprocessor hardware more quickly. A number of organisations have made use of Golang, include Deliveroo, HM Treasury and Sainsbury’s in the UK.
Betting firm Bet365 is another company on the Golang journey. Eighteen months ago, it did not have any Golang code. Now Alan Reed, head of sports development at Bet365, believes Golang will become one of the company’s core development languages.
He says the main driver for using Golang is performance. “Most large websites have the same needs as Google and we are reaching the limits of our current .Net solutions,” he says. The online bookie needed a way to deliver live sports results with sub-second latency.
Although it has C and .Net skills, Bet365 is used to trying new languages to help it meet business objectives. When Computer Weekly spoke to the company in 2015, it was embarking on a journey with Erlang, a programming language developed in the 1990s by Ericsson for telephone switches.
At the time, the problems telephone switch providers had to deal with were very similar to those experienced when running a sports betting website, such as reliability, scalability and simplicity. The company even went as far as to acquire Riak, a distributed NoSQL technology written in Erlang. in 2016 and contributing the code to the open source community on GitHub, to encourage more enterprise developers to use it.
Why Golang? Reed says: “C and .Net are excellent tools for many jobs, but sport, which sits at the front line of the business, is subject to the fastest change. These languages are too verbose and inflexible to achieve our goals.”
Bet365 began looking at Golang two years ago, says Reed. The language, originally developed by Google, is good for gluing bits of code together, he says. Its core strengths as a programming language are its memory management and concurrency features, which help Bet365 to run real-time betting. “We are very scared of memory leaks,” Reed adds.
Read more about software development at Bet365
- Betting firm Bet365 aims to give away enterprise version of Riak NoSQL to the open source community and continue the development of the product.
- Bet365 donates Erlang to GitHub to help drive adoption of the functional programming language among enterprise developers.
Large sporting events attract a lot of interest from people wanting to place a bet, which leads to peaks in demand for certain services on the website. “We want to personalise our customers’ experiences,” says Reed. “Customers are looking to place a bet and check their balance.”
Golang is able to manage such huge demands in betting, he says. “Customers place a bet two minutes before a match ends. This leads to areas of data where there is concentrated activity. If something is going on in a game, all customer activity is focused on one set of data.”
Golang helps Bet365 solve the “peakyness” of customer activity in a predictable way, says Reed.
Another benefit of Golang is its long-term maintainability, he adds. “We have large development teams and our software has a lifespan of six to eight years. Golang has allowed us to write code in a very consistent way.”
Reed says this makes the code highly maintainable. Comparing it to .Net, which relies on design patterns, he says: “Golang is restrictive. Its language syntax only offers a very specific way to code something.”
So maintaining code should be easier because there is only one way to program something. In a sense, it offers “guard rails”, says Reed.
The first product that Bet365 released using Golang was Bet Builder, which was launched towards the end of 2017. Golang was also used to create a live betting product for the Fifa World Cup, and enabled Bet365 to add a search capability, enabling customers to find something to place a bet on.
Transform data in real time
The development team also created a universal data splitter using Golang in just six lines of code. “Golang has allowed us to move something into production that was in prototype for a year,” says Reed. “We could join up disparate technologies in four months and we could transform data in real time.”
Overall, Golang has helped Bet365 create new software quickly, says Reed. “The nature of what we do is quite predictable, but the market segment is very dynamic, so we can spend a lot of time writing the wrong code,” he says. “The holy grail is to write business-facing software as quickly as you can.”
Certain languages, such as C, are very flexible, but Bet365’s developers work to a fixed deadline, he points out. Applications need to operate in an unpredictable market and can run in a highly concurrent way.
Reed concludes: “We needed to have a technology that can work with a site of our size. Golang is a language for the internet. When faced with fixed deadlines, our developers can focus on business-facing code.”