SlideShare a Scribd company logo
MongoDB Mobile
Bringing the Power of MongoDB to Your Device
This presentation contains “forward-looking statements” within the meaning of Section 27A of the Securities Act of 1933,
as amended, and Section 21E of the Securities Exchange Act of 1934, as amended. Such forward-looking statements are
subject to a number of risks, uncertainties, assumptions and other factors that could cause actual results and the timing of
certain events to differ materially from future results expressed or implied by the forward-looking statements. Factors that
could cause or contribute to such differences include, but are not limited to, those identified our filings with the Securities
and Exchange Commission. You should not rely upon forward-looking statements as predictions of future events.
Furthermore, such forward-looking statements speak only as of the date of this presentation.
In particular, the development, release, and timing of any features or functionality described for MongoDB products
remains at MongoDB’s sole discretion. This information is merely intended to outline our general product direction and it
should not be relied on in making a purchasing decision nor is this a commitment, promise or legal obligation to deliver
any material, code, or functionality. Except as required by law, we undertake no obligation to update any forward-looking
statements to reflect events or circumstances after the date of such statements.
Safe Harbor Statement
Matt Lord
Senior Product Manager
@mattalord
We've Come a Long Way
Mobile is becoming not only the new
digital hub, but also the bridge to the
physical world. That’s why mobile will
affect more than just your digital
operations — it will transform your
entire business.
Thomas Husson, Vice President and Principal
Analyst at Forrester Research
Mobile
Is Transforming Everything
A Complete Data Platform
Geographically distributed backend services
• MongoDB Atlas
• Point and click active/active global clusters
• Effortless HA, DR, and low-latency access
• MongoDB Stitch, Serverless Platform
• Automatic scaling based on request volume
• Stitch Query Anywhere
• Stitch Functions
• Stitch Triggers
• Stitch Mobile Sync (coming soon)
Geographically distributed frontend services
• MongoDB Mobile
• IoT and edge devices
• iOS and Android apps
• Supporting local offline storage
Stitch provides a seamless bridge between them
MongoDB Mobile
The Full Stack
Your Mobile Application
• iOS and Android devices
• Leveraging the power of MongoDB everywhere
• Allowing you to focus on building your GREAT THING
MongoDB Stitch SDK
• Access to MongoDB Stitch services from Android and iOS
• New Stitch Interfaces for on-device (local) storage
• Synchronization between local and remote
MongoDB Mobile Drivers
• Swift for iOS, Java for Android
• Existing drivers, extended to support local storage
MongoDB Mobile Database
• A lite version of MongoDB as a library
• C language interface to the library
• Fully passive, no background threads or tasks
MongoDB Mobile Storage Engine
• K/V storage on top of SQLite
• Very small disk footprint and minimal memory usage
• Energy efficient
Platform Details
Operating System OS Details CPUs Devices
iOS, tvOS 10.2+ ARM64
x86_64 (simulators)
Apple, Inc.
Android 7.0/Nougat+ x86_64
armeabi-v7a
arm64-v8a
Any vendor
(by ABI)
Linux TBD x86_64 Any vendor
macOS 10.10+ x86_64 Apple, Inc.
The Full Stack
Stitch SDK
Packages the entire mobile stack together
Stitches the frontend and backend together
• End-to-end Mobile SDK
• API for local storage
• API for remote Stitch service invocation
• API for syncing between local and remote
• Provides a transparent bridge for applications
iOS SDK: https://github.com/mongodb/stitch-ios-sdk/
Android SDK: https://github.com/mongodb/stitch-android-sdk/
final StitchAppClient client = Stitch.getDefaultAppClient();
final MongoClient mongoClient =
client.getServiceClient(LocalMongoDbService.ClientFactory);
MongoCollection<Document> items =
mongoClient.getDatabase(TodoItem.TODO_LIST_DATABASE).getCollection(TodoItem.T
ODO_LIST_COLLECTION);
public void updateChecked(final ObjectId itemId, final boolean isChecked) {
final Document updateDoc = new Document("$set", new
Document(TodoItem.CHECKED_KEY, isChecked));
if (isChecked) {
updateDoc.append("$currentDate", new Document(TodoItem.DONE_DATE_KEY,
true));
} else {
updateDoc.append("$unset", new Document(TodoItem.DONE_DATE_KEY, ""));
}
items.updateOne(new Document(TodoItem.ID_KEY, itemId), updateDoc);
...
}
private List<TodoItem> getItems() {
final ArrayList<TodoItem> todoItems = new ArrayList<>();
for (final Document doc : items.find()) {
if (TodoItem.isTodoItem(doc)) {
final TodoItem item = new TodoItem(doc);
todoItems.add(item);
}
}
return todoItems;
}
The Full Stack
Mobile Drivers
Existing drivers for the given language
• With a few extensions
• Open a local storage instance
• Close a local storage instance
• Support today for Swift, Java, and C
• Others created based on demand
Can be tested directly
• Swift: https://github.com/mongodb/swift-mongo-mobile/
• Java:
http://central.maven.org/maven2/org/mongodb/mongodb-
driver-embedded/
import MongoMobile
…
let client = MongoMobile.create(settings: MongoClientSettings [ dbPath:
"test-path" ])
let coll = try client.db("test").collection("foo")
let insertResult = try coll.insertOne([ "test": 42 ])
let findResult = try coll.find([ "_id": insertResult!.insertedId ])
let docs = Array(findResult)
…
The Full Stack
Mobile Database
Lite version of MongoDB formed into a library
• C ABI
• Auth, Replication, Sharding, etc. removed
• Supports only the mobile storage engine
• Passive: no background threads
• Light: disk, memory, energy
C Interface
• Low level
• Drivers are extended to invoke it
Availability
• Builds out of MongoDB 4.0+ community tree
• Pre-built binary packages for mobile targets
auto lib = mongo_embedded_v1_lib_init (&params, status);
auto instance = mongo_embedded_v1_instance_create (lib,
params.yaml_config, status);
client = mongo_embedded_v1_mongoc_client_create (instance);
collection = mongoc_client_get_collection (client, "iot_test",
"sensor_data");
insert = bson_new ();
BSON_APPEND_UTF8 (insert, "message", "Hey there!");
BSON_APPEND_UTF8 (insert, "from", "Matt Lord);
mongoc_collection_insert_one (collection, insert, NULL, NULL, &error);
query = bson_new ();
cursor = mongoc_collection_find_with_opts (collection, query, NULL,
NULL);
while (mongoc_cursor_next(cursor, &doc)) {
str = bson_as_canonical_extended_json (doc, NULL);
printf ("%sn", str);
bson_free (str);
}
* Complete example
The Full Stack
Mobile Storage Engine
Leverages SQLite as a K/V store
• Maintaining full MongoDB Query Language support
• Single SQLite database called “mobile”
• Table names follow the WiredTiger filesystem / dictionary
naming convention
• Every entity you create
• database, collection, index, …
Can be tested with standard MongoDB
./buildscripts/scons.py mongod --mobile-se=on
./build/opt/mongo/mongod --storageEngine=mobile
sqlite> .database
main: /.../mobile.sqlite
sqlite> .tables
_mdb_catalog index-1-1419396644176400596
collection-0-1419396644176400596 index-1-9204882299253173129
collection-0-9204882299253173129
sqlite> select sql from sqlite_master where name='collection-0-
9204882299253173129';
CREATE TABLE "collection-0-6881873531296038739"(rec_id INT, data
BLOB, PRIMARY KEY(rec_id))
sqlite> select sql from sqlite_master where name='index-1-
9204882299253173129';
CREATE TABLE "index-1-9204882299253173129"(key BLOB PRIMARY
KEY, value BLOB)
sqlite> select * from `collection-0-9204882299253173129`;
rec_id data
---------- ----------
1 2
What’s Next
Stitch Mobile Sync
Example Setup
Steps for Sync
1. Define Sync + Conflict Handlers on a collection
2. Specify Documents to be synced
3. Application manages local documents
4. Stitch then syncs state with the backend automatically
• Bi-directional synchronization
// Initialize your application, then configure Synced collections
Stitch.initializeDefaultAppClient('<your-app-id>').then(() => {
tripsColl.configureSync(trip_conflict, trip_change, trip_error);
...
});
// Find all trips that should be synced and ensure they’re synced
tripsColl.find({user: stitch.}).toArray().then(trips =>{
tripsColl.syncMany(trips)
});
...
tripsColl.sync().update({trip_id:currTripId},{meal_choice:
selectedMeal});
...
Coming Soon!
Stitch Mobile Sync
Example Usage
Stitch syncs data when online on a per operation basis
Uses 3 client-side event responders
• ChangeListener
• ConflictHandler
• ErrorListener
Defined Handlers receive all local/remote changes
// On changes to the remote document the trip_change handler is
called
function trip_change(changeEvent){
...
if(updatedFields.keys().includes(“Gate”)){
setStatusBarUpdate(“Gate Changed”, tripID, gate);
}
...
}
// On a conflict, the trip_conflict handler is called
function trip_conflict(localDoc, remoteDoc){
newStatus = remoteDoc;
for(key in remoteDoc.keys()){
if(localDoc[key] != remoteDoc[key] &&
isLocalPreferred(key)){
newStatus[key] = localDoc[key]
}
}
// Returning a document from the handler will attempt to write it
return newStatus;
};
Coming Soon!
Licensing,
Pricing, and
Support
Subject to Change
Roadmap
Subject to Change
Into the
Future…
Source: Star Wars Tales: Into the Great Unknown (2004) (Dark Horse Comics)
Thank You!
MongoDB Mobile: Bringing the Power of MongoDB to Your Device

More Related Content

What's hot (20)

PPTX
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
PDF
MongoDB .local Chicago 2019: Using MongoDB Transactions to Implement Cryptogr...
MongoDB
 
PPTX
Performance and Security Enhancements in MongoDB's BI Connector
MongoDB
 
PDF
Save your data
fragphace
 
PPTX
MongoDB for Developers
Ciro Donato Caiazzo
 
PDF
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
PDF
Klaus John, Proxy Authenticator Approach of a Signature based Single Sign on ...
Danube University Krems, Centre for E-Governance
 
PDF
MongoDB Mobile
MongoDB
 
PDF
MongoDB Stitch Introduction
MongoDB
 
PDF
Managing Cloud Security Design and Implementation in a Ransomware World
MongoDB
 
PDF
MongoDB Europe 2016 - Who’s Helping Themselves To Your Data? Demystifying Mon...
MongoDB
 
PPTX
[MongoDB.local Bengaluru 2018] Jumpstart: Introduction to Schema Design
MongoDB
 
PDF
Using JSON Web Tokens for REST Authentication
Mediacurrent
 
PDF
Micronaut Http Client
James Kleeh
 
PDF
MongoDB - How to model and extract your data
Francesco Lo Franco
 
PPTX
JWT SSO Inbound Authenticator
MifrazMurthaja
 
PDF
Firebase-ized your mobile app
Matteo Bonifazi
 
PDF
create your own cryptocurrency
Bellaj Badr
 
ODP
Consume Spring Data Rest with Angularjs
Corneil du Plessis
 
PPTX
NoSQL Endgame JCON Conference 2020
Thodoris Bais
 
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
MongoDB .local Chicago 2019: Using MongoDB Transactions to Implement Cryptogr...
MongoDB
 
Performance and Security Enhancements in MongoDB's BI Connector
MongoDB
 
Save your data
fragphace
 
MongoDB for Developers
Ciro Donato Caiazzo
 
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
Klaus John, Proxy Authenticator Approach of a Signature based Single Sign on ...
Danube University Krems, Centre for E-Governance
 
MongoDB Mobile
MongoDB
 
MongoDB Stitch Introduction
MongoDB
 
Managing Cloud Security Design and Implementation in a Ransomware World
MongoDB
 
MongoDB Europe 2016 - Who’s Helping Themselves To Your Data? Demystifying Mon...
MongoDB
 
[MongoDB.local Bengaluru 2018] Jumpstart: Introduction to Schema Design
MongoDB
 
Using JSON Web Tokens for REST Authentication
Mediacurrent
 
Micronaut Http Client
James Kleeh
 
MongoDB - How to model and extract your data
Francesco Lo Franco
 
JWT SSO Inbound Authenticator
MifrazMurthaja
 
Firebase-ized your mobile app
Matteo Bonifazi
 
create your own cryptocurrency
Bellaj Badr
 
Consume Spring Data Rest with Angularjs
Corneil du Plessis
 
NoSQL Endgame JCON Conference 2020
Thodoris Bais
 

Similar to MongoDB Mobile: Bringing the Power of MongoDB to Your Device (20)

PPTX
MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...
MongoDB
 
PPTX
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
Matt Lord
 
PDF
Faites évoluer votre accès aux données avec MongoDB Stitch
MongoDB
 
PPTX
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
MongoDB
 
PPTX
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB
 
PPTX
MongoDB Stitch Introduction
MongoDB
 
PPTX
Building Your First App with MongoDB Stitch
MongoDB
 
PPTX
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
MongoDB
 
PPTX
MongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB
 
PPTX
SH 2 - SES 1 - Stitch_Workshop_TLV.pptx
MongoDB
 
PPTX
Serverless Application Development with MongoDB Stitch
Michael Lynn
 
PDF
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
MongoDB
 
PPTX
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
MongoDB
 
PPTX
MongoDB.local Seattle 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB
 
PPTX
MongoDB.local Seattle 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB
 
PDF
Evolving your Data Access with MongoDB Stitch
MongoDB
 
PPTX
Best Practices for MongoDB in Today's Telecommunications Market
MongoDB
 
PDF
From Mobile to MongoDB: Store your app's data using Realm
Diego Freniche Brito
 
PDF
Building your first app with MongoDB
Norberto Leite
 
PPTX
Schnellere Digitalisierung mit einer cloudbasierten Datenstrategie
MongoDB
 
MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...
MongoDB
 
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
Matt Lord
 
Faites évoluer votre accès aux données avec MongoDB Stitch
MongoDB
 
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
MongoDB
 
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB
 
MongoDB Stitch Introduction
MongoDB
 
Building Your First App with MongoDB Stitch
MongoDB
 
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
MongoDB
 
MongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB
 
SH 2 - SES 1 - Stitch_Workshop_TLV.pptx
MongoDB
 
Serverless Application Development with MongoDB Stitch
Michael Lynn
 
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
MongoDB
 
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
MongoDB
 
MongoDB.local Seattle 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB
 
MongoDB.local Seattle 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB
 
Evolving your Data Access with MongoDB Stitch
MongoDB
 
Best Practices for MongoDB in Today's Telecommunications Market
MongoDB
 
From Mobile to MongoDB: Store your app's data using Realm
Diego Freniche Brito
 
Building your first app with MongoDB
Norberto Leite
 
Schnellere Digitalisierung mit einer cloudbasierten Datenstrategie
MongoDB
 
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
Ad

Recently uploaded (20)

PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
July Patch Tuesday
Ivanti
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 

MongoDB Mobile: Bringing the Power of MongoDB to Your Device

  • 1. MongoDB Mobile Bringing the Power of MongoDB to Your Device
  • 2. This presentation contains “forward-looking statements” within the meaning of Section 27A of the Securities Act of 1933, as amended, and Section 21E of the Securities Exchange Act of 1934, as amended. Such forward-looking statements are subject to a number of risks, uncertainties, assumptions and other factors that could cause actual results and the timing of certain events to differ materially from future results expressed or implied by the forward-looking statements. Factors that could cause or contribute to such differences include, but are not limited to, those identified our filings with the Securities and Exchange Commission. You should not rely upon forward-looking statements as predictions of future events. Furthermore, such forward-looking statements speak only as of the date of this presentation. In particular, the development, release, and timing of any features or functionality described for MongoDB products remains at MongoDB’s sole discretion. This information is merely intended to outline our general product direction and it should not be relied on in making a purchasing decision nor is this a commitment, promise or legal obligation to deliver any material, code, or functionality. Except as required by law, we undertake no obligation to update any forward-looking statements to reflect events or circumstances after the date of such statements. Safe Harbor Statement
  • 3. Matt Lord Senior Product Manager @mattalord
  • 4. We've Come a Long Way
  • 5. Mobile is becoming not only the new digital hub, but also the bridge to the physical world. That’s why mobile will affect more than just your digital operations — it will transform your entire business. Thomas Husson, Vice President and Principal Analyst at Forrester Research Mobile Is Transforming Everything
  • 6. A Complete Data Platform Geographically distributed backend services • MongoDB Atlas • Point and click active/active global clusters • Effortless HA, DR, and low-latency access • MongoDB Stitch, Serverless Platform • Automatic scaling based on request volume • Stitch Query Anywhere • Stitch Functions • Stitch Triggers • Stitch Mobile Sync (coming soon) Geographically distributed frontend services • MongoDB Mobile • IoT and edge devices • iOS and Android apps • Supporting local offline storage Stitch provides a seamless bridge between them
  • 8. The Full Stack Your Mobile Application • iOS and Android devices • Leveraging the power of MongoDB everywhere • Allowing you to focus on building your GREAT THING MongoDB Stitch SDK • Access to MongoDB Stitch services from Android and iOS • New Stitch Interfaces for on-device (local) storage • Synchronization between local and remote MongoDB Mobile Drivers • Swift for iOS, Java for Android • Existing drivers, extended to support local storage MongoDB Mobile Database • A lite version of MongoDB as a library • C language interface to the library • Fully passive, no background threads or tasks MongoDB Mobile Storage Engine • K/V storage on top of SQLite • Very small disk footprint and minimal memory usage • Energy efficient
  • 9. Platform Details Operating System OS Details CPUs Devices iOS, tvOS 10.2+ ARM64 x86_64 (simulators) Apple, Inc. Android 7.0/Nougat+ x86_64 armeabi-v7a arm64-v8a Any vendor (by ABI) Linux TBD x86_64 Any vendor macOS 10.10+ x86_64 Apple, Inc.
  • 10. The Full Stack Stitch SDK Packages the entire mobile stack together Stitches the frontend and backend together • End-to-end Mobile SDK • API for local storage • API for remote Stitch service invocation • API for syncing between local and remote • Provides a transparent bridge for applications iOS SDK: https://github.com/mongodb/stitch-ios-sdk/ Android SDK: https://github.com/mongodb/stitch-android-sdk/ final StitchAppClient client = Stitch.getDefaultAppClient(); final MongoClient mongoClient = client.getServiceClient(LocalMongoDbService.ClientFactory); MongoCollection<Document> items = mongoClient.getDatabase(TodoItem.TODO_LIST_DATABASE).getCollection(TodoItem.T ODO_LIST_COLLECTION); public void updateChecked(final ObjectId itemId, final boolean isChecked) { final Document updateDoc = new Document("$set", new Document(TodoItem.CHECKED_KEY, isChecked)); if (isChecked) { updateDoc.append("$currentDate", new Document(TodoItem.DONE_DATE_KEY, true)); } else { updateDoc.append("$unset", new Document(TodoItem.DONE_DATE_KEY, "")); } items.updateOne(new Document(TodoItem.ID_KEY, itemId), updateDoc); ... } private List<TodoItem> getItems() { final ArrayList<TodoItem> todoItems = new ArrayList<>(); for (final Document doc : items.find()) { if (TodoItem.isTodoItem(doc)) { final TodoItem item = new TodoItem(doc); todoItems.add(item); } } return todoItems; }
  • 11. The Full Stack Mobile Drivers Existing drivers for the given language • With a few extensions • Open a local storage instance • Close a local storage instance • Support today for Swift, Java, and C • Others created based on demand Can be tested directly • Swift: https://github.com/mongodb/swift-mongo-mobile/ • Java: http://central.maven.org/maven2/org/mongodb/mongodb- driver-embedded/ import MongoMobile … let client = MongoMobile.create(settings: MongoClientSettings [ dbPath: "test-path" ]) let coll = try client.db("test").collection("foo") let insertResult = try coll.insertOne([ "test": 42 ]) let findResult = try coll.find([ "_id": insertResult!.insertedId ]) let docs = Array(findResult) …
  • 12. The Full Stack Mobile Database Lite version of MongoDB formed into a library • C ABI • Auth, Replication, Sharding, etc. removed • Supports only the mobile storage engine • Passive: no background threads • Light: disk, memory, energy C Interface • Low level • Drivers are extended to invoke it Availability • Builds out of MongoDB 4.0+ community tree • Pre-built binary packages for mobile targets auto lib = mongo_embedded_v1_lib_init (&params, status); auto instance = mongo_embedded_v1_instance_create (lib, params.yaml_config, status); client = mongo_embedded_v1_mongoc_client_create (instance); collection = mongoc_client_get_collection (client, "iot_test", "sensor_data"); insert = bson_new (); BSON_APPEND_UTF8 (insert, "message", "Hey there!"); BSON_APPEND_UTF8 (insert, "from", "Matt Lord); mongoc_collection_insert_one (collection, insert, NULL, NULL, &error); query = bson_new (); cursor = mongoc_collection_find_with_opts (collection, query, NULL, NULL); while (mongoc_cursor_next(cursor, &doc)) { str = bson_as_canonical_extended_json (doc, NULL); printf ("%sn", str); bson_free (str); } * Complete example
  • 13. The Full Stack Mobile Storage Engine Leverages SQLite as a K/V store • Maintaining full MongoDB Query Language support • Single SQLite database called “mobile” • Table names follow the WiredTiger filesystem / dictionary naming convention • Every entity you create • database, collection, index, … Can be tested with standard MongoDB ./buildscripts/scons.py mongod --mobile-se=on ./build/opt/mongo/mongod --storageEngine=mobile sqlite> .database main: /.../mobile.sqlite sqlite> .tables _mdb_catalog index-1-1419396644176400596 collection-0-1419396644176400596 index-1-9204882299253173129 collection-0-9204882299253173129 sqlite> select sql from sqlite_master where name='collection-0- 9204882299253173129'; CREATE TABLE "collection-0-6881873531296038739"(rec_id INT, data BLOB, PRIMARY KEY(rec_id)) sqlite> select sql from sqlite_master where name='index-1- 9204882299253173129'; CREATE TABLE "index-1-9204882299253173129"(key BLOB PRIMARY KEY, value BLOB) sqlite> select * from `collection-0-9204882299253173129`; rec_id data ---------- ---------- 1 2
  • 15. Stitch Mobile Sync Example Setup Steps for Sync 1. Define Sync + Conflict Handlers on a collection 2. Specify Documents to be synced 3. Application manages local documents 4. Stitch then syncs state with the backend automatically • Bi-directional synchronization // Initialize your application, then configure Synced collections Stitch.initializeDefaultAppClient('<your-app-id>').then(() => { tripsColl.configureSync(trip_conflict, trip_change, trip_error); ... }); // Find all trips that should be synced and ensure they’re synced tripsColl.find({user: stitch.}).toArray().then(trips =>{ tripsColl.syncMany(trips) }); ... tripsColl.sync().update({trip_id:currTripId},{meal_choice: selectedMeal}); ... Coming Soon!
  • 16. Stitch Mobile Sync Example Usage Stitch syncs data when online on a per operation basis Uses 3 client-side event responders • ChangeListener • ConflictHandler • ErrorListener Defined Handlers receive all local/remote changes // On changes to the remote document the trip_change handler is called function trip_change(changeEvent){ ... if(updatedFields.keys().includes(“Gate”)){ setStatusBarUpdate(“Gate Changed”, tripID, gate); } ... } // On a conflict, the trip_conflict handler is called function trip_conflict(localDoc, remoteDoc){ newStatus = remoteDoc; for(key in remoteDoc.keys()){ if(localDoc[key] != remoteDoc[key] && isLocalPreferred(key)){ newStatus[key] = localDoc[key] } } // Returning a document from the handler will attempt to write it return newStatus; }; Coming Soon!
  • 19. Into the Future… Source: Star Wars Tales: Into the Great Unknown (2004) (Dark Horse Comics)