SlideShare ist ein Scribd-Unternehmen logo
1 von 22
UNTANGLING THE WEB
FALL 2017 WEEK 8 – PROJECT 2, DEEPER INTO DATABASES, ASYNCHRONOUS
JAVASCRIPT, NOTES ABOUT NODE
AGENDA
• Project 2 presentations
• Asynchronous javascript
• Promises
• Async/await
• Databases – SQL vs. NoSQL
• Looking more at NodeJS
• Routes and views
• How to render to the client
• A more detailed look at Cloudant programming
• Getting ready for project 3
PROJECT 2 PRESENTATIONS
• Keep it under 5 minutes
• Show off all the functionality in your front end
• Talk about the business model, including value proposition (pains and gains)
• Make sure you have emailed me
• A link to github
• A link to the running website
• SEO, business model canvas, value proposition canvas links
REVIEW OF FUNCTIONS
• A block of named code able to be called from other places
• Variables in js are untyped, so they can hold function references
• Parameters to a function can also be functions
• Anonymous function – a function that is not given a name but is rather just passed to another function
A FEW UTILITY FUNCTIONS WE’LL RUN INTO TODAY
• setTimeout(function, delay in ms) – delay and then call a function
• Math.random – generate a random number
• Math.ceil – round up
ASYNCHRONOUS JAVASCRIPT
• What’s a callback? You’ve used them before! In the maps example
• What’s a promise?
• What’s a promise chain?
• Anyone come across async/await?
CALLBACK EXAMPLE
• https://jsfiddle.net/3cew460a/
• https://www.youtube.com/watch?v=QqiNn3GfTMc
PROMISE EXAMPLE
• https://jsfiddle.net/s3m4xv1o/
• https://www.youtube.com/watch?v=VmMDG6h-bVQ
PROMISE CHAINING EXAMPLE
• https://jsfiddle.net/8Lf4zof3/
• https://www.youtube.com/watch?v=a1cTkiNuEwM
ASYNC/AWAIT
• It is an ES7 feature, so will have to use babel as a transpiler if we want to use it
• https://www.youtube.com/watch?v=COKdtOgopWQ
DATABASES
• SQL versus noSQL
• Flavours of SQL and noSQL
• Why use a database at all?
• Advanced database topics
• Schema design
• Replication
• Transactions
SQL VERSUS NOSQL
• SQL – Structured Query Language
• Relational database
• Use when you need multiple tables and
when you need to construct queries that
span those tables
• More functional than flat databases, but
also slower and more complex
• Can exist in either client or server
flavours
 NoSQL databases – anything that isn’t relational!
 MongoDB is a popular server-based flavor
 Redis is a local memory-mapped flavor
 Cloudant, couchDB, etc. there are many, many
types
 All are good for rapid, flat table access
 Avoid the complexities of relational databases
