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

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解锁Myrise中的所有内容
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

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

黑客窃取近 2000 万美元后不到 24 小时就将 1930 万美元返还美国政府钱包 黑客窃取近 2000 万美元后不到 24 小时就将 1930 万美元返还美国政府钱包 Oct 26, 2024 pm 06:20 PM

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

Web3 网络钓鱼攻击导致价值 5500 万美元的 Dai 代币损失 Web3 网络钓鱼攻击导致价值 5500 万美元的 Dai 代币损失 Aug 22, 2024 am 09:36 AM

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

阿卡姆称,黑客归还从美国政府钱包中掠夺的 1900 万美元加密货币 阿卡姆称,黑客归还从美国政府钱包中掠夺的 1900 万美元加密货币 Oct 27, 2024 am 04:12 AM

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

微软和亚马逊将 Xbox 游戏引入 Fire TV 设备 微软和亚马逊将 Xbox 游戏引入 Fire TV 设备 Jun 28, 2024 am 08:06 AM

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

See all articles