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"}]}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章