Elasticsearch简史:源自给老婆开发烹饪App

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"当今,Elasticsearch 如此出名,从 GitHub 到 Guardian,许多大型企业都用它来帮助自己理解用户交互数据并提升它们的搜索结果。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"从一个简单的烹饪 App 说起"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"2004 年,Shay Banon 开发了 Compass,这是一个基于 Lucene 技术的应用。回忆起 Compass 的诞生,他的脸上总会挂满微笑。某种意义上,Shay Banon、Compass 与 Lucene 的关系是一种偶然。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"那时,他刚结婚。为支持妻子成为厨师的梦想,他们搬到伦敦。Shay Banon 正值失业状态,急需一份工作,所以他决定试试一些新技术,让自己的技能更符合当前时代的需求。因为只有真正尝试构建一些东西时,新技术才能发挥作用,所以他决定构建一个烹饪 App,让妻子可以用来搜索她在烹饪课程中收集的烹饪信息。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"为开发这款 App,他认真比较了很多不同技术的优缺点。在他眼里,这款 App 的核心是一个搜索框。只要你在这个搜索框中输入一个概念、一个想法或者一种配料,它就可以开始搜索可能相关的烹饪知识。很快,他接触到 Lucene,它当时是 Java 上可用的搜索库。他说:“我沉浸其中,尝试在典型的 Java 应用中简化 Lucene 的使用。这个过程中诞生了 Compass。”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Shay Banon 被这个项目深深吸引,把更多的时间和精力转向这个项目,而非烹饪 App 本身。几个月后,他决定把它开源,而 Compass 很快流行起来。Compass 允许用户轻松地将他们的领域模型(在典型程序中映射应用程序或业务概念的代码)映射到 Lucene,方便地索引,然后轻松地搜索它们。这种自由让越来越多的人开始使用 Compass 和 Lucene,但是他从未预料到这种情况。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"假设在你的金融应用程序中有一个交易模型,你可以轻松地使用 Compass 将该交易索引到 Lucene 中,然后搜索它,并自由地搜索交易的任何方面信息,并允许用户将这种自由传递给他们的用户,这被证明是一个功能非常强大的概念。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“实际上,这让我可以与实际用户交谈和工作,他们和我一样,发现了搜索在向用户提供业务价值方面所具有的惊人能力。”Shay Banon 说。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"10 年后的今天,它就是 Elasticsearch 的基础!"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Apache Lucene"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Shay Banon 认为,虽然自己可能比大多数 Apache Lucene 开发者更早参与这个项目,但是许多开发者的全心投入,将 Lucene 带入一个全新的发展水平。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在 Compass 和 Elasticsearch 早期,他花费无数个小时,与 Mike McCandless 和 Simon Willnauer 这样的人讨论 Lucene 的方方面面。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"他说:“当开始 Elasticsearch 时,我想确保我们建立的公司能保持 Apache Lucene 的快速发展速度和卓越水平。让我兴奋的是,从一开始就有 Simon、Uri Boness 和 Martijn Van Groningen 这样的 Lucene 专家参与其中。即便如此,如果你当时问我,我也绝不会想到今天我们能吸引如此强大的专注于 Apache Lucene 的团队。“"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"“推动”和“扩展”Lucene"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在 Shay Banon 看来,Elasticsearch“扩展了”Apache Lucene 的领域。例如,推动 Apache Lucene 变得更具弹性的需要,意外地(从 Lucene 的角度)强调索引速度,或者在工具方面对 Lucene 的可见性。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“每一天,我都会听到一个 Lucene 开发人员说‘我从未想过 Lucene 能用来解决这种问题’,或以这种方式使用。对我来说,这太棒了!因为我们正在创造一个环境,在这个环境中,使用 Elasticsearch 平台的个人之间存在着一种创造性的联系,正是这种联系促使 Apache Lucene 向前发展。同时,作为一家公司,我们有能力为我合作过的最有才华的开发群体之一提供机会去实现它。”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"当 Elasticsearch 不再是个人项目时,他们围绕它成立了一家公司,一个很大的好处是可以在 Elasticsearch 本身的发展上投入更多资金。除了 Shay Banon,公司的另一位创始人 Simon Willnauer 带领 Elasticsearch 和团队,开始将它推向一个全新的水平。他的首要任务之一是为 Elasticsearch 创建一个全新的测试基础设施(灵感来自 Apache Lucene 测试基础设施,包括随机测试,顺便说一句,这是一个很棒的话题)。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"创建一个新的测试基础设施"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在 Shay Banon 看来,构建分布式系统最重要的一个方面就是测试和验证其行为的能力。从概念上讲,很多人都能想到分布式系统,它意味着不同的进程,在不同的机器上,通过网络运行。当涉及到测试时,紧随其后的一个想法是,它应该被如何测试。这将创造一个非常复杂的测试工具,需要很长时间才能运行,而且故障发生时,它很难进行调试。"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/5c\/5c91589a479bf604e6e7a0e9e733d65b.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"“异常快速的”数据搜索 – 通过 elasticsearch.com"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在 Elasticsearch,这家公司投入了大量时间来构建一个测试工具,它能作为“常规”集成测试的一部分运行其分布式测试。这意味着,在单个 JVM 中,运行 Elasticsearch 的每一次测试时,用户就可以启动并操作整个集群。这包括一些简单的事情,例如在索引数据时回滚重启,也包括一些更有趣的测试,例如网络断联,一直到模拟长 GC 暂停,所有这些都是验证一个分布式系统行为的关键。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"能依赖这样的基础设施,并且可以非常简单快速地运行这些测试,能构建一个更具弹性的系统,并且更容易暴露“阴暗角落”和边缘情况。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"显然,构建一个分布式系统还需要很多,但正如 Simon 所说,“如果它没有测试,你怎么知道它能工作呢?”这是构建一个分布式系统的最基本的部分之一。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"当今的企业正被数据淹没,他们希望能理解这些数据并从中有所洞见。他们希望以最简单的方式实现这一点,获得最大的价值。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“事实证明,搜索是实现这种目标一种很好的方式。当我说搜索时,指的是更广泛意义上的搜索,就像我个人最初开发烹饪 App 一样,个人希望从数据中获得见解和知识。当我们说 Elasticsearch 中的搜索时,指的是自由文本搜索、结构化搜索和分析的结合,以最纯粹的方式,无论数据量多大,都是实时的。”Shay Banon 说。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"受《少数派报告》启发的技术"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"还记得《少数派报告》(Minority Report)中 Tom Cruise 的角色与他所探索的数据交互场景吗?不断地学习和塑造他所追求的东西,在没有任何限制的情况下实时放大缩小?这就是这家公司试图让用户用 Elasticsearch 做的事(虽然没有花哨的挥手互动,至少现在还没有)。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这是一个宏伟目标。Shay Banon 坚信有能力实现它。“我们的用户不断鼓励我们,并验证了我们走在正确的路上。用户每天都告诉我们,他们用我们产品实现的目标是他们从未想过的。他们一直寻找创新的方法来使用 Elasticsearch,而且,我认为这是一个伟大产品的标志,它允许用户达到他们最初从未想象过的创造性水平”。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Elasticsearch 成功的核心之一"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Shay Banon 在 Elasticsearch 发展中遇到的第一个障碍是,之前的开源项目 Compass 试图让用户在更窄的范围内了解他所看到的。那时,当对用户说“搜索”时,他们不会立即掌握可以实现的所有可能性。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"他回忆说:“10 年前,我对它一无所知。但是,通过构建一种允许用户将任何领域模型映射到“搜索”(即 Lucene),使得跨越这种心理障碍变得更加简单,突然之间,使用案例爆炸性增长,Compass 和 Lucene 被用来赋能‘非典型搜索用例’。”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"使用 Elasticsearch,通过标准化 JSON 和 RESTful 接口,用户借此可以做很多事。很快,在一种更广泛的基础上:从各种各样的开发人员,从不同的编程语言,到不同的框架,到许许多多不同的用例。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"最后,这一切归结为搜索的力量,从技术上来说,是 Elasticsearch 和 Apache Lucene 的力量。就实现而言,数据是典型的 Web 页面或者 word 文档,还是 Foursquare 上的地理位置、银行里的一笔交易、web 服务器上的一条日志,或者一种度量标准,其实并不重要。所有这些数据实际上都是结构化和非结构化数据的组合,无论数据的形式或大小如何,人们都希望对其进行探寻、搜索并拥有《少数派报告》那样的体验。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"原文链接:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/jaxenter.com\/elasticsearch-founder-interview-112677.html","title":null,"type":null},"content":[{"type":"text","text":"https:\/\/jaxenter.com\/elasticsearch-founder-interview-112677.html"}]}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章