论坛

 找回密码
 注册
                  
查看: 1046|回复: 13

bet365使用Erlang推送滚球实时信息,并开发提前兑现功能

  [复制链接]
发表于 2015-3-16 22:00 | 显示全部楼层 |阅读模式
bet365和WhatsApp有什么共同点?英国博彩公司如何使用鲜为人知的编程语言Erlang以提高其系统

bet365研发主管说:少为人知的编程语言将大放异彩

埃森哲技术实验室人员马修芬尼根|2015年3月9日

在线赌博公司bet365已经从Java换成了一个鲜为人知的编程语言Erlang,使其能够降低支撑其核心投注平台的软件复杂性,和规模化系统处理其网络上的用户数量增加了四倍。

爱立信开发人员二十年前创建了 Erlang,来运行其电话交换机,Erlang是一个相对简单的编程语言,用来设计大型高可用性的应用程序。自九十年代中期以来,它很少被电信行业之外注意,但近年来,随着WhatsApp用它来处理数十亿其网络每天发送的消息,它在不断壮大。

据bet365研发经理丹·麦克林,该语言也非常适合于减少其低延迟系统的复杂性,以及目前正在使用在驱动现场滚球投注InPlay服务的产品中,将体育赛事直播赔率几近实时推送给以百万计的客户。

“我们选择了Erlang的原因主要是,我们早已经看到我们已有软件变得日趋复杂,它变得越来越难规模化,”麦克林说。

“复杂性意味着它需要我们更长的时间才能更新版本,而软件变得更加难以测试,并使其更难创新。

“Erlang的规模化功能内置到语言里面,但它也是一个非常小的语言,因此它允许我们扩展我们的系统而代码行的数目急剧减少。这意味着我们可以让我们的软件更快,我们可以更快地进行测试,并从而可以提高我们的开发人员的生产力。“


研究和开发

麦克林领导着一个小开发人员团队,是bet365三年前创建的R&D功能的一部分。该团队的目标是试验可以让公司在竞争激烈的在线博彩市场取得优势的技术。

“我们的主要职责是,我们尝试看看使用不同解决问题的方式来挑战传统约定,但最终侧重于使用不同的技术来简化我们做事情的方式,”他说。

该团队开始看看如何使用NoSQL和替代的编程语言用来解决日益复杂的系统,该系统无法应对不断增长的客户需求,并需要开发软件依赖于多个处理器内核的现代服务器的复杂性问题以提高性能。这意味着,开发人员被迫花太多的时间来维护现有的系统,以应付更大的工作量,而不是专注于创造新的服务。

“我们所遇到的一个大问题是规模和创新的两难境地:bet365希望我们的开发团队建立真正激发客户的前沿产品,但是,随着业务的增长,因为我们进入这样一个螺旋:大部分的开发时间都花在重新设计现有的系统,以应付未来的负载,“麦克林说。

“规模化的问题在越来越的多核心世界里变得越来越复杂,而且,当你有时间进行创新,你担心的是,创新可能不会在我们需要它在运行的规模上运行。”



采用Erlang

该公司决定采用Erlang开发基于Java的InPlay投注服务,处理在高峰时间多达200万的并发用户。麦克林说​​,三年前使用Erlang的想法是不寻常的,但需要这么多的并行处理的应用程序导致选择 Erlang 是有道理的 - 爱立信开发者有类似考虑。

“九十年代电话交换机供应商不得不应对我们今天面临的非常相似的问题:可靠性和可扩展性。那时,电话交换有很多的信息路由不断发生,这实在是一个令人尴尬的并行的问题[工作负载包括许多相同的可以被分离的元素],“麦克林说。

他补充说,以这种方式有效地扩展系统,一个简化的代码库是必需的 - Erlang正是针对此任务开发。 “我们最大的成功就是将其应用到InPlay系统中,”他说。

在繁忙时段如重大体育赛事时 - - 该公司现在可以管理需求的激增,而不向客户放缓服务。

