SlideShare a Scribd company logo
By
       Jorge Garifuna
Professional Web Developer
   info@GariDigital.com
        213-915-4402

    JGari.com/resume

   Twitter: @jgarifuna
SMS your Name and Email to:


       213-985-4413
SMS your name & email to: 213-985-4413   JGari.com/resume
1. A Database that stores data (documents)
2. A NoSQL Database
     1. NoSQL = Not only SQL
3.    Uses JSON for interaction
     1. JSON = JavaScript Object Notation
4.    Managed by 10gen company



     SMS your name & email to: 213-985-4413   JGari.com/resume
1.    Scalable
2.    High performance
3.    Open source
4.    Written in C++
5.    Humongous 




     SMS your name & email to: 213-985-4413   JGari.com/resume
1.   Document-Oriented Storage
2.   Full Index Support
3.   Replication & High Availability: Mirror across
     LAN/WAN
4.   Auto-Sharding: Scale horizontally
5.   Map/Reduce: aggregation & data processing
6.   GridFS: Stire files of any size


      SMS your name & email to: 213-985-4413   JGari.com/resume
1. A Relational Database
2. Ideal for every scenario




     SMS your name & email to: 213-985-4413   JGari.com/resume
1. Not a Relational Database (RDBMS)
2. Not ideal for every scenario




     SMS your name & email to: 213-985-4413   JGari.com/resume
Relational Database Table/Records              MongoDB Collection/Documents

 id     firstName   lastName    age            id: 1
                                               firstName: Jorge
                                               lastName: Garifuna
 1      Jorge       Garifuna    85             age: 85
                                               id: 2
 2      Jimmy       Smith       30             firstName: Jimmy
                                               lastName: Smith
                                               age: 30

                                               id: 3
                                               firstName: Alan
                                               lastName: Jones
                                               age: 25
                                               city: Los Angeles
                                               state: CA
      SMS your name & email to: 213-985-4413                  JGari.com/resume
1. I dig alpha products
2. Beta products are my cut of tea
3. I only consider stable products




SMS your name & email to: 213-985-4413   JGari.com/resume
Credit: Sanjeev Mishra




SMS your name & email to: 213-985-4413    JGari.com/resume
1. When you need flexibility in your data
2. When you want to easily scale
3. When your dataset does not have zillions
   of joins




SMS your name & email to: 213-985-4413   JGari.com/resume
MySQL executable                     Oracle executable                     Mongo executable
mysqld                               oracle                                mongod
mysql                                sqlplus                               mongo
MySQL term                                               Mongo term/concept
database                                                 database
table                                                    collection
index                                                    index
row                                                      BSON document
column                                                   BSON field
join                                                     embedding and linking
primary key                                              _id field
group by                                                 aggregation




 Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart


       SMS your name & email to: 213-985-4413                                             JGari.com/resume
1.     Download from
     1. http://www.mongodb.org/downloads
2.     Unzip package
3.     Run the following from terminal
     1. sudo mkdir -p /data/db
     2. sudo chown `id -u` /data/db
4.     Add to path
     1. Mac example: export PATH=/Users/jgarifuna/jg/net/Dev/db/mongodb-osx-x86_64-
          2.2.1-rc0/bin:$PATH

     2. Linux example: PATH=/home/jgarifuna/mongo-linux-2.2.1/bin:$PATH

     SMS your name & email to: 213-985-4413                                 JGari.com/resume
1.    If added to path in command line type
     1. mongod
2.    If not on path
     1. Access the bin folder on mongo folder
     2. Type: ./mongod




SMS your name & email to: 213-985-4413          JGari.com/resume
1.    If added to path in command line type
     1. mongo
2.    If not on path
     1. Access the bin folder on mongo folder
     2. Type: ./mongo




SMS your name & email to: 213-985-4413          JGari.com/resume
1. Databases are created automatically
2. Tables are created automatically
3. Primary key is created automatically




