SlideShare a Scribd company logo
Introduction to MongoDB and
Serverless App Development
with MongoDB Stitch
Michael Lynn
Worldwide Director of Developer Relations
@mlynn
Michael Lynn
{
‘name’: ‘Michael Lynn’,
‘title’: ‘Global DevRel@MongoDB’,
‘company’: ‘MongoDB’,
‘location: ‘Philadelphia, PA’,
‘twitter’: ‘@mlynn,
‘previous’: [
{ ‘title’: ‘Engineer’ },
{ ‘title’: ‘Developer’}
]
}
Who is this guy?
@mlynn
My goals for today
1. What is MongoDB Stitch
2. What is MongoDB Atlas
3. What does Idiomatic mean?
4. What’s Michael’s Twitter
Handle?
5. What authentication providers
does MongoDB Support?
6. Bonus: How does Stitch
enable more granular access
control?
@mlynn
My first app… 1993
@mlynn My first app… 1993
@mlynn
“We set out to build a database that we would
want to use, so that whenever developers
wanted to build an application, they could
focus on the application, not on working
around the database.”
- Eliot Horowitz
@mlynn
Document Model
{
first_name: ‘Paul’,
surname: ‘Miller’,
city: ‘London’,
location: [45.123,47.232],
cars: [
{ model: ‘Bentley’,
year: 1973,
value: 100000, … },
{ model: ‘Rolls Royce’,
year: 1965,
value: 330000, … }
]
}
MongoDBRDBMS
@mlynn
MongoDB Server
10gen
MongoDB
@mlynn
MongoDB Atlas - Database as a Service
@mlynn
● Deploy
● Manage
● Scale
● Backup
● Distribute
@mlynn
QueryAnywhere
Bring MongoDB's rich query
language safely to your
application.
Build full apps for iOS,
Android, Web, and IoT
Functions
Integrate microservices,
server-side logic,
and cloud services.
Power apps or enable Data
as a Service with custom
APIs.
Mobile Sync
Automatically synchronize
data between MongoDB
Mobile and the Cloud.
(coming soon)
Triggers
React to database changes
in real time by executing
functions.
Respond immediately to
changing data.
Stitch Overview
@mlynn
Stitch Overview
MongoDB Query Language + Native DriversIntegrated Rules
Functions3rd Party Services
Native SDKs (JavaScript, Android, iOS)
Rest API
@mlynn
Stitch Overview
MongoDB Query Language + Native DriversIntegrated Rules
Functions3rd Party Services
Native SDKs (JavaScript, Android, iOS)
Rest API
Simplify the Boring Stuff
Why Use Stitch?
Security Matters
Why Use Stitch?
Code Wins Arguments
Why Use Stitch?
@mlynn
Stitch User Accounts
Authentication Providers
@mlynn
Authentication Providers
Continue as Guest
@mlynn
Continue as Guest
@mlynn
@mlynn
@mlynn
Authentication Providers
● Simple Login API
● Pluggable Authentication Providers
○ Email/Password
○ OAuth (Facebook/Google)
○ Custom w/ JWT
○ … and more!
● Multiple Providers per App
○ Link user accounts
○ Log in with any provider
■ Google
■ Facebook
■ etc.
import {
Stitch,
UserPasswordCredential
} from 'mongodb-stitch-browser-sdk';
// Get the user-submitted email and
password
const { email, password } = userInput;
// Log in using the user’s credentials
await Stitch.auth.loginWithCredential(
new UserPasswordCredential(username,
password);
);
// Get data about the newly logged in user
const user = await Stitch.auth.user;
@mlynn
{
"id": "xx",
"name": "xx",
"given_name": "xx",
"family_name": "xx",
"link": "xx",
"picture": "xx",
"gender": "xx",
"locale": "xx"
}
context.users
@mlynn
Write Data
MongoDB Service
@mlynn
@mlynn
MongoDB Service
● Familiar MongoDB Query Language
○ find
○ insert
○ update
○ delete
○ aggregate
● Database Access from Client Code
○ No REST API Needed!
● User-Level Data Access Rules
// Instantiate the MongoDB Service
const mongodb = stitchClient.getServiceClient(
RemoteMongoClient.factory,
“mongodb-atlas”
);
// Get a reference to a collection
const entries = mongodb
.db(“journal”)
.collection(“entries”);
// Insert documents
await entries.insertOne({
title: “My Great Day”,
body: “I had a great day today!”
});
// Update documents
await entries.updateOne(
{ title: “My Great Day” },
{ $set: { body: “I had an AMAZING day today!” } }
);
// Find documents
const someEntry = await entries.findOne({
title: “My Great Day”
});
@mlynn
Word of the day
Idiomatic
@mlynn
Granular, Field Level Access Control
MongoDB Rules
@mlynn
What does that mean?
MongoDB MongoDB Stitch
Collection Level Access
Control
Collection Level Access
Control
Document Level Control Document Level Control
Field Level Access Control
@mlynn
MongoDB Rules
● Specify exactly who sees what data
○ Customized for the Current User
○ Configured per Collection
● Enforce Document Schemas
● Fully Configurable
○ Pre-configured Templates
○ “Advanced Mode” JSON
OFFICE STAFF ACCESS
PHYSCIAN ACCESS
@mlynn
Third Party Services - Email, for Example
Stitch Functions & Services
@mlynn
@mlynn
@mlynn
Stitch Functions
● Serverless JavaScript Functions
● Connect with External Services
○ Twilio, AWS, … and more!
○ Control access with rules
● Execute From Anywhere
○ Client applications
○ Stitch functions
○ Service rules
// notifyUserOfShare
exports = function(sharedWithEmail) {
const ses = context.services.get(“aws-ses”);
return ses.send({
to: sharedWithEmail,
from: context.values.get("journalEmailAddress"),
body: "Someone shared a journal entry with you!"
});
};
// Call from the Client
stitchClient.callFunction(
"notifyUserOfShare”,
["someuser@example.com”]
);
@mlynn
Notify Users Automatically
MongoDB Triggers
@mlynn
MongoDB Triggers {
“name”: “notifyUserOfShare”,
“type”: “DATABASE”,
“function_name”: “notifyUserOfShare”,
“config”: {
“operation_types”: {
“UPDATE”
},
“database”: “journal”,
“collection”: “entries”,
“service_name”: “mongodb-atlas”,
“match”: {},
“full_document”: false
},
“disabled”: false
}
● Fire in Response to Data Changes
○ Built on MongoDB Change Streams
● Pass Change Events to Functions
● Use Multiple Triggers per Collection
@mlynn
https://hacktoberfest.digitalocean.com/
@mlynn
Vue.js Example:
https://github.com/mrlynn/mongodb-stitch-vue-example
http://bit.ly/nyccodecamp2018
@mlynn
My goals for today
What is MongoDB Stitch -
MongoDB Stitch is Serverless, Backend as a Server
- Functions
- Rules
- Service Integrations
@mlynn
My goals for today
What is MongoDB Atlas
MongoDB Atlas is MongoDB’s Database as a Service hosting on top of
AWS, Azure and GCP
@mlynn
My goals for today
What does Idiomatic mean?
MongoDB’s SDK’s are Idiomatic - meaning natural, in the language
you are used to developing.
@mlynn
My goals for today
What’s Michael’s twitter handle?
@mlynn
@mlynn
My goals for today
What authentication providers does MongoDB Stitch Support?
● Anonymous
● Email
● Facebook
● Google
● API Keys
● Custom
@mlynn
My goals for today: Bonus
How does MongoDB enable more granular access control?
Rules: MongoDB Stitch enables rules that enable developers to
segregate documents to have field-level access controls.
@mlynn
Thank You!
@mlynn
Need Inspiration?
https://github.com/dlombard/tinyslack.git
https://github.com/leolin04/mdb-hackathon-slack-lunch.git
https://github.com/makesitgo/cue.git
https://github.com/bsamek/offsite-lang
https://github.com/davidedeangelismdb/mdb4vet.git
https://github.com/Anemy/Shirt
https://github.com/StevenConnors/cue-hw.git
@mlynn
stitch.mongodb.com
Documentation
docs.mongodb.com/stitch/
Demo Applications
github.com/mongodb/stitch-examples/
JavaScript SDK
github.com/mongodb/stitch-js-sdk/
Dive Deeper with
MongoDB Stitch
Resources

More Related Content

PPT
Javascript dom event
PPTX
WP7 HUB_Consuming Data Services
DOCX
Bobcat Exchange Program
PPTX
Building Your First App with MongoDB Stitch
PPTX
Mailing, the developer's eye view
PDF
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
PDF
1 24 - user data management
DOCX
Asp.docx(.net --3 year) programming
Javascript dom event
WP7 HUB_Consuming Data Services
Bobcat Exchange Program
Building Your First App with MongoDB Stitch
Mailing, the developer's eye view
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
1 24 - user data management
Asp.docx(.net --3 year) programming

What's hot (6)

PPTX
Event In JavaScript
PPTX
Advanced Jquery
PPTX
Introduction to Jquery
PDF
Webinar: User Data Management with MongoDB
PPTX
Presentation
PPT
Web Performance Tips
Event In JavaScript
Advanced Jquery
Introduction to Jquery
Webinar: User Data Management with MongoDB
Presentation
Web Performance Tips
Ad

Similar to Serverless Application Development with MongoDB Stitch (20)

PPTX
Tutorial: Building Your First App with MongoDB Stitch
PPTX
European SharePoint Conference 2018 - Build an intelligent application by con...
PPTX
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
PPTX
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
PDF
Evolving your Data Access with MongoDB Stitch
PPTX
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
PPTX
SharePoint Conference 2018 - Build an intelligent application by connecting i...
PPTX
MongoDB Stitch Introduction
PPTX
Mobile services on windows azure (part3)
PDF
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
PDF
Windows Azure: Connecting the Dots for a Mobile Workforce
PPTX
MongoDB.local Atlanta: Introduction to Serverless MongoDB
PDF
Life on Clouds: a forensics overview
PPTX
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
PPTX
MongoDB Stich Overview
PDF
MongoDB World 2019: Securing Application Data from Day One
PDF
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
PPTX
Identifying Users Across Platforms with a Universal ID Webinar Slides
PDF
JavaOne Brasil 2016: JavaEE e HTML5: da web/desktop ao mobile
PPTX
Get started with building native mobile apps interacting with SharePoint
Tutorial: Building Your First App with MongoDB Stitch
European SharePoint Conference 2018 - Build an intelligent application by con...
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
SharePoint Conference 2018 - Build an intelligent application by connecting i...
MongoDB Stitch Introduction
Mobile services on windows azure (part3)
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Windows Azure: Connecting the Dots for a Mobile Workforce
MongoDB.local Atlanta: Introduction to Serverless MongoDB
Life on Clouds: a forensics overview
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
MongoDB Stich Overview
MongoDB World 2019: Securing Application Data from Day One
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Identifying Users Across Platforms with a Universal ID Webinar Slides
JavaOne Brasil 2016: JavaEE e HTML5: da web/desktop ao mobile
Get started with building native mobile apps interacting with SharePoint
Ad

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
KodekX | Application Modernization Development
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
20250228 LYD VKU AI Blended-Learning.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Review of recent advances in non-invasive hemoglobin estimation
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
“AI and Expert System Decision Support & Business Intelligence Systems”
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Network Security Unit 5.pdf for BCA BBA.

Serverless Application Development with MongoDB Stitch