“我们的代码库被大大简化了,现在,我们少有可靠性的问题。我们是一个令人难以置信的峰值业务,我们发现,在交易高峰期,我们能够为我们的客户提供Erlang的一个更可预测的高质量的产品,“麦克林说。

“在周六繁忙时段当我们正在推送大量数据,我们能保持速度一致的更新,无论什么负载被放置在系统上。”

项目的成功导致Erlang语言被用来在一个全新的系统中提供中间件:创建bet365套现(Cash Out)服务。这使客户能够尽早结束自己的投注,并在一个事件结束之前返现 - 比如足球比赛。

“问题是,我们有我们需要让我们的客户在非常低的延迟的InPlay系统相同的交易数据,我们需要将它应用到用户的开放的赌注,产生一个价格,”他解释说。

“这是很困难的,你已经得到尽可能多的开放式投注和数据的变化,因为我们有。这又是我们如何能够利用Erlang进入这个世界。“

What do Bet365 and WhatsApp have in common? How the UK betting firm uses little-known code Erlang to boost its systems

Lesser know programming language is set for the big time, says Bet365's head of R&D

Accenture Technology Labs Staff By Matthew Finnegan | Mar 09, 2015

Online gambling firm Bet365 has swapped Java for a lesser known programming language, Erlang, enabling it to reduce the complexity of software underpinning its core betting platforms and scale systems to handle a fourfold increase in the number of users on its network.

Created by developers at Ericsson two decades ago to run its telephone exchanges, Erlang is a relatively simple programming language designed for large, high-availability applications. It garnered little attention outside of the telecoms industry since the mid-nineties, but has grown in prominence in recent years, with WhatsApp using it to handle billions of messages sent across its network each day.

According to Bet365’s R&D manager, Dan Macklin, the language is also well suited to reducing the complexity of its low-latency systems, and is now being used in production to drive its InPlay betting service, pushing live odds of sporting events to millions of customers in near real-time.

“The reason we chose Erlang was largely that we could see the software we had was getting increasingly complicated, and it was getting more and more difficult to scale,” says Macklin.

“The complexity meant it takes us much longer to get releases out, while the software becomes much more difficult to test, and it made it harder to innovate.

“Erlang has the functionality for scalability built into it, but it is also coupled in a very small language, so it allowed us to scale our system as the number of lines of code was drastically reduced. It meant that we could get our software out there faster, and we could test it quicker, and from that we could increase the productivity of our developers.”

Research and development

Macklin heads up a small team of developers as part of an R&D function created at Bet365 three years ago. The team's aim is to trial technologies that could give the company an advantage in the highly competitive online betting market.

“Our main remit is to challenge conventions so we try to look at different ways of solving problems, but ultimately with a focus on using different technologies to simplify the way that we do things,” he says.

The team began to look at how NoSQL and alternative programming languages can be used to solve the problem of growing complexity of its systems, which were unable to cope with growing customer demand and the need to develop software for modern servers which rely on multiple processor cores to improve performance. This meant that developers were forced to spend too much time maintaining existing systems to cope with bigger workloads, rather than focusing on creating new services.

“A big problem we have come across is the scale and innovation dilemma: Bet365 wants our development team to be building leading-edge products that really excite customers, but, because of the growth in the business, we get into this spiral where most of the development time is spent re-engineering existing systems to cope with a load that is coming,” Macklin says.

“Scaling problems are getting increasingly complicated in a multi-core world, and, when you do get time to innovate, you are worried that innovation may not run at the scale we need it to run at.”


Adopting Erlang

The company decided to adopt Erlang to make its Java-based InPlay betting service, which handles up to two million concurrent users at peak times. Macklin says that the idea of using Erlang three years ago was unusual, but made sense for an application that required so much parallel processing - a similar issue to that of Ericsson's developers.

“The problems that the telephone switch providers had to deal with in the nineties are very similar to the kind of problems we have today: reliability and scalability. Back in the day with telephone switches you had lots of message routing going on, which is really an embarrassingly parallel problem [a workload comprising of many identical elements that can be separated],” says Macklin.