SMS your name & email to: 213-985-4413   JGari.com/resume
SQL Statement                           Mongo Statement
   INSERT INTO USERS VALUES(3,5)           db.users.insert({a:3,b:5})


   SELECT * FROM users                     db.users.find()


   UPDATE users SET a=1 WHERE              db.users.update({b:'q'}, {$set:{a:1}}, false,
   b='q'                                   true)


   DELETE FROM users WHERE                 db.users.remove({z:'abc'});
   z="abc"




Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart


  SMS your name & email to: 213-985-4413                                       JGari.com/resume
SQL Statement                                         Mongo Statement
   INSERT INTO USERS VALUES(3,5)                         db.users.insert({a:3,b:5})




Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart


  SMS your name & email to: 213-985-4413                                         JGari.com/resume
SQL Statement                                Mongo Statement
  SELECT a,b FROM users                        db.users.find({}, {a:1,b:1})
  SELECT * FROM users                          db.users.find()
  SELECT * FROM users WHERE age=33             db.users.find({age:33})
  SELECT a,b FROM users WHERE age=33           db.users.find({age:33}, {a:1,b:1})
  SELECT * FROM users WHERE age=33             db.users.find({age:33}).sort({name:1})
  ORDER BY name
  SELECT * FROM users WHERE age>33             db.users.find({age:{$gt:33}})
  SELECT * FROM users WHERE age!=33            db.users.find({age:{$ne:33}})
  SELECT * FROM users WHERE age>33             db.users.find({'age':{$gt:33,$lte:40}})
  AND age<=40
  SELECT * FROM users ORDER BY name            db.users.find().sort({name:-1})
  DESC
  SELECT COUNT(*y) FROM users where            db.users.find({age: {'$gt': 30}}).count()
  AGE > 30
  SELECT COUNT(AGE) from users                 db.users.find({age: {'$exists':
                                               true}}).count()


Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart


  SMS your name & email to: 213-985-4413                                         JGari.com/resume
SQL Statement                            Mongo Statement
   UPDATE users SET a=1 WHERE               db.users.update({b:'q'}, {$set:{a:1}}, false,
   b='q'                                    true)
   UPDATE users SET a=a+2 WHERE             db.users.update({b:'q'}, {$inc:{a:2}}, false,
   b='q'                                    true)




Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart


  SMS your name & email to: 213-985-4413                                       JGari.com/resume
SQL Statement                                          Mongo Statement
   DELETE FROM users WHERE z="abc"                        db.users.remove({z:'abc'});




Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart


  SMS your name & email to: 213-985-4413                                          JGari.com/resume
SMS your name & email to: 213-985-4413   JGari.com/resume
Source: http://www.mongodb.org/display/DOCS/Replica+Sets

SMS your name & email to: 213-985-4413                     JGari.com/resume
 On each mongodb instance start service with:
         mongod --rest --replSet myset




Source: http://www.mongodb.org/display/DOCS/Replica+Sets+-+Basics

      SMS your name & email to: 213-985-4413                        JGari.com/resume
 Connect to primary server:
         mongo --host PRIMARY_IP_OR_NAME
     Initialize replica set
         rs.initiate()
     Add secondary node to replica set
         rs.add(‘FIRST_SERVER_NAME_OR_IP’)
     Add arbiter node to replica set
         rs.addArb(‘ARB_SERVER_NAME_OR_IP’)
Source: http://www.mongodb.org/display/DOCS/Replica+Sets+-+Basics

      SMS your name & email to: 213-985-4413                        JGari.com/resume
 Connect to primary server:
         mongo --host PRIMARY_IP_OR_NAME
     Add a document
         db.foo.save({name: “Jorge Garifuna”})
     Set secondary to slave (otherwise you wont be able to see data)
         rs.slaveOk()
     Query secondary
         db.foo.find()
Source: http://www.mongodb.org/display/DOCS/Replica+Sets+-+Basics

      SMS your name & email to: 213-985-4413                        JGari.com/resume
Some Node JS stuff


SMS your name & email to: 213-985-4413   JGari.com/resume
 Platform built on Google Chrome’s JavaScript
  Runtime
 For building fast, scalable network applications
 Substitute for Apache/PHP
   But you create your own server code




   SMS your name & email to: 213-985-4413   JGari.com/resume
 Download from
   nodejs.org
 Run installation




   SMS your name & email to: 213-985-4413   JGari.com/resume
