elixir 规格_六家使用Elixir的著名公司-以及为什么做出改变

elixir 规格

Elixir is a functional and dynamic programming language first released in 2011, so it’s still relatively new.

Elixir是一种功能和动态编程语言,于2011年首次发布,因此仍然相对较新。

Since then, it’s been gaining popularity because it’s highly scalable, reliable, and great for microservices and cloud computing. Let’s look at a handful of major-league companies that decided to introduce Elixir into their architecture and see what they gained from the change.

从那时起,它就变得越来越流行,因为它具有高度的可伸缩性,可靠性,并且非常适合微服务和云计算。 让我们看一下少数几家决定将Elixir引入其体系结构的大型联盟公司,并看看他们从这次变革中获得了什么。

Elixir is based on Erlang VM, a 20-year-old virtual machine built to support robust, concurrent, and distributed software. Together with its Phoenix framework, you can use Elixir in virtually any industry and for any application. Recently, it’s been gaining popularity as an enterprise-level software in:

Elixir基于Erlang VM(Erlang VM),这是一个已有20年历史的虚拟机,旨在支持健壮,并发和分布式软件。 结合其Phoenix框架,您几乎可以在任何行业和任何应用程序中使用Elixir。 最近,它已作为企业级软件在以下领域获得普及:

The language is perfect for projects that need to support concurrency and low latency, handle a lot of traffic, and scale easily.

对于需要支持并发性和低延迟,处理大量流量并且易于扩展的项目,该语言是理想的选择。

Actually, in the foreword to a recent book by Dave Thomas, the creator of the language, José Valim, describes concurrency as the backbone of Elixir, adding that its biggest value is “freeing programmers from antiquated concurrency mechanisms.”

实际上,该语言的创建者何塞·瓦利姆(JoséValim)在戴夫·托马斯(Dave Thomas )的新书前言中将并发描述为Elixir的骨干,并补充说其最大的价值是“使程序员摆脱过时的并发机制。”

The benefits of Elixir also include high fault tolerance, reliability, and a tidy, modern syntax. It’s proven itself useful for distributed systems like Blockchain projects, embedded systems, as well as real-time apps using instant messaging, video chats, or financial apps.

Elixir的好处还包括较高的容错能力,可靠性和整洁的现代语法。 它被证明对分布式系统(如区块链项目,嵌入式系统以及使用即时消息传递,视频聊天或财务应用程序的实时应用程序)非常有用。

Furthermore, there are multiple additional architectures, services, and frameworks that build upon Elixir. Some examples include:

此外,还有许多基于Elixir构建的其他架构,服务和框架。 一些示例包括:

  • Phoenix-a framework for creating REST APIs and HTML applications with Elixir

    凤凰 -a与灵药创建REST API和HTML应用程序框架

  • Ecto-a database wrapper and query language for Elixir

    ecto- Elixir的数据库包装和查询语言

  • ExUnit-Elixir’s built-in unit testing frameworks

    ExUnit -Elixir的内置单元测试框架

  • Mox-a mocking library for use in automated tests

    Mox-用于自动化测试的模拟库

  • Exq-a job-processing library for Elixir.

    Exq -Elixir的作业处理库。

Thinking of making the switch yourself? Take a look at just a few of the most prominent examples of highly successful companies that have employed Elixir in their major projects in recent months-and the results they managed to achieve with it.

想自己做开关吗? 看看最近几个月在Elixir的主要项目中雇用了Elixir的非常成功的公司的一些最著名的例子,以及他们设法实现的结果。

Image for post
Ruby or Elixir?
Ruby还是Elixir?

Ruby or Elixir?

Ruby还是Elixir?

Not sure if you should choose Elixir or Ruby for scaling or building software?

不确定是否应选择Elixir或Ruby进行扩展或构建软件?

Read our comparison.

阅读我们的比较。

1. Pinterest:一半的服务器,更少的代码十倍 (1. Pinterest: half the servers, 10 times less code)

