Go Agent, Go
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
原文地址:Go Agent, Go, 感谢原作者分享。

熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

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

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

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

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

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

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

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

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

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

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

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