SlideShare a Scribd company logo
2
Most read
Stack RESTful API Tutorial - Using MongoDB, Express,
Angular JS, and Node JS Together
Before starting on these let us discuss about the platforms terms.
What is NodeJs?
Node.js is a server side platform built on Google Chrome's JavaScript
Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its
latest version is v0.10.36. The definition of Node.js as supplied by its official
documentation is as follows โˆ’
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and
scalable network applications. Node.js uses an event-driven, non-blocking I/O model
that makes it lightweight and efficient, perfect for data-intensive real-time applications
that run across distributed devices.
Node.js is an open source, cross-platform runtime environment for
developing server-side and networking applications. Node.js applications
are written in JavaScript, and can be run within the Node.js runtime on OS
X, Microsoft Windows, and Linux.
Node.js also provides a rich library of various JavaScript modules which
simplifies the development of web applications using Node.js to a great
extent.
Node.js = Runtime Environment + JavaScript Library
Features of Node.js
Following are some of the important features that make Node.js the first
choice of software architects.
โˆ‘ Asynchronous and Event Driven All APIs of Node.js library are asynchronous
that is, non-blocking. It essentially means a Node.js based server never waits
for an API to return data. The server moves to the next API after calling it and a
notification mechanism of Events of Node.js helps the server to get a response
from the previous API call.
โˆ‘ Very Fast Being built on Google Chrome's V8 JavaScript Engine, Node.js library
is very fast in code execution.
โˆ‘ Single Threaded but Highly Scalable - Node.js uses a single threaded model
with event looping. Event mechanism helps the server to respond in a non-
blocking way and makes the server highly scalable as opposed to traditional
servers which create limited threads to handle requests. Node.js uses a single
threaded program and the same program can provide service to a much larger
number of requests than traditional servers like Apache HTTP Server.
โˆ‘ No Buffering - Node.js applications never buffer any data. These applications
simply output the data in chunks.
โˆ‘ License - Node.js is released under the MIT license.
Who Uses Node.js?
Following is the link on github wiki containing an exhaustive list of projects,
application and companies which are using Node.js. This list includes eBay,
General Electric, GoDaddy, Microsoft, PayPal, Uber, Wikipins, Yahoo!, and
Yammer to name a few.
โˆ‘ Projects, Applications, and Companies Using Node
Concepts
The following diagram depicts some important parts of Node.js which we
will discuss in detail in the subsequent chapters.
Where to Use Node.js?
Following are the areas where Node.js is proving itself as a perfect
technology partner.
โˆ‘ I/O bound Applications
โˆ‘ Data Streaming Applications
โˆ‘ Data Intensive Real time Applications (DIRT)
โˆ‘ JSON APIs based Applications
โˆ‘ Single Page Applications
Where Not to Use Node.js?
It is not advisable to use Node.js for CPU intensive applications.
What is MongoDb?
MongoDb is a Open Source database written in C++.
Drivers and client libraries are typically written in their respective languages,
although some drivers use C extensions for better performance.
If the load increases, by adding more nodes (such as a computer), the
performance can be retained.
It can be used to store data for very high performance applications (for example
Foursquare is using it in production).
MongoDB does not support SQL It supports a rich, ad-hoc query language of its
own.
MongoDb stores data as documents. So it is a document oriented database.
FirstName="Arun", Address="St. Xavier's Road", Spouse=[{Name:"Kiran"}],
Children=[{Name:"Rihit", Age:8}].
FirstName="Sameer",Address="8 Gandhi Road".
Notice there are two different documents (separated by "."). Storing data in this
fashion is called asdocument oriented database. MongoDb is a document
oriented database.
Key Features
Since MongoDb offers a Document oriented storage, It is simple and easily
programmable.
โˆ‘ You can set an index on any attribute of a MongoDb record (as
FirstName="Sameer",Address="8 Gandhi Road"), with respect to which, a record can be sort
quickly and ordered.
โˆ‘ You can set mirror across local as well as wide area networks, which makes it easily scalable.
โˆ‘ If load increases (more storage space, more processing power), it can be distributed to other
nodes across computer networks. This is called as sharding.
โˆ‘ MongoDb supports rich query to fetch data from the database.
โˆ‘ MongoDb supports replacing an entire document (database) or some specific fields with it's
update() command.
โˆ‘ MongoDb supports Map/Reduce framework for batch processing of data and aggregation
operation. Here is brief of how Map/Reduce works :
โˆ‘ Map : A master node takes an input. Splits it into smaller sections. Sends it to the associated
nodes.
โˆ‘ These nodes may perform the same operation in turn to send those smaller section of input to
other nodes. It process the problem (taken as input) and sends it back to the Master Node.
โˆ‘ Reduce : The master node aggregates those results to find the output.
โˆ‘ GridFS specification of MongoDb supports storage of very large files.
โˆ‘ MongoDb supports various programming languages like C, C# and .NET, C++, Erlang, Haskell,
Java, Javascript, Perl, PHP, Python, Ruby, Scala (via Casbah).
โˆ‘ It supports Server-side JavaScript execution. Which allows a developer to use a single
programming language for both client and server side code.
โˆ‘ MongoDb is easily installable.
MongoDB Fundamentals : Frequently Asked Questions
What kind of database is MongoDB?
MongoDB is a document-oriented DBMS. Think of MySQL but with JSON-like
objects comprising the data mode, rather than RDBMS tables. MongoDB
supports neither joins nor transactions.
Do MongoDB database stores its data in tables?
A MongoDB database stores its data in collections instead of tables, which are
the rough equivalent of RDBMS tables.
Do MongoDB databases have schemas?
MongoDB uses dynamic schemas. Without defining the structure you can create
collections, i.e. the fields or the types of their values, of the documents in the
collection. You can change the structure of documents simply by adding new
fields or deleting existing ones.
Which programming languages can be used to work with MongoDB?
MongoDB client drivers exist for all of the most popular programming languages.
See the latest list of drivers for details.
Does MongoDB support SQL?
No.
What are typical uses for MongoDB?
Content management systems, mobile applications, gaming, e-commerce,
analytics, archiving, and logging.
Does MongoDB support transactions?
No. However, MongoDB does provide atomic operations on a single document.
Does MongoDB require a lot of RAM?
Not necessarily. It's certainly possible to run MongoDB on a machine with a small
amount of free RAM. MongoDB automatically uses all free memory on the
machine as its cache.
Does MongoDB handle caching?
Yes. MongoDB keeps all of the most recently used data in RAM. If you have
created indexes for your queries and your working data set fits in RAM,
MongoDB serves all queries from memory.
What are the limitations of 32-bit versions of MongoDB?
Changed in version 3.0: Commercial support is no longer provided for MongoDB
on 32-bit platforms (Linux and Windows).
History
Development of MongoDB began in October 2007 by 10gen. The first public
release was in February 2009.
Obtain MongoDb
You can download MongoDb from http://www.mongodb.org/downloads. As of this
writing, it supports following platforms:
โˆ‘ OS X 32-bit
โˆ‘ OS X 64-bit
โˆ‘ Linux 32-bit
โˆ‘ Linux 64-bit
โˆ‘ Windows 32-bit
โˆ‘ Windows 64-bit
โˆ‘ Solaris i86pc
โˆ‘ Solaris 64
โˆ‘ You can download the source and install MongoDb from that too.
MongoDB : Databases, Schemas and Tables
Databases : MongoDB is a document-oriented DBMS, with JSON-like objects
comprising the data model, rather than RDBMS tables. MongoDB does not
support joins nor transactions. However, it features secondary indexes, an
expressive query language, atomic writes on a per-document level, and fully-
consistent reads. MongoDB uses BSON, a binary object format similar to, but
more expressive than JSON.
Schemas : MongoDB uses dynamic schemas. We can create collections without
defining the structure, i.e. the fields or the types of their values, of the
documents. You can change the structure of documents simply by adding new
fields or deleting existing ones. Documents in a collection need unique set of
fields.
Tables : MongoDB database stores its data in collections not in tables The
collections are the rough equivalent of RDBMS tables. A collection holds one or
more documents, which corresponds to a record or a row in a relational database
table, and each document has one or more fields, which corresponds to a
column in a relational database table.
MongoDB and ACID transactions
MongoDB does not support multi-document transactions, but provides atomic
operations on a single document. Often these document-level atomic operations
are sufficient to solve problems that would require ACID transactions in a
relational database.
In MongoDB, you can embed related data in nested arrays or nested documents
within a single document and update the entire document in a single atomic
operation. Relational databases might represent the same kind of data with
multiple tables and rows, which would require transaction support to update the
data atomically.
MongoDB allows clients to read documents inserted or modified before it
commits these modifications to disk, regardless of write concern level or
journaling configuration. Applications may observe two classes of behaviors :
โˆ‘ MongoDB will allow clients to read the results of a write operation before the write operation
returns for systems with multiple concurrent readers and writers
โˆ‘ If the mongodb terminates before the journal commits, even if a write returns successfully,
queries may have read data that will not exist after the mongodb restarts.
Other database systems refer to these isolation semantics as read uncommitted.
For all inserts and updates, MongoDB modifies
โˆ‘ each document in isolation
โˆ‘ clients never see documents in intermediate states
For multi-document operations, MongoDB does not provide any multi-document
transactions or isolation. When mongodb returns a successful journaled write
concern, the data is fully committed to disk and will be available after mongodb
restarts. For replica sets, write operations are durable only after a write replicates
and commits to the journal of a majority of the voting members of the set.
MongoDB and caching
MongoDB has no configurable cache. MongoDB uses all free memory on the
system automatically by way of memory-mapped files. Operating systems use
the same approach with their file system caches. MongoDB keeps all of the most
recently used data in RAM. If you have created indexes for your queries and your
working data set fits in RAM, MongoDB serves all queries from memory.
MongoDB does not implement a query cache, it serves all queries directly from
the indexes and/or data files.
Tools
There are several tools available for managing MongoDB.
Monitoring
Network and System monitoring tool Munin has a plugin available for MongoDB.
Distributes high-performance system monitoring tool Gangila has a plugin
available for MongoDB.
Open source web based graphic tool Cacti, used to graph CPU load, network
bandwidth utilization, has a plugin available for MongoDB.
GUI
โˆ‘ Fang of Mongo is a web-based user interface built with Django and jQuery.
โˆ‘ Futon4Mongo is a clone of the CouchDB Futon web interface for MongoDB.
โˆ‘ Mongo3 is a Ruby-based interface.
โˆ‘ MongoHub is a native OS X application for managing MongoDB.
โˆ‘ Opricot is a browser-based MongoDB shell written in PHP.
โˆ‘ phpMoAdmin is a PHP based MongoDb management tool.
โˆ‘ MongoVUE is a Windows based GUI to work with MongoDB.
โˆ‘ RockMongo is a PHP based MongoDB administration GUI tool.
MongoDB in production
Here is a list of a few MongoDB production deployment:
โˆ‘ Craiglist uses MongoDb to archive there billions of records.
โˆ‘ FourSquare, a location based social networking site, uses MongoDb to shrade there data over a
number of machines on Amazon EC2.
โˆ‘ Shutterfly, an Internet-based social expression and personal publishing service, uses MongoDb
for various persistent data storage requirements.
โˆ‘ bit.ly, a web based url shortening service, uses MongoDb for storing their data.
โˆ‘ spike.com, a MTV Network's associate, uses MongoDB.
โˆ‘ Intuit, a large provider of software and services for small businesses and individuals, uses
MongoDB to track user engagement and activity in real-time across its network of websites for
small businesses.
โˆ‘ sourceforge.net, a site to find, create and publish Open Source Software for free, uses
MongoDB for back-end storage.
โˆ‘ etsy.com, a site to buy and sell handmade items, uses MongoDB.
โˆ‘ The New York Times, one of the leading online news portal, is using MongoDB in a form-
building application for photo submissions.
โˆ‘ CERN, the prestigious particle Physics research institute, uses MongoDB for Large Hadron
Collider data.
What is ExpressJs?
Express is a framework of Node.js that allows you to use several very useful and powerful
features without having to reinvent the wheel, helps you organize your application's routing
and use any templating solution with minimal effort. It also allows for much better
organization of your code. In my personal opinion, Express.js is the best Node.js framework
but Meteor.js, Derby.js, Sails.js and Flatiron.js are some of the best alternatives. Especially
Meteor which is more of a full stack framework is superb and can do quite impressive things
with minimal effort.
What is AngularJs?
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your
template language and lets you extend HTML's syntax to express your application's
components clearly and succinctly. Angular's data binding and dependency injection eliminate
much of the code you would otherwise have to write.
<!DOCTYPE html>
<html>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="">
<p>Input something in the input box:</p>
<p>Name : <input type="text" ng-model="name" placeholder="Enter name here"></p>
<h1>Hello {{name}}</h1>
</div>
</body>
</html>
For info visit PHP Support Desk