Pinterest is one of the biggest online companies to have successfully used Elixir. In Q3 of 2018, the service had 250 million active users pinning 175 billion items to their boards. Their speedy growth might have had something to do with their conversion to Elixir in 2014. The new programming language helped them speed up the performance of their notification system delivering 14,000 notifications per second and cut down the number of servers by half-from 30 to just 15-compared to when the service relied on Java.

Pinterest是成功使用Elixir的最大的在线公司之一。 在2018第三季度 ,该服务拥有2.5亿活跃用户,将1,750亿个项目固定在其董事会上。 他们的快速成长可能与他们在2014年改用Elixir有关 。 新的编程语言帮助他们提高了通知系统的性能,每秒可发送14,000条通知,与服务器依赖Java相比,服务器数量减少了一半,从30个减少到15个。

Using Elixir also allowed Pinterest to clean up their code, slimming it down to around 1,000 lines-a tenfold reduction. Pinterest now also uses Elixir to route more than 30,000 events per second to its in-house rule engine for spam prevention.

使用Elixir还允许Pinterest清理其代码,将其精简到大约1000行-减少了十倍。 Pinterest现在还使用Elixir将每秒30,000多个事件发送到其内部规则引擎以防止垃圾邮件。

2. Moz:磁盘空间减少63倍,API速度提高20倍 (2. Moz: 63 times less disk space, 20 times faster API)

In 2016, Moz Pro, the leading SEO tool and online platform helping companies analyze and improve their search engine performance, decided to do an overhaul of their backend architecture. Their goals were to:

2016年,领先的SEO工具和在线平台Moz Pro (帮助公司分析和改善其搜索引擎性能)决定彻底改革其后端架构。 他们的目标是:

  • improve speed and performance,

    提高速度和性能,
  • help scale the tool,

    帮助扩展工具,
  • add new features, like selectable date ranges, complete campaign history, flexible in-app data segmentation, and customizable data filtering.

    添加新功能,例如可选日期范围,完整的广告系列历史记录,灵活的应用内数据细分和可自定义的数据过滤。

They explained the process and the results on their developer blog. The main problem they had to solve was the fact that they’ve outgrown their database infrastructure. As a result, the architecture didn’t scale well and stopped performing properly when flooded with large sets of data, which was absolutely key for a growing SEO analytics tool.

他们在开发人员博客上解释了该过程和结果。 他们必须解决的主要问题是他们的数据库基础架构已无法满足需求。 结果,该架构无法很好地扩展,并且在充斥大量数据时无法正常运行,这对于不断增长的SEO分析工具而言绝对是关键。

The architecture limited the depth and flexibility of the data that was to be presented in a variety of ways. The problems they identified included non-scalability, non-standard use of MySQL, and concurrency limitations in Ruby.

该体系结构限制了将以各种方式呈现的数据的深度和灵活性。 他们确定的问题包括不可伸缩性,MySQL的非标准使用以及Ruby中的并发限制。

Switching to Elixir, they were able to use smaller data files and, as a result, use 63 times less disk space, on average, than when using MySQL rankings tables. They were also able to improve the speed of their API by 20 times compared to the previous API, with average response times consistently below 50 ms (compared to 800+ ms). All in all, the simple deployment resulted in 30 times faster build speeds.

切换到Elixir后,他们能够使用较小的数据文件,因此,与使用MySQL排名表相比,它们平均使用的磁盘空间少63倍。 与以前的API相比,他们还能够将API的速度提高20倍,平均响应时间始终低于50毫秒(800+毫秒)。 总而言之,简单的部署使构建速度提高了30倍。

3.孤独星球:更好的性能,可扩展的内容 (3. Lonely Planet: better performance, scalable content)

Lonely Planet is a worldwide travel site (and a traditional travel guide publisher) serving millions of unique visitors each month. It publishes a lot of rich content using their website, mobile app, and third-party services. The problem was that their Web content was stuck behind Ruby on Rails applications, Wordpress instances, and various other data stores.