var http = require('http');
      http.createServer(function (req, res) {
       res.writeHead(200, {'Content-Type': 'text/plain'});
       res.end('Hello Worldn');
      }).listen(1337, '127.0.0.1');
      console.log('Server running at http://127.0.0.1:1337/');


1.    Create new folder
2.    Create testserver.js file and place within folder
3.    Run node
     1. Node testserver.js
4.    On browser go to: http://127.0.0.1:1337
      SMS your name & email to: 213-985-4413                     JGari.com/resume
1. A Node JS Application Framework
2. Uses MVC (model, view, controller) pattern




     SMS your name & email to: 213-985-4413   JGari.com/resume
1.    From the command line run Node Package
      Manager
     1. sudo npm install -g express




       SMS your name & email to: 213-985-4413   JGari.com/resume
1.    From the command line run
     1. Express ./YOUR_APP_NAME
2.    Change into your new app folder
     1. cd ./YOUR_APP_NAME
3.    Install depedencies
     1. npm install -d




       SMS your name & email to: 213-985-4413   JGari.com/resume
1.    Change into your new app folder
     1. cd ./YOUR_APP_NAME
2.    Run app with node
     1. node app
3.    On browser go to URL:
     1. http://localhost:3000




       SMS your name & email to: 213-985-4413   JGari.com/resume
1.    Change into your new app folder
     1. cd ./YOUR_APP_NAME
2.    Run app with node
     1. node app
3.    On browser go to URL:
     1. http://localhost:3000




       SMS your name & email to: 213-985-4413   JGari.com/resume
1.    Download workout web api from
     1. https://github.com/donnfelker/workout-tracker
2.    Checkout Develop a RESTful API Using Node.js
      With Express and Mongoose
     1. http://pixelhandler.com/blog/2012/02/09/develop-a-
        restful-api-using-node-js-with-express-and-
        mongoose/


       SMS your name & email to: 213-985-4413    JGari.com/resume
 While you think…
  Sign up to LAMPsig’s mailing list at:
   ▪ http://lampsig.org


  Join LAMPsig on Meetup at:
   ▪ http://www.meetup.com/LAMPsig


  Jorge Garifuna
   ▪ info@GariDigital.com
   ▪ @jgarifuna
SMS your name & email to: 213-985-4413     JGari.com/resume
1.     http://www.mongodb.org
2.     http://nodejs.org
3.     http://expressjs.com
4.     http://pixelhandler.com/blog/2012/02/09/dev
       elop-a-restful-api-using-node-js-with-
       express-and-mongoose
5.     http://lampsig.org
6.     http://www.meetup.com/LAMPsig

     SMS your name & email to: 213-985-4413   JGari.com/resume

More Related Content

Similar to A practical intro to web development with mongo db and nodejs when, why and how

MongoDB
MongoDBMongoDB
MongoDB
techwhizbang
 
Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01
Cevin Cheung
 
Mongo db basic installation
Mongo db basic installationMongo db basic installation
Mongo db basic installation
Kishor Parkhe
 
MongoDb In Action
MongoDb In ActionMongoDb In Action
MongoDb In Action
fuchaoqun
 
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?
Fabio Kung
 
A Brief MongoDB Intro
A Brief MongoDB IntroA Brief MongoDB Intro
A Brief MongoDB Intro
Scott Hernandez
 
Introduction to MongoDB at IGDTUW
Introduction to MongoDB at IGDTUWIntroduction to MongoDB at IGDTUW
Introduction to MongoDB at IGDTUW
Ankur Raina
 
MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.
Nurul Ferdous
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
Alberto Paro
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
Alberto Paro
 
Advanced MongoDB Aggregation Pipelines
Advanced MongoDB Aggregation PipelinesAdvanced MongoDB Aggregation Pipelines
Advanced MongoDB Aggregation Pipelines
Tom Schreiber
 
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation PipelinesMongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB
 
Awesome Tools 2017
Awesome Tools 2017Awesome Tools 2017
Awesome Tools 2017
Noel De Martin Fernandez
 
Schema design short
Schema design shortSchema design short
Schema design short
MongoDB
 
