Содержание
- 2. SQL vs NoSQL MongoDB Mongoose Authentication Passport.js AGENDA OF THE LECTURE
- 3. NOSQL SQL VS
- 4. RELATIONAL DATABASE PROBLEMS Scalability Flexibility NoSQL databases solve these problems
- 5. NOSQL DATABASE PROBLEMS No join No data integrity No transaction
- 6. WHERE SQL IS IDEAL logical related discrete data requirements which can be identified up-front data integrity
- 7. WHERE NOSQL IS IDEAL unrelated, indeterminate or evolving data requirements simpler or looser project objectives, able
- 8. MONGODB
- 9. MONGODB MongoDB is an open source, document-oriented database designed with both scalability and developer agility in
- 10. MONGODB COMPRASION TO SQL
- 11. MOGNODB CLI DEMO
- 12. MONGODB CLI show dbs use show collections help / db.help() /db.collection.help()
- 13. MONGODB CLI CRUD db.collection.insert(document) db.collection.find(query, projection) db.collection.update(query, update, options) db.collection.remove(query, options)
- 14. MONGODB DRIVERS An application communicates with MongoDB by way of a client library, called a driver,
- 15. MOGNODB NATIVE DRIVER DEMO
- 16. ORM, ODM ORM (Object-Relational Mapping), ODM (Object Document Mapper) - programming technique for converting data between
- 17. MONGOOSE
- 18. MONGOOSE Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type
- 19. MONGOOSE DEMO
- 20. MONGOOSE API mongoose.connect(url, options) mongoose.Promise mongoose.Schema mongoose.model(name, schema) mongoose.plugin(func, options)
- 21. SCHEMA API const schema = new Schema(definition, options) schema.methods schema.statics schema.virtual(name, options) schema.pre/post(method, callback) schema.plugin(func, options)
- 22. SCHEMA DEFINITION type required default unique validate lowercase uppercase trim match enum min max String Number/Date
- 23. AUTHENTICATION
- 24. AUTHENTICATION Authentication - is the process of actually confirming truth identity. Authorization - is the function
- 25. HTTP Forms One-Time Password(two-factor authentication) API key Token-based AUTHENTICATION METHODS
- 26. User Requests Access with Username / Password Application validates credentials Application provides a signed token to
- 27. SWT JWT SAML TOKEN-BASED AUTHENTICATION OAuth OpenID Connect SAML WS-Federation Token formats: Standards:
- 28. PASSPORT.JS
- 29. PASSPORT Passport is Express-compatible authentication middleware for Node.js. Passport's sole purpose is to authenticate requests, which
- 30. PASSPORT MAIN CONCEPTS Strategies Sessions Middleware
- 31. PASSPORT API passport.initialize / session() passport.use() passport.serializeUser / deserializeUser() passport.authenticate() req.login / logout()
- 32. PASSPORT.JS DEMO
- 34. Скачать презентацию