Company
Date Published
Author
Andrew Morgan, Drew DiPalma
Word count
907
Language
English
Hacker News points
None

Summary

At AWS re:Invent, a cloud-controlled Mars rover was demonstrated using MongoDB Stitch Mobile Sync, which synchronizes user commands written to MongoDB Atlas by the Mission Control app with the MongoDB Mobile database embedded in the rover. The commands are stored in Atlas and then synchronized to the rover whenever it's online. Each rover has a single document in the `rovers` collection, and each command is stored as an element in the `moves` array. Stitch Mobile Sync automatically pushes the document to the rover's MongoDB Mobile database, and the rover's Android app moves the rover in response. The app then updates the document in MongoDB Mobile, which is then synced back to Atlas. A conflict handling mechanism allows the client application to resolve conflicts by comparing the two versions of the document. This synchronization model consists of a single producer (the Mission Control app) and a single consumer (the rover), making conflicts unlikely due to the overlap of moves during a production and consumption event. The code for this demo is available in the Stitch Rover GitHub repo, and future posts will cover how Stitch Functions can be used to provide an aggregated view of the rover's sensor data.