Superficial mongo db
Superficial mongo dbSuperficial mongo db
Superficial mongo db
DaeMyung Kang
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
ichikaway
 
MongoDB.local Austin 2018: Tutorial - User Administration Without You - Integ...
MongoDB.local Austin 2018: Tutorial - User Administration Without You - Integ...MongoDB.local Austin 2018: Tutorial - User Administration Without You - Integ...
MongoDB.local Austin 2018: Tutorial - User Administration Without You - Integ...
MongoDB
 
RedisConf18 - Redis Memory Optimization
RedisConf18 - Redis Memory OptimizationRedisConf18 - Redis Memory Optimization
RedisConf18 - Redis Memory Optimization
Redis Labs
 
Protocol buffers
Protocol buffersProtocol buffers
Protocol buffers
Fabricio Epaminondas
 
Deep dive to PostgreSQL Indexes
Deep dive to PostgreSQL IndexesDeep dive to PostgreSQL Indexes
Deep dive to PostgreSQL Indexes
Ibrar Ahmed
 

Similar to A practical intro to web development with mongo db and nodejs when, why and how (20)

MongoDB
MongoDBMongoDB
MongoDB
 
Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01
 
Mongo db basic installation
Mongo db basic installationMongo db basic installation
Mongo db basic installation
 
MongoDb In Action
MongoDb In ActionMongoDb In Action
MongoDb In Action
 
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?
 
A Brief MongoDB Intro
A Brief MongoDB IntroA Brief MongoDB Intro
A Brief MongoDB Intro
 
Introduction to MongoDB at IGDTUW
Introduction to MongoDB at IGDTUWIntroduction to MongoDB at IGDTUW
Introduction to MongoDB at IGDTUW
 
MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
 
Advanced MongoDB Aggregation Pipelines
Advanced MongoDB Aggregation PipelinesAdvanced MongoDB Aggregation Pipelines
Advanced MongoDB Aggregation Pipelines
 
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation PipelinesMongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
 
Awesome Tools 2017
Awesome Tools 2017Awesome Tools 2017
Awesome Tools 2017
 
Schema design short
Schema design shortSchema design short
Schema design short
 
Superficial mongo db
Superficial mongo dbSuperficial mongo db
Superficial mongo db
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
MongoDB.local Austin 2018: Tutorial - User Administration Without You - Integ...
MongoDB.local Austin 2018: Tutorial - User Administration Without You - Integ...MongoDB.local Austin 2018: Tutorial - User Administration Without You - Integ...
MongoDB.local Austin 2018: Tutorial - User Administration Without You - Integ...
 
RedisConf18 - Redis Memory Optimization
RedisConf18 - Redis Memory OptimizationRedisConf18 - Redis Memory Optimization
RedisConf18 - Redis Memory Optimization
 
Protocol buffers
Protocol buffersProtocol buffers
Protocol buffers
 
Deep dive to PostgreSQL Indexes
Deep dive to PostgreSQL IndexesDeep dive to PostgreSQL Indexes
Deep dive to PostgreSQL Indexes
 

More from jgarifuna

Joomla/Mambo CMS
Joomla/Mambo CMSJoomla/Mambo CMS
Joomla/Mambo CMS
jgarifuna
 
Joomla/Mambo CMS
Joomla/Mambo CMSJoomla/Mambo CMS
Joomla/Mambo CMS
jgarifuna
 
http://www.slideshare.net/jgarifuna/elgg-presentation-ca-032109
http://www.slideshare.net/jgarifuna/elgg-presentation-ca-032109http://www.slideshare.net/jgarifuna/elgg-presentation-ca-032109
http://www.slideshare.net/jgarifuna/elgg-presentation-ca-032109
jgarifuna
 
The Elgg Social Networking Framework
The Elgg Social Networking FrameworkThe Elgg Social Networking Framework
The Elgg Social Networking Framework
jgarifuna
 
Joomla Content Management Systems, Part 3
Joomla Content Management Systems, Part 3Joomla Content Management Systems, Part 3
Joomla Content Management Systems, Part 3
jgarifuna
 
