用Scala重写Duolingo的引擎

Recently, we profoundly refactored the engine that drives Duolingo lessons. This post talks about our engineering choices, experiences, and the pain points of rewriting a highly complex system.

最近,我们深刻地重构了驱动Duolingo课程的引擎。这篇文章讲述了我们的工程选择、经验,以及重写一个高度复杂的系统的痛点。

Highlights:

亮点。

  • Redesigned architecture
  • 重新设计的架构
  • Refactored code from Python to Scala
  • 从Python到Scala重构的代码
  • Latency dropped from 750ms to 14ms
  • 延迟从750ms降至14ms
  • Engine uptime increased from 99.9% to 100%
  • 发动机正常运行时间从99.9%提高到100%。

Meet Duolingo’s engine, the Session Generator

认识一下Duolingo的引擎--会话生成器

Duolingo is the world’s most popular language learning app with more than 150 million users (at the time of this writing). At the core of the Duolingo experience, users learn in bite-sized lessons which consists of several interactive exercises (internally, we call them “challenges”).

Duolingo是世界上最受欢迎的语言学习应用程序,拥有超过1.5亿用户(在撰写本文时)。在Duolingo体验的核心中,用户在一点一滴的课程中学习,其中包括几个互动练习(在内部,我们称之为 "挑战")。

Image exercise Translation exercise Missing word exercise Speaking exercise

So, for any given lesson, which exercises should a user see and in what order? This is the responsibility of Session Generator, our backend module which gets data from one of our 88 language courses (and counting!) in the Duolingo Incubator, sprinkles some machine learning magic, and proceeds to serve a sequence of exercises tailored to the needs of each of our millions of users.

那么,对于任何给定的课程,用户应该看到哪些练习,以何种顺序进行?这是会话生成器的责任,我们的后台模块从Duolingo孵化器中的88个语言课程(还在不断增加!)中获取数据,撒上一些机器学习的魔法,然后根据我们数百万用户的需求提供一系列的练习。

Overview of the rewrite

重写的概述

Rewriting code is a complicated, but necessary process. Even though it halts the development of new features and may take several months, eventually, the technical debt that has built up must be addressed.

重写代码是一个复杂但必要的过程。即使它停止了新功能的开发,并可能需要几个月的时间,但最终,已经积累的技术债务必须得到解决。

In case you’re not familiar with the term, technical debt is like financial debt. You "borrow money" by making engineering decisions that let you develop something quickly. In the long term, though, development starts to stall because of these accumulated shortcuts, at which point it’s time to pay it off.

如果你不熟...

开通本站会员,查看完整译文。

Home - Wiki
Copyright © 2011-2024 iteam. Current version is 2.134.0. UTC+08:00, 2024-09-28 22:15
浙ICP备14020137号-1 $Map of visitor$