More Related Content

DOCX
Node js getting started
PDF
Node js first look - 2016
PPTX
Node js crash course session 2
PPTX
A slightly advanced introduction to node.js
PPTX
Nodejs server lesson 3
PDF
Node JS Crash Course
PPTX
Introduction to Node.js
PPT
Node js getting started
Node js first look - 2016
Node js crash course session 2
A slightly advanced introduction to node.js
Nodejs server lesson 3
Node JS Crash Course
Introduction to Node.js

What's hot (20)

PPT
Node js
PPTX
Node js crash course session 5
PPTX
Node js for beginners
PDF
Introduction to REST API with Node.js
PPTX
Node js crash course session 3
PDF
NodeJS ecosystem
PDF
Web Development with AngularJS, NodeJS and ExpressJS
PPTX
Ajax xml json
PPTX
MongoDB basics & Introduction
PDF
Ng init | EPI Sousse
PPTX
Top 10 frameworks of node js
PPTX
Using Webservice in iOS
PPTX
Mongodb tutorial by Rajendra Arora
PPTX
Mongo db
PDF
Optimizing MongoDB: Lessons Learned at Localytics
PPTX
Webinar Back to Basics 3 - Introduzione ai Replica Set
ย 
PPTX
MongoDB on Windows Azure
ย 
PDF
Flask jwt authentication tutorial
PDF
Mongodb
PPTX
Introduction to mongo db
Node js
Node js crash course session 5
Node js for beginners
Introduction to REST API with Node.js
Node js crash course session 3
NodeJS ecosystem
Web Development with AngularJS, NodeJS and ExpressJS
Ajax xml json
MongoDB basics & Introduction
Ng init | EPI Sousse
Top 10 frameworks of node js
Using Webservice in iOS
Mongodb tutorial by Rajendra Arora
Mongo db
Optimizing MongoDB: Lessons Learned at Localytics
Webinar Back to Basics 3 - Introduzione ai Replica Set
ย 
MongoDB on Windows Azure
ย 
Flask jwt authentication tutorial
Mongodb
Introduction to mongo db
Ad

