目次
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 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

Fudan NLP チームは、AI エージェントの現状と将来の概要を 1 つの記事で提供する、80 ページにわたる大規模モデル エージェントの概要を発表しました。 Fudan NLP チームは、AI エージェントの現状と将来の概要を 1 つの記事で提供する、80 ページにわたる大規模モデル エージェントの概要を発表しました。 Sep 23, 2023 am 09:01 AM

最近、復丹大学自然言語処理チーム (FudanNLP) は、LLM ベースのエージェントに関するレビュー論文を発表しました。全文は 86 ページで、600 以上の参考文献があります。 AIAgentの歴史から始まり、LLMベースのAgentの背景、構成、適用シナリオ、注目を集めているエージェント社会など、大規模言語モデルに基づいた知的エージェントの現状を包括的に整理する。同時に、著者らは、関連分野の将来の開発動向にとって非常に価値のある、エージェントに関連する将来を見据えた未解決の問題についても議論しました。論文リンク: https://arxiv.org/pdf/2309.07864.pdfLLM-basedAgent 論文リスト:

雨の交換ハッキングで使用されたトルネード キャッシュ 雨の交換ハッキングで使用されたトルネード キャッシュ Aug 08, 2024 am 06:15 AM

セキュリティ会社 PeckShield は、ハッカーが規制されていない暗号通貨ミキサーである Tornado Cash に 1,155 イーサリアスを引き出したと指摘しました。このプラットフォームは、トランザクションが簡単に追跡できないようにするために暗号化手法を採用しています。

Javaエージェントの使用方法 Javaエージェントの使用方法 May 22, 2023 pm 08:52 PM

JavaAgent テクノロジの概要 JavaAgent は、文字通り Java エージェントと訳され、Java プローブ テクノロジと呼ばれることがよくあります。 JavaAgentはJDK1.5で導入され、Javaのバイトコードを動的に変更できる技術です。 Java のクラスは、JVM によって実行されるバイトコードを形成するためにコンパイルされます。JVM は、これらのバイトコードを実行する前にこれらのバイトコードの情報を取得し、バイトコード コンバータを通じてこれらのバイトコードを変更してプロセスを完了します。 JavaAgent は独立して実行できない jar パッケージであり、ターゲット プログラムに接続された JVM プロセスを通じて動作します。起動時に、ターゲットプログラムの起動パラメータに -javaagent パラメータを追加して Cla を追加するだけで済みます。

優秀なエージェントが学ぶべきいくつかのデザインパターンを一度に学ぶことができます 優秀なエージェントが学ぶべきいくつかのデザインパターンを一度に学ぶことができます May 30, 2024 am 09:44 AM

皆さんこんにちは、ラオドゥです。昨日、会社で清華大学知能産業研究所が共有するAI病院街を聞きました。写真: これは仮想世界です。すべての医師、看護師、患者は LLM によって動かされるエージェントであり、独立して対話できます。彼らは診断と治療の全プロセスをシミュレーションし、主要な呼吸器疾患をカバーする MedQA データセットのサブセットで 93.06% という最先端の精度を達成しました。優れたインテリジェント エージェントは、優れた設計パターンと切り離すことができません。この事例を読んだ後、私は Andrew Ng 氏が最近公開した 4 つの主要なエージェント設計パターンをざっと読みました。 Andrew Ng は人工知能と機械学習の分野で世界で最も権威のある学者の 1 人です。そして、私はそれを急いで編集し、みんなに共有しました。モード 1. 反射

ハッカー、約2,000万ドルを盗み24時間以内に1,930万ドルを米国政府の財布に返還 ハッカー、約2,000万ドルを盗み24時間以内に1,930万ドルを米国政府の財布に返還 Oct 26, 2024 pm 06:20 PM

アーカム・インテリジェンスによると、「0xc9E」という文字で始まるハッカーのウォレットから資金が米国政府のウォレットに送金されたという。

Web3 フィッシング攻撃により、5,500 万ドル相当の Dai トークンが損失 Web3 フィッシング攻撃により、5,500 万ドル相当の Dai トークンが損失 Aug 22, 2024 am 09:36 AM

この最近の事件は、デジタル資産のセキュリティの脆弱性を浮き彫りにしました。これは、Web3 ドメインにおけるサイバー犯罪被害者が増加するという広範な傾向も示しています。

Microsoft と Amazon が Xbox ゲームを Fire TV デバイスに導入 Microsoft と Amazon が Xbox ゲームを Fire TV デバイスに導入 Jun 28, 2024 am 08:06 AM

Microsoft の Xbox Cloud Gaming サービスは、PC、電話、一部のテレビなどのさまざまなデバイスで利用できます。 Microsoft と Amazon の提携により、このサービスは Fire TV Stick 経由でさらに多くのユーザーが利用できるようになります。

ハッカーが米国政府の財布から略奪した1900万ドルの暗号資産を返却、アーカム氏が語る ハッカーが米国政府の財布から略奪した1900万ドルの暗号資産を返却、アーカム氏が語る Oct 27, 2024 am 04:12 AM

今週米国政府の財布から約2,200万ドル相当の仮想通貨を略奪したハッカーは、資金の大部分を返還したようだ

See all articles