Integrating LAMP with Mkahawa Cyber Manager & SQLite
Integrating LAMP with Mkahawa Cyber Manager & SQLiteIntegrating LAMP with Mkahawa Cyber Manager & SQLite
Integrating LAMP with Mkahawa Cyber Manager & SQLite
jgarifuna
 
Intro to Quick Web Application Builder (QWAB)
Intro to Quick Web Application Builder (QWAB)Intro to Quick Web Application Builder (QWAB)
Intro to Quick Web Application Builder (QWAB)
jgarifuna
 
Intro to mobile development with sencha touch
Intro to mobile development with sencha touchIntro to mobile development with sencha touch
Intro to mobile development with sencha touch
jgarifuna
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
jgarifuna
 

More from jgarifuna (9)

Joomla/Mambo CMS
Joomla/Mambo CMSJoomla/Mambo CMS
Joomla/Mambo CMS
 
Joomla/Mambo CMS
Joomla/Mambo CMSJoomla/Mambo CMS
Joomla/Mambo CMS
 
http://www.slideshare.net/jgarifuna/elgg-presentation-ca-032109
http://www.slideshare.net/jgarifuna/elgg-presentation-ca-032109http://www.slideshare.net/jgarifuna/elgg-presentation-ca-032109
http://www.slideshare.net/jgarifuna/elgg-presentation-ca-032109
 
The Elgg Social Networking Framework
The Elgg Social Networking FrameworkThe Elgg Social Networking Framework
The Elgg Social Networking Framework
 
Joomla Content Management Systems, Part 3
Joomla Content Management Systems, Part 3Joomla Content Management Systems, Part 3
Joomla Content Management Systems, Part 3
 
Integrating LAMP with Mkahawa Cyber Manager & SQLite
Integrating LAMP with Mkahawa Cyber Manager & SQLiteIntegrating LAMP with Mkahawa Cyber Manager & SQLite
Integrating LAMP with Mkahawa Cyber Manager & SQLite
 
Intro to Quick Web Application Builder (QWAB)
Intro to Quick Web Application Builder (QWAB)Intro to Quick Web Application Builder (QWAB)
Intro to Quick Web Application Builder (QWAB)
 
Intro to mobile development with sencha touch
Intro to mobile development with sencha touchIntro to mobile development with sencha touch
Intro to mobile development with sencha touch
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 

Recently uploaded

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