Viewers also liked (20)

PPTX
EAIESB TIBCO EXPERTISE
PDF
Introduction to Node.JS Express
PDF
NodeJS_Presentation
PPTX
Mule ESB session day 1
ย 
PDF
Enterprise Integration Patterns
PPT
Managing Patient SatLEADfor4-25-13
PDF
Node JS Express: Steps to Create Restful Web App
PPTX
Module design pattern i.e. express js
PDF
Patterns for Enterprise Integration Success
ย 
PDF
Enterprise Integration Patterns
PPTX
Enterprise Integration Patterns
PPTX
Node JS Express : Steps to Create Restful Web App
PDF
Enterprise Integration Patterns Revisited (again) for the Era of Big Data, In...
PDF
Node js
PPT
Implementation in mule esb
PPTX
API and SOA: Two Sides of the Same Coin?
ย 
PDF
Differentiating between web APIs, SOA, & integration โ€ฆand why it matters
PDF
Integration Patterns and Anti-Patterns for Microservices Architectures
ย 
PDF
REST vs. Messaging For Microservices
PPTX
Express JS
EAIESB TIBCO EXPERTISE
Introduction to Node.JS Express
NodeJS_Presentation
Mule ESB session day 1
ย 
Enterprise Integration Patterns
Managing Patient SatLEADfor4-25-13
Node JS Express: Steps to Create Restful Web App
Module design pattern i.e. express js
Patterns for Enterprise Integration Success
ย 
Enterprise Integration Patterns
Enterprise Integration Patterns
Node JS Express : Steps to Create Restful Web App
Enterprise Integration Patterns Revisited (again) for the Era of Big Data, In...
Node js
Implementation in mule esb
API and SOA: Two Sides of the Same Coin?
ย 
Differentiating between web APIs, SOA, & integration โ€ฆand why it matters
Integration Patterns and Anti-Patterns for Microservices Architectures
ย 
REST vs. Messaging For Microservices
Express JS
Ad

