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脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++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设计模式。吴恩达是人工智能和机器学习领域国际上最权威的学者之一然后,赶紧整理出来,跟大家分享一下。模式一、反思

据 Arkham Intelligence 称,黑客的钱包以字符“0xc9E”开头,将资金送回美国政府的钱包。

最近的这一事件凸显了数字资产安全方面的漏洞。它还说明了 Web3 领域网络犯罪受害者增加的更广泛趋势。

本周从美国政府钱包中盗取价值近 2200 万美元加密货币的黑客似乎已归还了绝大多数资金

Microsoft 的 Xbox 云游戏服务可在各种设备上使用,包括 PC、手机和精选电视。现在,由于微软和亚马逊之间的合作,更多用户将可以通过 Fire TV Sticks 获得该服务。