A practical intro to web development with mongo db and nodejs when, why and how

  • 1. By Jorge Garifuna Professional Web Developer info@GariDigital.com 213-915-4402 JGari.com/resume Twitter: @jgarifuna
  • 2. SMS your Name and Email to: 213-985-4413 SMS your name & email to: 213-985-4413 JGari.com/resume
  • 3. 1. A Database that stores data (documents) 2. A NoSQL Database 1. NoSQL = Not only SQL 3. Uses JSON for interaction 1. JSON = JavaScript Object Notation 4. Managed by 10gen company SMS your name & email to: 213-985-4413 JGari.com/resume
  • 4. 1. Scalable 2. High performance 3. Open source 4. Written in C++ 5. Humongous  SMS your name & email to: 213-985-4413 JGari.com/resume
  • 5. 1. Document-Oriented Storage 2. Full Index Support 3. Replication & High Availability: Mirror across LAN/WAN 4. Auto-Sharding: Scale horizontally 5. Map/Reduce: aggregation & data processing 6. GridFS: Stire files of any size SMS your name & email to: 213-985-4413 JGari.com/resume
  • 6. 1. A Relational Database 2. Ideal for every scenario SMS your name & email to: 213-985-4413 JGari.com/resume
  • 7. 1. Not a Relational Database (RDBMS) 2. Not ideal for every scenario SMS your name & email to: 213-985-4413 JGari.com/resume
  • 8. Relational Database Table/Records MongoDB Collection/Documents id firstName lastName age id: 1 firstName: Jorge lastName: Garifuna 1 Jorge Garifuna 85 age: 85 id: 2 2 Jimmy Smith 30 firstName: Jimmy lastName: Smith age: 30 id: 3 firstName: Alan lastName: Jones age: 25 city: Los Angeles state: CA SMS your name & email to: 213-985-4413 JGari.com/resume
  • 9. 1. I dig alpha products 2. Beta products are my cut of tea 3. I only consider stable products SMS your name & email to: 213-985-4413 JGari.com/resume
  • 10. Credit: Sanjeev Mishra SMS your name & email to: 213-985-4413 JGari.com/resume
  • 11. 1. When you need flexibility in your data 2. When you want to easily scale 3. When your dataset does not have zillions of joins SMS your name & email to: 213-985-4413 JGari.com/resume
  • 12. MySQL executable Oracle executable Mongo executable mysqld oracle mongod mysql sqlplus mongo MySQL term Mongo term/concept database database table collection index index row BSON document column BSON field join embedding and linking primary key _id field group by aggregation Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart SMS your name & email to: 213-985-4413 JGari.com/resume
  • 13. 1. Download from 1. http://www.mongodb.org/downloads 2. Unzip package 3. Run the following from terminal 1. sudo mkdir -p /data/db 2. sudo chown `id -u` /data/db 4. Add to path 1. Mac example: export PATH=/Users/jgarifuna/jg/net/Dev/db/mongodb-osx-x86_64- 2.2.1-rc0/bin:$PATH 2. Linux example: PATH=/home/jgarifuna/mongo-linux-2.2.1/bin:$PATH SMS your name & email to: 213-985-4413 JGari.com/resume
  • 14. 1. If added to path in command line type 1. mongod 2. If not on path 1. Access the bin folder on mongo folder 2. Type: ./mongod SMS your name & email to: 213-985-4413 JGari.com/resume
  • 15. 1. If added to path in command line type 1. mongo 2. If not on path 1. Access the bin folder on mongo folder 2. Type: ./mongo SMS your name & email to: 213-985-4413 JGari.com/resume
  • 16. 1. Databases are created automatically 2. Tables are created automatically 3. Primary key is created automatically SMS your name & email to: 213-985-4413 JGari.com/resume
  • 17. SQL Statement Mongo Statement INSERT INTO USERS VALUES(3,5) db.users.insert({a:3,b:5}) SELECT * FROM users db.users.find() UPDATE users SET a=1 WHERE db.users.update({b:'q'}, {$set:{a:1}}, false, b='q' true) DELETE FROM users WHERE db.users.remove({z:'abc'}); z="abc" Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart SMS your name & email to: 213-985-4413 JGari.com/resume
  • 18. SQL Statement Mongo Statement INSERT INTO USERS VALUES(3,5) db.users.insert({a:3,b:5}) Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart SMS your name & email to: 213-985-4413 JGari.com/resume
  • 19. SQL Statement Mongo Statement SELECT a,b FROM users db.users.find({}, {a:1,b:1}) SELECT * FROM users db.users.find() SELECT * FROM users WHERE age=33 db.users.find({age:33}) SELECT a,b FROM users WHERE age=33 db.users.find({age:33}, {a:1,b:1}) SELECT * FROM users WHERE age=33 db.users.find({age:33}).sort({name:1}) ORDER BY name SELECT * FROM users WHERE age>33 db.users.find({age:{$gt:33}}) SELECT * FROM users WHERE age!=33 db.users.find({age:{$ne:33}}) SELECT * FROM users WHERE age>33 db.users.find({'age':{$gt:33,$lte:40}}) AND age<=40 SELECT * FROM users ORDER BY name db.users.find().sort({name:-1}) DESC SELECT COUNT(*y) FROM users where db.users.find({age: {'$gt': 30}}).count() AGE > 30 SELECT COUNT(AGE) from users db.users.find({age: {'$exists': true}}).count() Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart SMS your name & email to: 213-985-4413 JGari.com/resume
  • 20. SQL Statement Mongo Statement UPDATE users SET a=1 WHERE db.users.update({b:'q'}, {$set:{a:1}}, false, b='q' true) UPDATE users SET a=a+2 WHERE db.users.update({b:'q'}, {$inc:{a:2}}, false, b='q' true) Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart SMS your name & email to: 213-985-4413 JGari.com/resume
  • 21. SQL Statement Mongo Statement DELETE FROM users WHERE z="abc" db.users.remove({z:'abc'}); Source: http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart SMS your name & email to: 213-985-4413 JGari.com/resume
  • 22. SMS your name & email to: 213-985-4413 JGari.com/resume
  • 23. Source: http://www.mongodb.org/display/DOCS/Replica+Sets SMS your name & email to: 213-985-4413 JGari.com/resume
  • 24.  On each mongodb instance start service with:  mongod --rest --replSet myset Source: http://www.mongodb.org/display/DOCS/Replica+Sets+-+Basics SMS your name & email to: 213-985-4413 JGari.com/resume
  • 25.  Connect to primary server:  mongo --host PRIMARY_IP_OR_NAME  Initialize replica set  rs.initiate()  Add secondary node to replica set  rs.add(‘FIRST_SERVER_NAME_OR_IP’)  Add arbiter node to replica set  rs.addArb(‘ARB_SERVER_NAME_OR_IP’) Source: http://www.mongodb.org/display/DOCS/Replica+Sets+-+Basics SMS your name & email to: 213-985-4413 JGari.com/resume
  • 26.  Connect to primary server:  mongo --host PRIMARY_IP_OR_NAME  Add a document  db.foo.save({name: “Jorge Garifuna”})  Set secondary to slave (otherwise you wont be able to see data)  rs.slaveOk()  Query secondary  db.foo.find() Source: http://www.mongodb.org/display/DOCS/Replica+Sets+-+Basics SMS your name & email to: 213-985-4413 JGari.com/resume
  • 27. Some Node JS stuff SMS your name & email to: 213-985-4413 JGari.com/resume
  • 28.  Platform built on Google Chrome’s JavaScript Runtime  For building fast, scalable network applications  Substitute for Apache/PHP  But you create your own server code SMS your name & email to: 213-985-4413 JGari.com/resume
  • 29.  Download from  nodejs.org  Run installation SMS your name & email to: 213-985-4413 JGari.com/resume
  • 30. var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); 1. Create new folder 2. Create testserver.js file and place within folder 3. Run node 1. Node testserver.js 4. On browser go to: http://127.0.0.1:1337 SMS your name & email to: 213-985-4413 JGari.com/resume
  • 31. 1. A Node JS Application Framework 2. Uses MVC (model, view, controller) pattern SMS your name & email to: 213-985-4413 JGari.com/resume
  • 32. 1. From the command line run Node Package Manager 1. sudo npm install -g express SMS your name & email to: 213-985-4413 JGari.com/resume
  • 33. 1. From the command line run 1. Express ./YOUR_APP_NAME 2. Change into your new app folder 1. cd ./YOUR_APP_NAME 3. Install depedencies 1. npm install -d SMS your name & email to: 213-985-4413 JGari.com/resume
  • 34. 1. Change into your new app folder 1. cd ./YOUR_APP_NAME 2. Run app with node 1. node app 3. On browser go to URL: 1. http://localhost:3000 SMS your name & email to: 213-985-4413 JGari.com/resume
  • 35. 1. Change into your new app folder 1. cd ./YOUR_APP_NAME 2. Run app with node 1. node app 3. On browser go to URL: 1. http://localhost:3000 SMS your name & email to: 213-985-4413 JGari.com/resume
  • 36. 1. Download workout web api from 1. https://github.com/donnfelker/workout-tracker 2. Checkout Develop a RESTful API Using Node.js With Express and Mongoose 1. http://pixelhandler.com/blog/2012/02/09/develop-a- restful-api-using-node-js-with-express-and- mongoose/ SMS your name & email to: 213-985-4413 JGari.com/resume
  • 37.  While you think…  Sign up to LAMPsig’s mailing list at: ▪ http://lampsig.org  Join LAMPsig on Meetup at: ▪ http://www.meetup.com/LAMPsig  Jorge Garifuna ▪ info@GariDigital.com ▪ @jgarifuna SMS your name & email to: 213-985-4413 JGari.com/resume
  • 38. 1. http://www.mongodb.org 2. http://nodejs.org 3. http://expressjs.com 4. http://pixelhandler.com/blog/2012/02/09/dev elop-a-restful-api-using-node-js-with- express-and-mongoose 5. http://lampsig.org 6. http://www.meetup.com/LAMPsig SMS your name & email to: 213-985-4413 JGari.com/resume