Similar to Node Js, AngularJs and Express Js Tutorial (20)

PPTX
MongoDB presentation
PDF
Introduction to MongoDB Basics from SQL to NoSQL
PPTX
Kalp Corporate MongoDB Tutorials
PPTX
Introduction-to-MongoDB with mongoose and Node
PDF
Mongodb
PPTX
MongoDB
PDF
Mongodb
PDF
The Little MongoDB Book - Karl Seguin
PPTX
mongodb-brief-intro-february-2012
PDF
Introduction to MongoDB
PPTX
Everything You Need to Know About MongoDB Development.pptx
PDF
3-Mongodb and Mapreduce Programming.pdf
PPTX
MongoDB
PPTX
MongoDB
PDF
Mongo db basics
PPTX
Mongo db intro.pptx
PPTX
Mongodb
PPTX
Mongodb Introduction
PPTX
Mongodb - NoSql Database
PPTX
Getting Started with MongoDB using Node.js
MongoDB presentation
Introduction to MongoDB Basics from SQL to NoSQL
Kalp Corporate MongoDB Tutorials
Introduction-to-MongoDB with mongoose and Node
Mongodb
MongoDB
Mongodb
The Little MongoDB Book - Karl Seguin
mongodb-brief-intro-february-2012
Introduction to MongoDB
Everything You Need to Know About MongoDB Development.pptx
3-Mongodb and Mapreduce Programming.pdf
MongoDB
MongoDB
Mongo db basics
Mongo db intro.pptx
Mongodb
Mongodb Introduction
Mongodb - NoSql Database
Getting Started with MongoDB using Node.js

