Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Serverless Application Development with MongoDB Stitch

1,384 views

Published on

Michael Lynn, Global Director of Developer Relations at MongoDB presents a talk focusing on MongoDB: The Server, Atlas: The Database as a Service, and Stitch: Backend as a Service

Published in: Technology
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Serverless Application Development with MongoDB Stitch

  1. 1. Introduction to MongoDB and Serverless App Development with MongoDB Stitch Michael Lynn Worldwide Director of Developer Relations
  2. 2. @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?
  3. 3. @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?
  4. 4. @mlynn My first app… 1993
  5. 5. @mlynn My first app… 1993
  6. 6. @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
  7. 7. @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
  8. 8. @mlynn MongoDB Server 10gen MongoDB
  9. 9. @mlynn MongoDB Atlas - Database as a Service
  10. 10. @mlynn ● Deploy ● Manage ● Scale ● Backup ● Distribute
  11. 11. @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
  12. 12. @mlynn Stitch Overview MongoDB Query Language + Native DriversIntegrated Rules Functions3rd Party Services Native SDKs (JavaScript, Android, iOS) Rest API
  13. 13. @mlynn Stitch Overview MongoDB Query Language + Native DriversIntegrated Rules Functions3rd Party Services Native SDKs (JavaScript, Android, iOS) Rest API
  14. 14. Simplify the Boring Stuff Why Use Stitch?
  15. 15. Security Matters Why Use Stitch?
  16. 16. Code Wins Arguments Why Use Stitch?
  17. 17. @mlynn Stitch User Accounts Authentication Providers
  18. 18. @mlynn Authentication Providers Continue as Guest
  19. 19. @mlynn Continue as Guest
  20. 20. @mlynn
  21. 21. @mlynn
  22. 22. @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;
  23. 23. @mlynn { "id": "xx", "name": "xx", "given_name": "xx", "family_name": "xx", "link": "xx", "picture": "xx", "gender": "xx", "locale": "xx" } context.users
  24. 24. @mlynn Write Data MongoDB Service
  25. 25. @mlynn
  26. 26. @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” });
  27. 27. @mlynn Word of the day Idiomatic
  28. 28. @mlynn Granular, Field Level Access Control MongoDB Rules
  29. 29. @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
  30. 30. @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
  31. 31. @mlynn Third Party Services - Email, for Example Stitch Functions & Services
  32. 32. @mlynn
  33. 33. @mlynn
  34. 34. @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”] );
  35. 35. @mlynn Notify Users Automatically MongoDB Triggers
  36. 36. @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
  37. 37. @mlynn https://hacktoberfest.digitalocean.com/
  38. 38. @mlynn Vue.js Example: https://github.com/mrlynn/mongodb-stitch-vue-example http://bit.ly/nyccodecamp2018
  39. 39. @mlynn My goals for today What is MongoDB Stitch - MongoDB Stitch is Serverless, Backend as a Server - Functions - Rules - Service Integrations
  40. 40. @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
  41. 41. @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.
  42. 42. @mlynn My goals for today What’s Michael’s twitter handle? @mlynn
  43. 43. @mlynn My goals for today What authentication providers does MongoDB Stitch Support? ● Anonymous ● Email ● Facebook ● Google ● API Keys ● Custom
  44. 44. @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.
  45. 45. @mlynn Thank You!
  46. 46. @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
  47. 47. @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

×