He adds that, to scale systems effectively in this manner, a simplified code base is required - and Erlang is tailored to this task. "One of our biggest successes was to apply that to the InPlay system,” he says.

The firm can now manage sharp increases in demand during busy periods - such as major sporting events - without slowing service to customers.

“Our code base is vastly simplified now, and we have less issues with reliability. We are an incredibly peaky business and we find that at the peak of trading we are able to provide our customer with a much more predictable quality product using Erlang," Macklin says.

"On a busy Saturday when we're pushing lots of data, we can maintain a consistent speed of updates no matter what load is placed on the system."

The success of the project led to the language being used to provide the middleware for an entirely new system: the creation of Bet365's Cash Out service. This allows customers to close their position early and take a return before an event - such as a football match - has finished.

“The problem with that is that the same trading data that we have in the InPlay systems that we need to get to our customers at very low latency, we need to apply it to a user’s open bet to generate a price,” he explains.

“That is quite hard when you have got as many open bets and data changes as we have. Again it was about how we could leverage Erlang into that world.”


Moving from R&D to the rest of the business

Aside from the technical hurdles, one of the main challenges R&D faced was creating the skills base within the wider developer teams to enable the move to Erlang. “It is one of those things where there is a bit hump to get into it. You look at the whole functional programming, the syntax and so forth, and it definitely requires an effort to get into it. But once you get people through that initial pain barrier, the developers tend to really, really like it," Macklin insists.

“It has the right amount of pragmatism to enable people to deliver quickly, with the right amount of geekiness to make it fun to work with. It is important to make it fun and intriguing, so developers can be passionate about it.”

After initially engaging with a service provider, Erlang Solutions, Bet365 quickly built its own expertise and now it trains its own developers. Around 10 percent of the 300 IT staff at the company are now proficient with the language, and Macklin expects it will be used more widely in applications in future. However, the firm will continue to rely on other languages, such as Java and .NET, which are better suited to certain tasks.

“Erlang is not useful for absolutely everything, but we have a roadmap of what we will be using it for in the next year. It has a very large applicability for some of our large-scale use cases,” he says.

Macklin adds that, despite not having the same profile as Scala or other emerging languages, it is likely to continue to gain traction with other businesses.

“Erlang may have been around for a while but that isn’t to its detriment – it is actually one of its strengths and it shows the pedigree,” he says.

"The big turning point – although we were looking at it before this – was the success of WhatsApp, and the scalability of what they get out of their platform and what they are able to deliver with such a small development team. If you wanted a poster child for an organistion that has used Erlang and has been massively successful then they would be one.

“It might not be as big as any of the other main players, so to speak. But the effect that it has had on our business has been really good, and it has been very effective in the problems we have used it for.”
发表于 2015-3-16 22:08 | 显示全部楼层
感谢分享
发表于 2015-3-17 15:09 | 显示全部楼层
365功能超强大
发表于 2015-3-23 02:34 | 显示全部楼层
来看看新闻
发表于 2015-4-20 23:05 | 显示全部楼层
终于看完了~~
发表于 2015-4-21 03:11 | 显示全部楼层
谢谢!楼主提供!好样的
发表于 2015-4-21 10:43 | 显示全部楼层
支持一下哈
发表于 2015-4-21 14:19 | 显示全部楼层
说得不错,有收获,顶一下
发表于 2015-4-21 15:30 | 显示全部楼层
真不知道,还有这么好心的楼主 支持
发表于 2015-4-21 17:13 | 显示全部楼层
大家有什么好看法,赶快说说
发表于 2015-4-21 18:00 | 显示全部楼层
请问大家有什么看法?我绝对喜欢这个帖子
发表于 2015-4-21 18:05 | 显示全部楼层
顶.支持,路过!
发表于 2015-4-21 22:25 | 显示全部楼层
众里寻他千百度,蓦然回首在这里!
发表于 2015-4-22 00:29 | 显示全部楼层
厉害!强~~没的说了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则



小黑屋|手机版|Archiver|论坛

GMT+8, 2024-4-30 09:19 , Processed in 0.135980 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表