Document Database

Post on 27-Jan-2015

109 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

Describe NoSQL database and focused on document database

Transcript

Distributed Database Document Database

What’s Document

• Documents are the main concept in document databases.

• A document in a document database is simply an entity that contains a collection of named fields

• It can be :• XML• JSON• BSON• And so on ..

Designing Document Database

• Modeling Data as Documents• JSON, BSON, XML …

• Denormalizing Documents and Embedding Data• Normalizing Documents and Referencing Data• Handling Complex Relation• Retrieving Data and Indexing Documents• Summarizing Data by Using Materialized Views

Materialized Views

Oracle vs MongoDB

Features

• Consistency• Replica Set

• Transaction• Availability • Query • Scaling

Replica Set

Suitable Use Case

• Event Logging• Content Management Systems, Blogging Platforms

• Web Analytics or Real-Time Analytics• E-Commerce Applications

When Not to Use

• Complex Transactions Spanning Different Operations

• Queries against Varying Aggregate Structure

Sample Document• {  "firstname": "Pramod",  "citiesvisited": [ "Chicago", "London", "Pune", "Bangalore" ],  "addresses": [    { "state": "AK",      "city": "DILLINGHAM",      "type": "R"    },    { "state": "MH",      "city": "PUNE",      "type": "R" }  ],  "lastcity": "Chicago"}

Popular Document Database• MongoDB• CouchDB• Terrastore• OrientDB• RavenDB

Sample Case – Product Catalog

Sample Case – Order History

Sample Architecture

MongoDB

MongoDB Tools• mongo, mongod• mongoimport, mongoexport

• Export and import data as JSON or CSV

• mongodump, mongorestore, bsondump• Create and restore binary export

• mongostat• Overviewing the status of the MongoDB server

top related