孤独星球 ( Lonely Planet)是一个全球旅行网站(也是传统的旅行指南发行商),每月为数百万唯一身份访问者提供服务。 它使用其网站,移动应用程序和第三方服务发布了许多丰富的内容。 问题在于他们的Web内容被卡在Ruby on Rails应用程序,Wordpress实例和各种其他数据存储之后。

What they needed was to be able to serve it to Web and mobile apps quicker and at scale. This called for a different data model, a cleaner API, and a much more scalable infrastructure.

他们需要的是能够更快,更大规模地为Web和移动应用程序提供服务。 这就要求使用不同的数据模型,更简洁的API和更具可伸缩性的基础架构。

After several failed attempts, the company hired a development team that created several microservices, some of them written in Elixir. One was an Elixir microserver with an API sub-service using the Phoenix Web framework, designed to serve available lodgings from booking.com and HostelWorld. Another microservice written in Elixir serves their inventory of books and ebooks from a custom ecommerce system backed by a Microsoft SQL server.

在几次失败的尝试之后,该公司雇用了一个开发团队来创建多个微服务,其中一些是用Elixir编写的。 其中之一是使用Phoenix网络框架的带有API子服务的Elixir微服务器,该服务旨在为booking.com和HostelWorld提供可用的住宿。 用Elixir编写的另一种微服务通过Microsoft SQL Server支持的自定义电子商务系统为他们的书籍和电子书提供库存。

According to the architects of the new solution, they were able to put a robust architecture in place using Elixir, with much higher performance and lower memory requirements.

根据该新解决方案的架构师的介绍 ,他们能够使用Elixir构建强大的体系结构,并具有更高的性能和更低的内存需求。

4.《金融时报》:易学,快速扩展 (4. Financial Times: easy to learn, quick to scale)

The Financial Times is a respected news publication established in 1888. Alongside their traditional daily newspaper, they also run a huge online service that just announced a million paying readers last April. They previously used a micro-service REST APIs, but to deal with the growing online readership and improve the performance of the service, they turned to a GrapQL API based on Elixir.

《金融时报》是一家受人尊敬的新闻出版物,成立于1888年。除了传统的日报外,他们还经营着庞大的在线服务,该服务于去年4月宣布了100万付费读者。 他们以前使用微服务REST API,但是为了应对不断增长的在线读者数量并提高服务性能,他们转向了基于Elixir的GrapQL API。

Now, they also have another Elixir-based app and enjoy much smaller memory usage compared to Java. According to the now former senior software developer at Financial Times, Ellis Pritchard, Elixir was easy to learn for the development team -another advantage of the language.

现在,他们还拥有另一个基于Elixir的应用程序,与Java相比,它们的内存使用量要少得多 。 据在金融时报埃利斯普里查德现在前高级软件开发人员, 药剂是简单易学的开发团队的语言-another优势。

5.丰田互联:全球范围内的机动性 (5. Toyota Connected: mobility at a global scale)

Toyota has just launched its first global car sharing platform. The service uses Toyota’s proprietary global Mobility Service Platform (MSPF) and a consumer-facing app.

丰田刚刚启动了其第一个全球汽车共享平台。 该服务使用丰田公司专有的全球移动服务平台(MSPF)和面向消费者的应用程序。

Toyota Connected uses Elixir as part of the backend system that makes up the Mobility Service Platform. It provides an API for mobile and Web applications and handles the geo-processing, e.g. verifying whether a vehicle is inside or outside a geofence.

Toyota Connected使用Elixir作为构成Mobility Service Platform的后端系统的一部分。 它为移动和Web应用程序提供API,并处理地理处理,例如,验证车辆在地理围栏之内还是之外。

The company’s plans are to have the majority of its new vehicles sold in North America and Japan sending information to their cloud by 2020. They’re planning to analyze traffic patterns and driver behavior, connect drivers with infrastructure, and create new services and products.