Recently uploaded (20)

PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
SAP Ariba Sourcing PPT for learning material
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PPTX
artificial intelligence overview of it and more
PDF
๐Ÿ’ฐ ๐”๐Š๐“๐ˆ ๐Š๐„๐Œ๐„๐๐€๐๐†๐€๐ ๐Š๐ˆ๐๐„๐‘๐Ÿ’๐ƒ ๐‡๐€๐‘๐ˆ ๐ˆ๐๐ˆ ๐Ÿ๐ŸŽ๐Ÿ๐Ÿ“ ๐Ÿ’ฐ
ย 
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PDF
Vigrab.top โ€“ Online Tool for Downloading and Converting Social Media Videos a...
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
ย 
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPTX
Funds Management Learning Material for Beg
Module 1 - Cyber Law and Ethics 101.pptx
SASE Traffic Flow - ZTNA Connector-1.pdf
SAP Ariba Sourcing PPT for learning material
The New Creative Director: How AI Tools for Social Media Content Creation Are...
artificial intelligence overview of it and more
๐Ÿ’ฐ ๐”๐Š๐“๐ˆ ๐Š๐„๐Œ๐„๐๐€๐๐†๐€๐ ๐Š๐ˆ๐๐„๐‘๐Ÿ’๐ƒ ๐‡๐€๐‘๐ˆ ๐ˆ๐๐ˆ ๐Ÿ๐ŸŽ๐Ÿ๐Ÿ“ ๐Ÿ’ฐ
ย 
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
introduction about ICD -10 & ICD-11 ppt.pptx
Vigrab.top โ€“ Online Tool for Downloading and Converting Social Media Videos a...
Decoding a Decade: 10 Years of Applied CTI Discipline
QR Codes Qr codecodecodecodecocodedecodecode
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
RPKI Status Update, presented by Makito Lay at IDNOG 10
ย 
Paper PDF World Game (s) Great Redesign.pdf
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PptxGenJS_Demo_Chart_20250317130215833.pptx
Job_Card_System_Styled_lorem_ipsum_.pptx
Introuction about WHO-FIC in ICD-10.pptx
Funds Management Learning Material for Beg

