Klevis Mino: MongoDB
Upcoming SlideShare
Loading in...5
×
 

Klevis Mino: MongoDB

on

  • 643 views

Project by Klevis Mino

Project by Klevis Mino
Course "Innovation and New Technologies" - University of Camerino
(teacher C. Vaccari)

Statistics

Views

Total Views
643
Views on SlideShare
508
Embed Views
135

Actions

Likes
0
Downloads
5
Comments
0

3 Embeds 135

http://camerino20.wordpress.com 131
http://www.linkedin.com 2
http://www.slideee.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Klevis Mino: MongoDB Klevis Mino: MongoDB Presentation Transcript

  • by Klevis Mino
  • What is NoSQL?  NoSQL features  NoSQL database types  What is MongoDB?  Who uses MongoDB?  Installation and Running  Documents and Collections  MongoDB features        Querying Indexing Replication Load balancing File storage Aggregation
  • What is NoSQL? Definition: “Next generation databases mostly addressing some of the points: being non-relational, distributed, open source and horizontally scalable… schema-free, easy replication support, simple API, eventually consistent, huge amount of data…” - nosql-database.org
  • What is NoSQL? Definition: “Next generation databases mostly addressing some of the points: being non-relational, distributed, open source and horizontally scalable… schema-free, easy replication support, simple API, eventually consistent, huge amount of data…” NoSQL database types • • • • Document databases Graph stores Key-value stores Wide-column stores - nosql-database.org
  • What is MongoDB? Definition: “MongoDB (from "humongous") is an open-source document database that provides high performance, high availability, and automatic scaling.” - mongodb.org Key features High performance  High availability  Automatic scaling 
  • Who uses MongoDB?
  • Installation    Download MongoDB from mongodb.org Extract to local disk C: Rename the extracted folder to “mongodb” Running MongoDB    Create a folder to store files, C:datadb To start MongoDB with Command Prompt: C:mongodbbinmongod.exe Open another CMD and execute: C:monogodbbinmongo.exe
  • Documents and Collections  A document is the basic unit of data. Documents are stored on disk in BSON (binary JSON) serialization format. { name: “klevis”, value age: 21, value status: “A”, groups: [ “news”, “sports” ] } field: field: field: value field: value
  • Documents and Collections  A collection is a group of documents (equivalent to a table in a RDBMS). A collection exists within a single database.
  • MongoDB features Querying  Indexing  Replication  Load balancing  File storage  Aggregation  Server-side JavaScrip execution  Capped collections 
  • Querying MongoDB supports search by field, range queries, regular expression searches.
  • Querying The find() method returns a cursor to the results To display all the results: var c = db.testData.find() while ( c.hasNext() ) printjson( c.next() ) To limit the number of results db.testData.find().limit(3) To print a certain result printjson( c [1] ) Searching for certain values of a field db.testData.find({x:3})
  • Querying Projections Used to return or exclude certain fields of matching documents in a query.
  • Indexing Indexes provide high performance read operations for frequently used queries. Indexes are special data structures that store a small portion of the collection’s data set in an easy to traverse form.
  • Replication MongoDB provides high availability and increased throughput with replica sets. A replica set consists of two or more copies of the data. Each replica may act in the role of primary or secondary replica at any time.
  • Load balancing MongoDB scales horizontally using sharding. The user chooses a shard key, which determines how the data in a collection will be distributed. The data is split into ranges and distributed across multiple shards. MongoDB can run over multiple servers, balancing the load and/or duplicating data to keep the system up and running in case of hardware failure. Automatic configuration is easy to deploy, and new machines can be added to a running database.
  • File storage MongoDB can be used as a file system, taking advantage of load balancing and data replication features over multiple machines for storing files. The function GriFS is included with MongoDB drivers and available with no difficulty for development languages. MongoDB exposes functions for file manipulation and content to developers. In a multimachine MongoDB system, files can be distributed and copied multiple times between machines transparently, thus effectively creating a loadbalanced and fault-tolerant system.
  • Aggregation MapReduce can be used for batch processing of data and aggregation operations. The aggregation framework enables users to obtain the kind of results for which the SQL GROUP BY clause is used.
  • References mongodb.org  nosql-database.org  db-engines.com  wikipedia.org  Carlo Vaccari’s lecture on Big Data 