while still preserving the benefits
LOCAL SQL EXAMPLE – CARS DATABASE
• https://jsfiddle.net/m5rh3a83/1/
• (for more details see here: https://www.tutorialspoint.com/html5/html5_web_sql.htm)
MORE REALISTIC SQL EXAMPLE
• http://sqlfiddle.com/#!9/1d643/23
• (video help here: https://www.youtube.com/watch?v=DDVOMRvyAS4)
SQLZOO
• http://sqlzoo.net/
• Go do some exercises!
• (https://www.sqlteaching.com is an alternative if you want some more exercises)
MULTIPLE TABLES
• You will usually have more than one table
• If you have only one table, it is time to consider a NoSQL database
• Look on SQLZoo for the JOINS sections and make sense of that
• http://sqlzoo.net/wiki/The_JOIN_operation
• If you want more complex examples on a real database you can play here:
• http://data.stackexchange.com/stackoverflow/queries
• More about joins
• https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
POSTGRESSQL ON BLUEMIX
• Here’s a decent started project: https://github.com/IBM-Bluemix/compose-postgresql-helloworld-
nodejs
FOR PROJECT 3
• You’ll have to decide whether to use a flat database, like the cloudant example we walked through last
week, or a relational database like postgresSQL
• How do you make that decision?
• Complexity of your data
• Performance requirements
• Development difficulty
NODEJS
• We’ll look through:
• Package.json (review)
• App.js (the webserver)
• Routes and views
CONCEPTS (ALSO TO BE COVERED IN MORE DETAIL
NEXT WEEK)
• JSON and how to parse it
• http get, put, post, delete, etc. (reminder about CRUD pattern)
• Nodejs
• Require statement
• App.js
HOMEWORK 8 (DUE START OF CLASS NOV 1ST)
• Submit a github link with a file containing the query and results for each question
• Using the stackoverflow database here: http://data.stackexchange.com/stackoverflow/queries
• List the oldest 10 Victoria, BC users and order them by age.
• List the top 10 highest reputation users in Victoria that have answered questions with the tag javascript.
• List the top 5 Victoria developers by accepted answer percentage
• List the top 10 Victoria developers by accepted answer percentage on questions with the tag javascript
PROJECT 3
• If anyone needs to change groups get it figured out this week
• You’ll need to implement a database backend for your project and a chatbot
• Database should have new item, search, and delete (optionally edit) from the ui
• You’ll need to host your project on bluemix
• You’ll need to show a working demo of project 2 hooked up to these backend services

Weitere ähnliche Inhalte

Was ist angesagt?

Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6Derek Jacoby
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEODerek Jacoby
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5Derek Jacoby
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9Derek Jacoby
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 
Untangling spring week4
Untangling spring week4Untangling spring week4
Untangling spring week4Derek Jacoby
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8Derek Jacoby
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2Derek Jacoby
 
Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...Frank van der Linden
 
Modern javascript
Modern javascriptModern javascript
Modern javascriptKevin Ball
 
Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4Derek Jacoby
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6Derek Jacoby
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?Weng Wei
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Paul Withers
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeRadosław Scheibinger
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksFITC
 
Engage 2019 Software documentation is fun if you have the right tools: Introd...
Engage 2019 Software documentation is fun if you have the right tools: Introd...Engage 2019 Software documentation is fun if you have the right tools: Introd...
Engage 2019 Software documentation is fun if you have the right tools: Introd...AndrewMagerman
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemFITC
 
A Personal Journey
A Personal JourneyA Personal Journey
A Personal JourneyMichael Lihs
 

Was ist angesagt? (20)

Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEO
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Untangling spring week4
Untangling spring week4Untangling spring week4
Untangling spring week4
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2
 
Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...
 
Modern javascript
Modern javascriptModern javascript
Modern javascript
 
Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
 
Engage 2019 Software documentation is fun if you have the right tools: Introd...
Engage 2019 Software documentation is fun if you have the right tools: Introd...Engage 2019 Software documentation is fun if you have the right tools: Introd...
Engage 2019 Software documentation is fun if you have the right tools: Introd...
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
 
A Personal Journey
A Personal JourneyA Personal Journey
A Personal Journey
 

Ähnlich wie Untangling - fall2017 - week 8

NoSql Data Management
NoSql Data ManagementNoSql Data Management
NoSql Data Managementsameerfaizan
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseBrant Burnett
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Lucas Jellema
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseEric Bragas
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the DatabaseMichaela Murray
 
Urbanesia - Development History
Urbanesia - Development HistoryUrbanesia - Development History
Urbanesia - Development HistoryBatista Harahap
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Wen-Tien Chang
 
Javascript on Server-Side
Javascript on Server-SideJavascript on Server-Side
Javascript on Server-SideASIMYILDIZ
 
NoSQL on the move
NoSQL on the moveNoSQL on the move
NoSQL on the moveCodemotion
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBAhmed Farag
 
Introducción a NoSQL
Introducción a NoSQLIntroducción a NoSQL
Introducción a NoSQLMongoDB
 
Introduction to Cosmos DB Presentation.pptx
Introduction to Cosmos DB Presentation.pptxIntroduction to Cosmos DB Presentation.pptx
Introduction to Cosmos DB Presentation.pptxKnoldus Inc.
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesKyle Banerjee
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS Ganesh Kondal
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQLbalwinders
 

Ähnlich wie Untangling - fall2017 - week 8 (20)

NoSql Data Management
NoSql Data ManagementNoSql Data Management
NoSql Data Management
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using Couchbase
 
mongodb_DS.pptx
mongodb_DS.pptxmongodb_DS.pptx
mongodb_DS.pptx
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
NoSQL and MongoDB
NoSQL and MongoDBNoSQL and MongoDB
NoSQL and MongoDB
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Urbanesia - Development History
Urbanesia - Development HistoryUrbanesia - Development History
Urbanesia - Development History
 
Oracle application container cloud back end integration using node final
Oracle application container cloud back end integration using node finalOracle application container cloud back end integration using node final
Oracle application container cloud back end integration using node final
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
 
Javascript on Server-Side
Javascript on Server-SideJavascript on Server-Side
Javascript on Server-Side
 
NoSQL on the move
NoSQL on the moveNoSQL on the move
NoSQL on the move
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
 
Introducción a NoSQL
Introducción a NoSQLIntroducción a NoSQL
Introducción a NoSQL
 
Introduction to Cosmos DB Presentation.pptx
Introduction to Cosmos DB Presentation.pptxIntroduction to Cosmos DB Presentation.pptx
Introduction to Cosmos DB Presentation.pptx
 
NoSQL
NoSQLNoSQL
NoSQL
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 

Mehr von Derek Jacoby

Untangling - fall2017 - week5
Untangling - fall2017 - week5Untangling - fall2017 - week5
Untangling - fall2017 - week5Derek Jacoby
 
Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Derek Jacoby
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7Derek Jacoby
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3Derek Jacoby
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1Derek Jacoby
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10Derek Jacoby
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9Derek Jacoby
 

Mehr von Derek Jacoby (12)

Untangling - fall2017 - week5
Untangling - fall2017 - week5Untangling - fall2017 - week5
Untangling - fall2017 - week5
 
Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
 
Untangling8
Untangling8Untangling8
Untangling8
 
Untangling7
Untangling7Untangling7
Untangling7
 
Untangling6
Untangling6Untangling6
Untangling6
 
Untangling4
Untangling4Untangling4
Untangling4
 

Kürzlich hochgeladen

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 

Kürzlich hochgeladen (20)

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

Untangling - fall2017 - week 8

  • 1. UNTANGLING THE WEB FALL 2017 WEEK 8 – PROJECT 2, DEEPER INTO DATABASES, ASYNCHRONOUS JAVASCRIPT, NOTES ABOUT NODE
  • 2. AGENDA • Project 2 presentations • Asynchronous javascript • Promises • Async/await • Databases – SQL vs. NoSQL • Looking more at NodeJS • Routes and views • How to render to the client • A more detailed look at Cloudant programming • Getting ready for project 3
  • 3. PROJECT 2 PRESENTATIONS • Keep it under 5 minutes • Show off all the functionality in your front end • Talk about the business model, including value proposition (pains and gains) • Make sure you have emailed me • A link to github • A link to the running website • SEO, business model canvas, value proposition canvas links
  • 4. REVIEW OF FUNCTIONS • A block of named code able to be called from other places • Variables in js are untyped, so they can hold function references • Parameters to a function can also be functions • Anonymous function – a function that is not given a name but is rather just passed to another function
  • 5. A FEW UTILITY FUNCTIONS WE’LL RUN INTO TODAY • setTimeout(function, delay in ms) – delay and then call a function • Math.random – generate a random number • Math.ceil – round up
  • 6. ASYNCHRONOUS JAVASCRIPT • What’s a callback? You’ve used them before! In the maps example • What’s a promise? • What’s a promise chain? • Anyone come across async/await?
  • 7. CALLBACK EXAMPLE • https://jsfiddle.net/3cew460a/ • https://www.youtube.com/watch?v=QqiNn3GfTMc
  • 8. PROMISE EXAMPLE • https://jsfiddle.net/s3m4xv1o/ • https://www.youtube.com/watch?v=VmMDG6h-bVQ
  • 9. PROMISE CHAINING EXAMPLE • https://jsfiddle.net/8Lf4zof3/ • https://www.youtube.com/watch?v=a1cTkiNuEwM
  • 10. ASYNC/AWAIT • It is an ES7 feature, so will have to use babel as a transpiler if we want to use it • https://www.youtube.com/watch?v=COKdtOgopWQ
  • 11. DATABASES • SQL versus noSQL • Flavours of SQL and noSQL • Why use a database at all? • Advanced database topics • Schema design • Replication • Transactions
  • 12. SQL VERSUS NOSQL • SQL – Structured Query Language • Relational database • Use when you need multiple tables and when you need to construct queries that span those tables • More functional than flat databases, but also slower and more complex • Can exist in either client or server flavours  NoSQL databases – anything that isn’t relational!  MongoDB is a popular server-based flavor  Redis is a local memory-mapped flavor  Cloudant, couchDB, etc. there are many, many types  All are good for rapid, flat table access  Avoid the complexities of relational databases while still preserving the benefits
  • 13. LOCAL SQL EXAMPLE – CARS DATABASE • https://jsfiddle.net/m5rh3a83/1/ • (for more details see here: https://www.tutorialspoint.com/html5/html5_web_sql.htm)
  • 14. MORE REALISTIC SQL EXAMPLE • http://sqlfiddle.com/#!9/1d643/23 • (video help here: https://www.youtube.com/watch?v=DDVOMRvyAS4)
  • 15. SQLZOO • http://sqlzoo.net/ • Go do some exercises! • (https://www.sqlteaching.com is an alternative if you want some more exercises)
  • 16. MULTIPLE TABLES • You will usually have more than one table • If you have only one table, it is time to consider a NoSQL database • Look on SQLZoo for the JOINS sections and make sense of that • http://sqlzoo.net/wiki/The_JOIN_operation • If you want more complex examples on a real database you can play here: • http://data.stackexchange.com/stackoverflow/queries • More about joins • https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
  • 17. POSTGRESSQL ON BLUEMIX • Here’s a decent started project: https://github.com/IBM-Bluemix/compose-postgresql-helloworld- nodejs
  • 18. FOR PROJECT 3 • You’ll have to decide whether to use a flat database, like the cloudant example we walked through last week, or a relational database like postgresSQL • How do you make that decision? • Complexity of your data • Performance requirements • Development difficulty
  • 19. NODEJS • We’ll look through: • Package.json (review) • App.js (the webserver) • Routes and views
  • 20. CONCEPTS (ALSO TO BE COVERED IN MORE DETAIL NEXT WEEK) • JSON and how to parse it • http get, put, post, delete, etc. (reminder about CRUD pattern) • Nodejs • Require statement • App.js
  • 21. HOMEWORK 8 (DUE START OF CLASS NOV 1ST) • Submit a github link with a file containing the query and results for each question • Using the stackoverflow database here: http://data.stackexchange.com/stackoverflow/queries • List the oldest 10 Victoria, BC users and order them by age. • List the top 10 highest reputation users in Victoria that have answered questions with the tag javascript. • List the top 5 Victoria developers by accepted answer percentage • List the top 10 Victoria developers by accepted answer percentage on questions with the tag javascript
  • 22. PROJECT 3 • If anyone needs to change groups get it figured out this week • You’ll need to implement a database backend for your project and a chatbot • Database should have new item, search, and delete (optionally edit) from the ui • You’ll need to host your project on bluemix • You’ll need to show a working demo of project 2 hooked up to these backend services