该公司的计划是到2020年,在北美和日本销售的大部分新车将信息发送到他们的云中。他们计划分析交通模式和驾驶员行为,将驾驶员与基础设施联系起来,并创建新的服务和产品。

To learn more about how Toyota Connected uses Elixir, watch the talk their developer Powell Kinney gave at Code Elixir LDN conference in 2018, where he explains designing for longevity using Elixir and Erlang/OTP.

要了解有关Toyota Connected如何使用Elixir的更多信息,请观看其开发人员Powell Kinney在2018年的Code Elixir LDN会议上发表的演讲,他在其中解释了使用Elixir和Erlang / OTP进行寿命设计。

6. Bleacher报告:流量增加了8倍 (6. Bleacher Report: 8 times more traffic)

Bleacher Report, a division of Turner Sports, is the second largest sports website in the world. They get up to 1.5 billion page views a month and send out more than 3 billion push notifications.

特纳体育的一个部门Bleacher Report是世界第二大体育网站。 他们每月获得15亿的页面浏览量,并发送超过30亿的推送通知。

Ruby on Rails was originally used to create the service, but the growing traffic eventually demonstrated that the service was no longer scalable. Another huge challenge involved supporting concurrent streaming in their Team Stream app. Given the real-time, mobile-first approach the company boasts, they needed to be able to handle huge spikes in traffic at peak times on mobile devices.

Ruby on Rails最初是用于创建服务的,但是不断增长的流量最终证明该服务不再可伸缩。 另一个巨大的挑战涉及在其Team Stream应用程序中支持并发流。 鉴于公司拥有的实时,移动优先的方法,他们需要能够在高峰时期处理移动设备上的流量高峰。

Their development team tried out various options, including Node.js and Go, before finally deciding on Elixir-it brought significant improvements in performance, while its syntax was similar to Ruby’s, which made it easy to learn.

他们的开发团队在最终决定使用Elixir之前尝试了包括Node.js和Go在内的各种选项,它带来了性能上的显着改善,而其语法与Ruby相似,因此易于学习。

This is how lead engineer Ben Marx summarized the benefits of the switch:

首席工程师Ben Marx总结了这种转换的好处:

Elixir has proven so efficient that testing the limits of our services became a challenge unto itself, requiring investment in new benchmarking tools and strategies. In a recent test, for example, our most heavily trafficked service was able to handle 8x our average traffic load, without autoscaling, before the database proved to be a bottleneck.

事实证明,Elixir是如此高效,以至于测试我们的服务极限已成为一项挑战,需要对新的基准测试工具和策略进行投资。 例如,在最近的测试中,在数据库被证明是瓶颈之前,我们流量最大的服务能够处理8倍的平均流量负载,而无需自动扩展。

Other benefits of employing Elixir included:

使用Elixir的其他好处包括:

  • a cleaner code,

    更清晰的代码
  • smaller technical debt,

    较小的技术债务,
  • an increase in development speed,

    开发速度加快,
  • impressive performance improvements.

    令人印象深刻的性能改进。

对企业意味着什么? (What does it mean for business?)

In most of the cases mentioned above, the switch to Elixir (or the decision to build in Elixir right from the start) resulted in apps and services capable of handling much bigger traffic. That means they scale well, can grow without losing reliability, all the while improving overall performance. In business terms, that means more users, customers, and a higher ROI.

在上述大多数情况下,改用Elixir (或从一开始就决定在Elixir中进行构建的决定)导致能够处理更大流量的应用程序和服务。 这意味着它们可以很好地扩展,可以在不损失可靠性的情况下增长,同时还能提高整体性能。 用业务术语来说,这意味着更多的用户,客户和更高的投资回报率。

Originally published at https://www.monterail.com.

最初发布在 https://www.monterail.com上

翻译自: https://medium.com/@monterail/six-famous-companies-using-elixir-and-why-they-made-the-switch-7acdb8b22e40

elixir 规格

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值