7. #MDBlocal
How requests work…
1. Application request is made
2. Stitch parses and applies rules
3. Stitch orchestrates DB + Services
3
3
8. #MDBlocal
How requests work…
1. Application request is made
2. Stitch parses and applies rules
3. Stitch orchestrates DB + Services
4. Stitch aggregates and applies rules
4
9. #MDBlocal
How requests work…
1. Application request is made
2. Stitch parses and applies rules
3. Stitch orchestrates DB + Services
4. Stitch aggregates and applies rules
5. Client receives results 5
16. client.executeFunction('sendWeather', 'Seattle');
MongoDB Services Functions
Stitch Concepts
//Function sendweather
exports = function(city) {
var mongodb = context.services.get("mongodb-atlas");
var UserColl = mongodb.db("StitchDemo").collection("Users");
var twilio = context.services.get("twilio");
var weather = context.services.get("weatherAPI");
var users = UserColl.find({"city": city});
var forecast = weather.get({context.values.get("weatherURL") + city});
var statuses = [];
for(var i in users){
statuses.push(twilio.send(context.values.get("twilioPhone")), users[i].Phone, forecast);
}
return statuses;
}
17. #MDBlocal
• Control DB/Service/Function access
• Fine-grained data access controls
• Define with simple JSON or link to
functions
• Associate with user profile, MDB Data,
or external info
Declarative Access Controls
18. #MDBlocal
Atlas
Customer Account Data
{
"owner_id": … ,
"balance": … ,
"transactions": {…},
"user_profile": {….}
}Bank
Teller
Analys
t
Custome
r
Roles,Permissions,andSecurity
Application
Reporting Data Mart
User Profile:
“I need to access my account”
Role Based:
“I need to lookup transactions
without seeing personal information”
Aggregate Only:
“I need to understand the bank’s total
cash flow”
26. #MDBlocal
Add Features
• Take your app to a
new platform
• Build a better
permissions
system or a
separate admin
portal
• Add additional
authentication
providers
Expose Data
• Provide an API for
safe, internal data
access
• Build more precise
permissions
system
• Create a real-time
dashboard with
authentication and
security built-in
Integrate Services
• Integrate with any
service or API with
minimal code
• Consume/action on
data in real time
with webhooks
• Communicate with
data using text,
e-mail, etc.
Complete
Backend
• Build faster without
boilerplate code
• Easily span multiple
platforms
• Scale at a moments
notice
• Single, simplified
point to manage
infrastructure/logic
27. #MDBlocal
• $1 per GB of data transferred from Stitch to client/service
• 25 GB Free per month
• Data transfer to Atlas is free
Pricing
29. #MDBlocal
• Check out our hands-on lab: 12:50PM in the Sound Room
• Try out Stitch – stitch.mongodb.com
• Check out SDKs and examples
• Code at github.com/MongodbStitch
• Docs at docs.mongodb.com/stitch
• Build the Dashboard or Weather IoT apps in our Tutorials section
• Ask Questions or let us know what you’re building through Intercom
What Now?