Node Js, AngularJs and Express Js Tutorial

  • 1. Stack RESTful API Tutorial - Using MongoDB, Express, Angular JS, and Node JS Together Before starting on these let us discuss about the platforms terms. What is NodeJs? Node.js is a server side platform built on Google Chrome's JavaScript Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its latest version is v0.10.36. The definition of Node.js as supplied by its official documentation is as follows โˆ’ Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux. Node.js also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent. Node.js = Runtime Environment + JavaScript Library Features of Node.js Following are some of the important features that make Node.js the first choice of software architects. โˆ‘ Asynchronous and Event Driven All APIs of Node.js library are asynchronous that is, non-blocking. It essentially means a Node.js based server never waits for an API to return data. The server moves to the next API after calling it and a notification mechanism of Events of Node.js helps the server to get a response from the previous API call.
  • 2. โˆ‘ Very Fast Being built on Google Chrome's V8 JavaScript Engine, Node.js library is very fast in code execution. โˆ‘ Single Threaded but Highly Scalable - Node.js uses a single threaded model with event looping. Event mechanism helps the server to respond in a non- blocking way and makes the server highly scalable as opposed to traditional servers which create limited threads to handle requests. Node.js uses a single threaded program and the same program can provide service to a much larger number of requests than traditional servers like Apache HTTP Server. โˆ‘ No Buffering - Node.js applications never buffer any data. These applications simply output the data in chunks. โˆ‘ License - Node.js is released under the MIT license. Who Uses Node.js? Following is the link on github wiki containing an exhaustive list of projects, application and companies which are using Node.js. This list includes eBay, General Electric, GoDaddy, Microsoft, PayPal, Uber, Wikipins, Yahoo!, and Yammer to name a few. โˆ‘ Projects, Applications, and Companies Using Node Concepts The following diagram depicts some important parts of Node.js which we will discuss in detail in the subsequent chapters.
  • 3. Where to Use Node.js? Following are the areas where Node.js is proving itself as a perfect technology partner. โˆ‘ I/O bound Applications โˆ‘ Data Streaming Applications โˆ‘ Data Intensive Real time Applications (DIRT) โˆ‘ JSON APIs based Applications โˆ‘ Single Page Applications Where Not to Use Node.js? It is not advisable to use Node.js for CPU intensive applications. What is MongoDb? MongoDb is a Open Source database written in C++. Drivers and client libraries are typically written in their respective languages, although some drivers use C extensions for better performance. If the load increases, by adding more nodes (such as a computer), the performance can be retained.
  • 4. It can be used to store data for very high performance applications (for example Foursquare is using it in production). MongoDB does not support SQL It supports a rich, ad-hoc query language of its own. MongoDb stores data as documents. So it is a document oriented database. FirstName="Arun", Address="St. Xavier's Road", Spouse=[{Name:"Kiran"}], Children=[{Name:"Rihit", Age:8}]. FirstName="Sameer",Address="8 Gandhi Road". Notice there are two different documents (separated by "."). Storing data in this fashion is called asdocument oriented database. MongoDb is a document oriented database. Key Features Since MongoDb offers a Document oriented storage, It is simple and easily programmable. โˆ‘ You can set an index on any attribute of a MongoDb record (as FirstName="Sameer",Address="8 Gandhi Road"), with respect to which, a record can be sort quickly and ordered. โˆ‘ You can set mirror across local as well as wide area networks, which makes it easily scalable. โˆ‘ If load increases (more storage space, more processing power), it can be distributed to other nodes across computer networks. This is called as sharding. โˆ‘ MongoDb supports rich query to fetch data from the database. โˆ‘ MongoDb supports replacing an entire document (database) or some specific fields with it's update() command. โˆ‘ MongoDb supports Map/Reduce framework for batch processing of data and aggregation operation. Here is brief of how Map/Reduce works : โˆ‘ Map : A master node takes an input. Splits it into smaller sections. Sends it to the associated nodes. โˆ‘ These nodes may perform the same operation in turn to send those smaller section of input to other nodes. It process the problem (taken as input) and sends it back to the Master Node.
  • 5. โˆ‘ Reduce : The master node aggregates those results to find the output. โˆ‘ GridFS specification of MongoDb supports storage of very large files. โˆ‘ MongoDb supports various programming languages like C, C# and .NET, C++, Erlang, Haskell, Java, Javascript, Perl, PHP, Python, Ruby, Scala (via Casbah). โˆ‘ It supports Server-side JavaScript execution. Which allows a developer to use a single programming language for both client and server side code. โˆ‘ MongoDb is easily installable. MongoDB Fundamentals : Frequently Asked Questions What kind of database is MongoDB? MongoDB is a document-oriented DBMS. Think of MySQL but with JSON-like objects comprising the data mode, rather than RDBMS tables. MongoDB supports neither joins nor transactions. Do MongoDB database stores its data in tables? A MongoDB database stores its data in collections instead of tables, which are the rough equivalent of RDBMS tables. Do MongoDB databases have schemas? MongoDB uses dynamic schemas. Without defining the structure you can create collections, i.e. the fields or the types of their values, of the documents in the collection. You can change the structure of documents simply by adding new fields or deleting existing ones. Which programming languages can be used to work with MongoDB? MongoDB client drivers exist for all of the most popular programming languages. See the latest list of drivers for details. Does MongoDB support SQL? No. What are typical uses for MongoDB? Content management systems, mobile applications, gaming, e-commerce, analytics, archiving, and logging. Does MongoDB support transactions? No. However, MongoDB does provide atomic operations on a single document. Does MongoDB require a lot of RAM? Not necessarily. It's certainly possible to run MongoDB on a machine with a small amount of free RAM. MongoDB automatically uses all free memory on the machine as its cache. Does MongoDB handle caching? Yes. MongoDB keeps all of the most recently used data in RAM. If you have created indexes for your queries and your working data set fits in RAM, MongoDB serves all queries from memory.
  • 6. What are the limitations of 32-bit versions of MongoDB? Changed in version 3.0: Commercial support is no longer provided for MongoDB on 32-bit platforms (Linux and Windows). History Development of MongoDB began in October 2007 by 10gen. The first public release was in February 2009. Obtain MongoDb You can download MongoDb from http://www.mongodb.org/downloads. As of this writing, it supports following platforms: โˆ‘ OS X 32-bit โˆ‘ OS X 64-bit โˆ‘ Linux 32-bit โˆ‘ Linux 64-bit โˆ‘ Windows 32-bit โˆ‘ Windows 64-bit โˆ‘ Solaris i86pc โˆ‘ Solaris 64 โˆ‘ You can download the source and install MongoDb from that too. MongoDB : Databases, Schemas and Tables Databases : MongoDB is a document-oriented DBMS, with JSON-like objects comprising the data model, rather than RDBMS tables. MongoDB does not support joins nor transactions. However, it features secondary indexes, an expressive query language, atomic writes on a per-document level, and fully- consistent reads. MongoDB uses BSON, a binary object format similar to, but more expressive than JSON. Schemas : MongoDB uses dynamic schemas. We can create collections without defining the structure, i.e. the fields or the types of their values, of the documents. You can change the structure of documents simply by adding new fields or deleting existing ones. Documents in a collection need unique set of fields. Tables : MongoDB database stores its data in collections not in tables The collections are the rough equivalent of RDBMS tables. A collection holds one or more documents, which corresponds to a record or a row in a relational database
  • 7. table, and each document has one or more fields, which corresponds to a column in a relational database table. MongoDB and ACID transactions MongoDB does not support multi-document transactions, but provides atomic operations on a single document. Often these document-level atomic operations are sufficient to solve problems that would require ACID transactions in a relational database. In MongoDB, you can embed related data in nested arrays or nested documents within a single document and update the entire document in a single atomic operation. Relational databases might represent the same kind of data with multiple tables and rows, which would require transaction support to update the data atomically. MongoDB allows clients to read documents inserted or modified before it commits these modifications to disk, regardless of write concern level or journaling configuration. Applications may observe two classes of behaviors : โˆ‘ MongoDB will allow clients to read the results of a write operation before the write operation returns for systems with multiple concurrent readers and writers โˆ‘ If the mongodb terminates before the journal commits, even if a write returns successfully, queries may have read data that will not exist after the mongodb restarts. Other database systems refer to these isolation semantics as read uncommitted. For all inserts and updates, MongoDB modifies โˆ‘ each document in isolation โˆ‘ clients never see documents in intermediate states For multi-document operations, MongoDB does not provide any multi-document transactions or isolation. When mongodb returns a successful journaled write concern, the data is fully committed to disk and will be available after mongodb restarts. For replica sets, write operations are durable only after a write replicates and commits to the journal of a majority of the voting members of the set. MongoDB and caching MongoDB has no configurable cache. MongoDB uses all free memory on the system automatically by way of memory-mapped files. Operating systems use the same approach with their file system caches. MongoDB keeps all of the most recently used data in RAM. If you have created indexes for your queries and your working data set fits in RAM, MongoDB serves all queries from memory.
  • 8. MongoDB does not implement a query cache, it serves all queries directly from the indexes and/or data files. Tools There are several tools available for managing MongoDB. Monitoring Network and System monitoring tool Munin has a plugin available for MongoDB. Distributes high-performance system monitoring tool Gangila has a plugin available for MongoDB. Open source web based graphic tool Cacti, used to graph CPU load, network bandwidth utilization, has a plugin available for MongoDB. GUI โˆ‘ Fang of Mongo is a web-based user interface built with Django and jQuery. โˆ‘ Futon4Mongo is a clone of the CouchDB Futon web interface for MongoDB. โˆ‘ Mongo3 is a Ruby-based interface. โˆ‘ MongoHub is a native OS X application for managing MongoDB. โˆ‘ Opricot is a browser-based MongoDB shell written in PHP. โˆ‘ phpMoAdmin is a PHP based MongoDb management tool. โˆ‘ MongoVUE is a Windows based GUI to work with MongoDB. โˆ‘ RockMongo is a PHP based MongoDB administration GUI tool. MongoDB in production Here is a list of a few MongoDB production deployment: โˆ‘ Craiglist uses MongoDb to archive there billions of records. โˆ‘ FourSquare, a location based social networking site, uses MongoDb to shrade there data over a number of machines on Amazon EC2. โˆ‘ Shutterfly, an Internet-based social expression and personal publishing service, uses MongoDb for various persistent data storage requirements. โˆ‘ bit.ly, a web based url shortening service, uses MongoDb for storing their data. โˆ‘ spike.com, a MTV Network's associate, uses MongoDB.
  • 9. โˆ‘ Intuit, a large provider of software and services for small businesses and individuals, uses MongoDB to track user engagement and activity in real-time across its network of websites for small businesses. โˆ‘ sourceforge.net, a site to find, create and publish Open Source Software for free, uses MongoDB for back-end storage. โˆ‘ etsy.com, a site to buy and sell handmade items, uses MongoDB. โˆ‘ The New York Times, one of the leading online news portal, is using MongoDB in a form- building application for photo submissions. โˆ‘ CERN, the prestigious particle Physics research institute, uses MongoDB for Large Hadron Collider data. What is ExpressJs? Express is a framework of Node.js that allows you to use several very useful and powerful features without having to reinvent the wheel, helps you organize your application's routing and use any templating solution with minimal effort. It also allows for much better organization of your code. In my personal opinion, Express.js is the best Node.js framework but Meteor.js, Derby.js, Sails.js and Flatiron.js are some of the best alternatives. Especially Meteor which is more of a full stack framework is superb and can do quite impressive things with minimal effort. What is AngularJs? AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. Angular's data binding and dependency injection eliminate much of the code you would otherwise have to write. <!DOCTYPE html> <html> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> <div ng-app=""> <p>Input something in the input box:</p> <p>Name : <input type="text" ng-model="name" placeholder="Enter name here"></p> <h1>Hello {{name}}</h1> </div>
  • 10. </body> </html> For info visit PHP Support Desk