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, 感谢原作者分享。

Alat AI Hot

Undresser.AI Undress
Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover
Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool
Gambar buka pakaian secara percuma

Clothoff.io
Penyingkiran pakaian AI

AI Hentai Generator
Menjana ai hentai secara percuma.

Artikel Panas

Alat panas

Notepad++7.3.1
Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina
Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1
Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6
Alat pembangunan web visual

SublimeText3 versi Mac
Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Topik panas



Baru-baru ini, Pasukan Pemprosesan Bahasa Semulajadi Universiti Fudan (FudanNLP) melancarkan kertas semakan mengenai Agen berasaskan LLM Teks penuh sepanjang 86 halaman dan mempunyai lebih daripada 600 rujukan! Bermula dari sejarah AIAgent, penulis menyusun secara menyeluruh status semasa ejen pintar berdasarkan model bahasa yang besar, termasuk: latar belakang, komposisi, senario aplikasi Agen berasaskan LLM, dan masyarakat ejen yang telah menarik perhatian ramai. Pada masa yang sama, penulis membincangkan isu-isu yang berpandangan ke hadapan dan terbuka yang berkaitan dengan Ejen, yang sangat bernilai kepada trend pembangunan masa depan bidang berkaitan. Pautan kertas: https://arxiv.org/pdf/2309.07864.pdfLLM-basedAgent senarai kertas:

Firma keselamatan PeckShield menyatakan bahawa penggodam telah mengeluarkan 1,155 Ether kepada Tornado Cash, sebuah pengadun kripto yang tidak terkawal. Platform ini menggunakan kaedah kriptografi untuk memastikan transaksi tidak mudah dikesan.

Pengenalan kepada teknologi JavaAgent JavaAgent secara literal diterjemahkan sebagai ejen Java, dan sering dipanggil teknologi probe Java. JavaAgent telah diperkenalkan dalam JDK1.5 dan merupakan teknologi yang boleh mengubah suai kod bait Java secara dinamik. Kelas dalam Java disusun untuk membentuk kod bait yang dilaksanakan oleh JVM JVM memperoleh maklumat kod bait ini sebelum melaksanakan kod bait ini, dan mengubah kod bait ini melalui penukar kod bait untuk menyelesaikan beberapa ciri tambahan. JavaAgent ialah pakej jar yang tidak boleh dijalankan secara bebas Ia berfungsi melalui proses JVM yang dilampirkan pada program sasaran. Apabila bermula, anda hanya perlu menambah parameter -javaagent pada parameter permulaan program sasaran untuk menambah Cla

Hello semua, saya Laodu. Semalam, saya mendengar bandar hospital AI yang dikongsi oleh Institut Penyelidikan Industri Pintar Universiti Tsinghua di syarikat itu. Gambar: Ini adalah dunia maya Semua doktor, jururawat, dan pesakit adalah Agen yang dipandu oleh LLM dan boleh berinteraksi secara bebas. Mereka mensimulasikan keseluruhan proses diagnosis dan rawatan, dan mencapai ketepatan terkini sebanyak 93.06% pada subset set data MedQA yang meliputi penyakit pernafasan utama. Ejen pintar yang sangat baik tidak dapat dipisahkan daripada corak reka bentuk yang sangat baik. Selepas membaca kes ini, saya cepat-cepat membaca empat corak reka bentuk Ejen utama yang baru-baru ini diterbitkan oleh Encik Andrew Ng. Andrew Ng ialah salah seorang sarjana paling berwibawa di dunia dalam bidang kecerdasan buatan dan pembelajaran mesin Kemudian, saya dengan cepat menyusunnya dan berkongsi dengan semua orang. Mod 1. Refleksi

Menurut Arkham Intelligence, dompet penggodam, bermula dengan aksara "0xc9E," menghantar dana itu kembali ke dompet kerajaan AS.

Penggodam yang merompak kripto bernilai hampir $22 juta daripada dompet kerajaan AS minggu ini nampaknya telah memulangkan sebahagian besar dana

Insiden baru-baru ini menyerlahkan kelemahan dalam keselamatan aset digital. Ia juga menggambarkan trend yang lebih luas peningkatan mangsa jenayah siber dalam domain Web3.

Perkhidmatan Xbox Cloud Gaming Microsoft tersedia pada pelbagai peranti termasuk PC, telefon dan TV terpilih. Kini, perkhidmatan ini akan tersedia kepada lebih ramai pengguna melalui Fire TV Sticks, terima kasih kepada kerjasama antara Microsoft dan Amazon.Working For
