目錄
Why did we Go with Go?
mgo

Go Agent, Go

Jun 07, 2016 pm 04:30 PM
agent Hacker news

Discuss on Hacker News 10gen introduced MongoDB Backup Service in early May. Creating a backup service for MongoDB was a new challenge, and we used the opportunity to explore new technologies for our stack. The final implementation of the

Discuss on Hacker News

10gen introduced MongoDB Backup Service in early May. Creating a backup service for MongoDB was a new challenge, and we used the opportunity to explore new technologies for our stack. The final implementation of the MongoDB Backup Service agent is written in Go, an open-source, natively executable language initiated and maintained by Google.

Why did we Go with Go?

The Backup Service started as a Java project, but as the project matured, the team wanted to move to a language that compiled natively on the machine. After considering a few options, the team decided that Go was the best fit for its C-like syntax, strong standard library, the resolution of concurrency problems via goroutines, and painless multi-platform distribution.

mgo

As an open-source company, 10gen is fortunate to work with MongoDB developers around the world who build open-source tools for new and emerging languages to provide users with a breadth of options to access MongoDB. One of the MongoDB Masters, Gustavo Niemeyer, has spent over two years building mgo, the MongoDB driver for Go. In that time he’s developed a great framework for accessing MongoDB through Go and Gustavo has been a valuable resource as we’ve built out the Backup Service. In his own words:

“It’s great to see not only 10gen making good use of the Go language for first-class services, but contributing to that community of developers by providing its support for the development of the Go driver in multiple ways.”

Programming the backup agent in Go and the mgo driver has been extremely satisfying. Between the lightweight syntax, the first-class concurrency and the well documented, idiomatic libraries such as mgo, Go is a great choice for writing anything from small scripts to large distributed applications.

Starting a Java project often begins with a group debate: “Maven or Ant? JUnit or TestNG? Spring or Guice?” Go has a number of conventions through which Go team has created a sensible, uniform development experience with the holy trinity of tools: go build, test and fmt.

  • The organization of source code and libraries is standardized to allow using the go build tool. See details here

  • Name test files as XXX_test.go with functions named TestXXX can be run automatically with go test

  • Braces are required on if statements and the first brace goes along with the if condition. E.g.

if x {
     doSomething()
}
登入後複製

instead of:

if x 
{
    doSomething()
}
登入後複製
  • Methods that end with an f (e.g. Printf, Fatalf) means a string formatted method will be validated in go vet that the number of substitutions (e.g. %v) matches the number of inputs to the function.

mgo is a real pleasure to use with high-quality code, thorough documentation and an API that is a thoughtful, natural blend of idiomatic Go and MongoDB.?Our team owes a lot of thanks to Gustavo for his hard work on this project.

There are other Go projects being explored at the moment and we hope to see more people using mgo in production going forward.

By the 10gen Backup Team

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1655
14
CakePHP 教程
1413
52
Laravel 教程
1306
25
PHP教程
1252
29
C# 教程
1226
24
復旦NLP團隊發表80頁大模型Agent綜述,一文綜觀AI智能體的現況與未來 復旦NLP團隊發表80頁大模型Agent綜述,一文綜觀AI智能體的現況與未來 Sep 23, 2023 am 09:01 AM

近期,復旦大學自然語言處理團隊(FudanNLP)推出LLM-basedAgents綜述論文,全文長達86頁,共有600多篇參考文獻!作者們從AIAgent的歷史出發,全面梳理了基於大型語言模型的智慧代理現狀,包括:LLM-basedAgent的背景、組成、應用場景、以及備受關注的代理社會。同時,作者們探討了Agent相關的前瞻開放問題,對於相關領域的未來發展趨勢具有重要價值。論文連結:https://arxiv.org/pdf/2309.07864.pdfLLM-basedAgent論文列表:

雨水交換駭客中使用的龍捲風現金 雨水交換駭客中使用的龍捲風現金 Aug 08, 2024 am 06:15 AM

安全公司 PeckShield 指出,駭客從不受監管的加密貨​​幣混合器 Tornado Cash 中提取了 1,155 個以太幣。該平台採用加密方法來確保交易不易被追蹤。

Java Agent怎麼用 Java Agent怎麼用 May 22, 2023 pm 08:52 PM

JavaAgent技術簡介JavaAgent直譯為Java代理,也常被稱為Java探針技術。 JavaAgent是在JDK1.5引進的,是可以動態修改Java字節碼的技術。 Java中的類別編譯後形成字節碼被JVM執行,在JVM在執行這些字節碼之前獲取這些字節碼的信息,並且透過字節碼轉換器對這些字節碼進行修改,以此來完成一些額外的功能。 JavaAgent是一個不能獨立運行jar包,它透過依附於目標程式的JVM進程,進行工作。啟動時只需要在目標程式的啟動參數中加入-javaagent參數加入Cla

優秀Agent智能體必學的幾種設計模式,一學就會 優秀Agent智能體必學的幾種設計模式,一學就會 May 30, 2024 am 09:44 AM

大家好,我是老渡。昨天在公司聽了清華大學智慧產業研究院現場分享的AI醫院小鎮。圖片這是一個虛擬世界,所有的醫生、護士、病人都是由LLM驅動的Agent智能體,可以自主互動。它們模擬了整個診症看診的過程,在浸蓋主要呼吸道疾病的MedQA資料集子集上,實現了高達93.06%的最新準確率。優秀的智能體,離不開優秀的設計模式。看完這個案例,我趕緊拜讀了吳恩達老師最近發表的4種主要的Agent設計模式。吳恩達是人工智慧和機器學習領域國際上最權威的學者之一然後,趕緊整理出來,跟大家分享一下。模式一、反思

阿卡漢稱,駭客歸還從美國政府錢包中掠奪的 1,900 萬美元加密貨幣 阿卡漢稱,駭客歸還從美國政府錢包中掠奪的 1,900 萬美元加密貨幣 Oct 27, 2024 am 04:12 AM

本週從美國政府錢包中竊取價值近 2,200 萬美元加密貨幣的駭客似乎已歸還了絕大多數資金

駭客竊取近 2,000 萬美元後不到 24 小時就將 1,930 萬美元回饋美國政府錢包 駭客竊取近 2,000 萬美元後不到 24 小時就將 1,930 萬美元回饋美國政府錢包 Oct 26, 2024 pm 06:20 PM

據 Arkham Intelligence 稱,駭客的錢包以字元「0xc9E」開頭,將資金送回美國政府的錢包。

Web3 網路釣魚攻擊導致價值 5500 萬美元的 Dai 代幣損失 Web3 網路釣魚攻擊導致價值 5500 萬美元的 Dai 代幣損失 Aug 22, 2024 am 09:36 AM

最近的這一事件凸顯了數位資產安全方面的漏洞。它也說明了 Web3 領域網路犯罪受害者增加的更廣泛趨勢。

微軟和亞馬遜將 Xbox 遊戲引入 Fire TV 設備 微軟和亞馬遜將 Xbox 遊戲引入 Fire TV 設備 Jun 28, 2024 am 08:06 AM

微軟的 Xbox 雲端遊戲服務可在各種裝置上使用,包括 PC、手機和精選電視。現在,由於微軟和亞馬遜之間的合作,更多用戶將可以透過 Fire TV Sticks 獲得該服務。

See all articles