Introduction to MongoDB

Post on 25-May-2015

1.112 views 0 download

Tags:

description

Presented during company meeting. This serves as an introduction to MongoDB and non-relational database architecture

Transcript of Introduction to MongoDB

Introduction to

Presenter: Faizan Mustafa

Agenda Document based database

MongoDB

MongoDB vs RDBMS

MongoDB Database Archtecture Document

Collection

Naming Convention

Sharding

Replication

Basic Query Syntax

Demo: Installation

Demo: Basic Querying

Document oriented database

Created over an abstract notation of a “document”

Key-value pair

Semi structured data

  {     FirstName: "Bob",     Address: "5 Oak St.",     Hobby: "sailing"  }

{    FirstName: "Jonathan",    Address: "15 Wanamassa Point Road",    Children:  [          {Name: "Michael", Age: 10},          {Name: "Jennifer", Age: 8},         {Name: "Samantha", Age: 5},          {Name: "Elena", Age: 2}     ]   }

MongoDB Humongous

Document oriented database using JSON document syntax

Features: Flexibilty

Power

Scaling

Ease of Use

Built-in Javascript

Clientele: Craigslist, eBay, Foursquare, SourceForge, and The New York Times.

MongoDB vs. RDBMS

RDBMS MongoDB

Database Database

Table Collection

Record Document

Index Index

Partition Shard

Foreign Key Reference

MongoDB vs. RDBMS

MongoDB Database Architecture Document:

{

_id: ObjectId("5099803df3f4948bd2f98391"),

name: { first: "Alan", last: "Turing" },

birth: new Date('Jun 23, 1912'),

death: new Date('Jun 07, 1954'),

contribs: [ "Turing machine", "Turing test", "Turingery" ],

views : NumberLong(1250000)

}

MongoDB Database Architecture Collection:

Logical group of documents

May or may not share same keys

Schema is dynamic/application maintained

Sharding (a.k.a Partitioning)

Replication

Replication

Naming Convention Dot notation

database_name.collection_name

‘embedded_document.key_name’

Selecting Data

Demo Time!

Questions?

Thank you