In this talk, we'll hear from Sam Helman, Software Engineer at 10gen, on how 10gen is integrating Go into our new and existing cloud tools. Some of the tools leveraging Go include the backup capabilities in MongoDB Management Service and a continuos integration tool. This was an opportunity to experiment with new technologies and create a better product for end users.
Programming the 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. In this talk, Sam will go through how the team has integrated Go and why Go and MongoDB are a great match for cloud services.
6. Development features
- Compiles quickly
- Easy to learn, small
- Strong standard libraries
- http
- subprocess
- time
- Nice plugins for editors
- sublime text, vim, emacs
7. What else is Go?
- A collection of development tools
8. mgo (mango) - Go Driver
- labix.org/v2/mgo
- Uses standard API for MongoDB drivers
- A little syntactic sugar (UpdateId, Upsert)
- Connection pooling, cluster discovery, read
preference, auth, GridFS
12. MMS Backup
- Hosted backups for MongoDB
- Lots of flexibility
o Periodic snapshots
o Point-in-time restore
o Support for sharded clusters
13. How it works (in a nutshell)
- Backup agent
o Runs on customer’s machine
o Syncs data, then tails oplog
- Backend storage ("Mothership")
o Collection of oplog operations (sent from agent)
o Deduped block storage of periodic snapshots
14. Backup Agent
- Originally written in Java
- However, needs to live on customer's
machines
- Needs to be easily deployable
- Java relies on customer's JVM, installed
libraries, etc.
15. Benefits of Go
- Go is compiled and statically linked
o Doesn't rely on anything on target machine
o Large binaries, but no dependencies
- Can be cross-compiled easily
o http://www.laher.net.nz/goxc/
o GOOS, GOARCH
16. Mongo Continuous Integration
(MCI)
- Our home-brewed CI system
- Used to test MongoDB cross-platform
- Built for a number of considerations
o Parallelization
o Flexibility
o Ease of tuning
o Speed
- (Will be open-source soon)
17. How it works
- One master machine
o Stores config info
o Polls github for changes
o Divides steps (compile, test) among workers
o Sends agent process over to workers
- Numerous worker machines
o Run steps (via agent), report back to master
18. MCI Agent
- Independent of master process
- Runs on worker machines
- Needs to run on all supported platforms
o With minimal maintenance
- Want to minimize worker machine setup
o Many are dynamically spun up
o As few dependencies as possible
19. Benefits of Go
- No dependencies
o Worker machines need only the agent binary
- Cross-platform
o Build on master machine, scp to workers
- Single binary to copy to workers
- Go dynamicallycompiles quickly
o Agent code changes a lot
o Rebuilt
24. 24
• From the initial sync, we rebuild your data in our
datacenters and take a snapshot
• We take snapshots every 6 hours
• Oplog is stored for 48 hours
Under the Hood
25. 25
• Balancer paused every 6 hours
• A no-op token is inserted across all shards,
mongoses and config servers
• Oplog applied to replica sets until point in which
token was inserted
• Provides a consistent state of database across
shards
Sharded Clusters
32. 32
1. Create an account at mms.10gen.com
2. Install MMS Monitoring Agent on your
deployment
3. Register at mms.10gen.com/backup
4. Install MMS Backup Agent on your deployment
5. Start initial sync
6. Rest easy!
Getting Started
33. Free Month – Register Using
Coupon Code
“MUG_NYC”
Editor's Notes
MongoDB Management Service (MMS) is a cloud-based suite of services for managing MongoDB deployments. MMS provides monitoring and backup capabilities, helping users optimize clusters, automate tasks and mitigate operational risk. For customers that prefer to manage MongoDB on their own infrastructure, 10gen also offers MMS MonitoringOn-Prem as part of MongoDB Enterprise (backup features coming soon).
Install lightweight agent written in Go so it’s compiled nativelyPerform an initial syncOplog tails going forward – performance impact similar to adding another secondaryEncrypted in motion
6 hour snaps for 48Dailys kept for 1 week1 snap kept 1 monthMonthlys kept for a yearDatacenters on east coast