What is NoSQL Database Management System Various Data Models Type of NoSQL DBMS Why NoSQL DBMS? Beyond NoSQL Bibliography NoSQL Database Sparsa Roychowdhury IIEST,Shibpur March 19, 2014 Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
NoSQL Database
Sparsa Roychowdhury
IIEST,Shibpur
March 19, 2014
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Outline
1 What is NoSQL Database Management System
2 Various Data Models
3 Type of NoSQL DBMS
4 Why NoSQL DBMS?
5 Beyond NoSQL
6 Bibliography
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
What is NoSQL?
NoSQL
NoSQL encompasses a wide variety of different databasetechnologies and were developed in response to a rise in the volumeof data stored about users, objects and products, the frequency inwhich this data is accessed, and performance and processing needs.Next Generation Databases mostly addressing some of the points:
1 non-relational
2 distributed
3 open-source
4 horizontally scalable
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Various Data Models I
Data Model
A data model is the model through which we perceive andmanipulate our data. For people using a database, the data modeldescribes how we interact with the data in the database.
Relational Data Model
The relational model takes the information that we want to storeand divides it into tuples.
Tuple being a limited Data Structure it captures a set of valuesand can’t be nested. This gives Relational Model a space ofdevelopment.
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Various Data Models II
Aggregate Model
Aggregate is a term that comes from Domain-Driven Design, anaggregate is a collection of related objects that we wish to treat asa unit, it is a unit for data manipulation and management ofconsistency.
1 Atomic property holds within an aggregate
2 Communication with data storage happens in unit ofaggregate
3 Dealing with aggregate is much more efficient in clusters
4 It is often easier for application programmers to work withaggregates
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Type of NoSQL DBMS
There are mainly four types of NoSQL Database systems these are:
1 Key-value Stores
2 Document Databases
3 Wide Column Stores
4 Graph Stores
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Key-Value Databases
Key-value store
A key-value store is a simple hash table, primary used when allaccess to the database is via primary key.
1 Key-value stores are the simplest NoSQL data stores to usefrom an API perspective
2 The client can either get the value, put the value or delete akey from the data store.
3 The value is just a blob that the data just stores
4 Application has the responsibility to understand what is stored
5 Have great performance and easily scaled
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Example: I
There are many available key-value stores available in the marketsome of them are:
1 Riak
2 Redis
3 Memcached DB
4 Berkeley DB
5 Hamster DB (especially suited for embedded use)
6 Amazon Dynamo DB (not open source)
7 Project Voldemort (Open Source Implementation of DynamoDB)
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Example: II
The basic comparison between the terminology between Oracleand Riak is given below.
Difference between the terminology of Oracle and Riak
Oracle RiakDatabase instance Riak cluster
table bucket
row key-value
rowid key
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Document Databases
Document Stores
Documents are the main concept in document databases. Thedatabase stores and retrieves documents, which can be XML,JSON, BSON, and so on.
The documents stored are similar to each other but do nothave to be exactly the same.
Document databases store documents in the value parts ofthe key
Document stores can be thought as key-value stores wherethe value is examinable
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Example: I
There are many available Document Databases available in themarket some of them are:
1 MongoDB
2 CouchDB
3 Terrastore
4 OrientDB
5 RavenDB
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Example: II
The basic comparison between the terminology between Oracleand MongoDB is given below.
Difference between the terminology of Oracle and MongoDB
Oracle MongoDBDatabase instance MongoDB instance
Schema Database
table Collection
row Document
rowid id
Join DBref
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Column-family stores
Column-family stores
Column-family stores allow you to store data with keys mapped tovalues and the values grouped into multiple column families, whereeach column family being a map of data.
Column-family databases store data in column families as rows
They have many columns associated with a row key
Column families are groups of related data that is oftenaccessed together
The basic unit of storage in Column-family databases is acolumn
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Example: I
There are many available Column-family Databases available in themarket some of them are:
1 Cassandra
2 HBase
3 Hypertable
4 Amazon Simple DB
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Example: II
The basic comparison between the terminology between RDBMSand Cassandra is given below.
Difference between the terminology of RDBMS and Cassandra
RDBMS CassandraDatabase instance cluster
Database Keyspace
table Column Family
row row
Column (same for all rows) Column (can be different per row)
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Graph Stores
Graph Store Database
Graph databases are one style of NoSQL databases that uses adistribution model similar to relational databases but offers adifferent data model that makes it better at handling data withcomplex relationships.
Entities are also known as nodes, which have properties
Nodes are organized by relationships which allows to findinteresting patterns between the nodes
The organization of the graph lets the data to be stored onceand then interpreted in different ways based on relationships
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Example: I
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Key-Value DatabasesDocument DatabasesColumn-family storesGraph Stores
Example: II
There are many available graph Databases available in the marketsome of them are:
1 Neo4J
2 Infinite Graph
3 OrientDB
4 FlockDB
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Schema MigrationsPolyglot PersistenceImpedance MismatchAuto Sharding
Why NoSQL DBMS?
Why NoSQL
When compared to relational databases, NoSQL databases aremore scalable and provide superior performance, and their datamodel addresses several issues that the relational model is notdesigned to address:
1 Schema Migrations
2 Polyglot Persistence
3 Impedance Mismatch
4 Auto Sharding architecture
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Schema MigrationsPolyglot PersistenceImpedance MismatchAuto Sharding
Schema Migration
Schemaless nature
The recent trend in discussing NoSQL databases is to highlighttheir schemaless nature, it is a popular feature that allowsdevelopers to concentrate on the domain design without worryingabout schema changes.
with NoSQL databases, in some cases the schema does nothave to be thought about beforehand
The claim that NoSQL databases are entirely schemaless ismisleading
they store the data without regard to the schema the dataadheres to, that schema has to be defined by the application
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Schema MigrationsPolyglot PersistenceImpedance MismatchAuto Sharding
Polyglot Persistence
The point of view of using different data stores in differentcircumstances is known as Polyglot Persistence
Most organization has mix of storage technologies for differentcircumstances
Using a single database engine for all of the requirementsusually leads to non- performant solutions
Storing transactional data, caching session information,traversing graph of customers and the products their friendsbought are essentially different problems
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Schema MigrationsPolyglot PersistenceImpedance MismatchAuto Sharding
Impedance Mismatch
Impedance Mismatch
Impedance Mismatch means the difference between data modeland in memory data structures.
The impedance mismatch is a major source of frustration toapplication developers
Many people believed that it would lead to relationaldatabases being replaced with databases that replicate thein-memory data structures to disk
Object-Oriented Database failed to show the potential toreduce the gap
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Schema MigrationsPolyglot PersistenceImpedance MismatchAuto Sharding
Auto Sharding
Auto Sharding
NoSQL databases usually support auto-sharding, meaning thatthey natively and automatically spread data across an arbitrarynumber of servers, without requiring the application to even beaware of the composition of the server pool
Because of the way they are structured, relational databasesusually scale vertically
This gets expensive quickly, places limits on scale, and createsa relatively small number of failure points for databaseinfrastructure
The solution is to scale horizontally, by adding servers insteadof concentrating more capacity in a single server.
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Beyond NoSQL
NoSQL databases we have discussed here is only part of thepicture of polyglot persistence.
Recent attention to clustered environments has seen a rise ofdistributed file systems. Technologies like the Google FileSystem and Hadoop
We think of XML databases as document databases where thedocuments are stored in a data model compatible with XML
NoSQL is just one set of data storage technologies, we shouldconsider other data storage technologies whether or not theybear the NoSQL label.
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Bibliography
Pramod J. Sadalage, Martin Fowler NoSQL Distilled: A BriefGuide to the Emerging World of Polyglot Persistence AddisonWesley, Massachusetts, 2013
http://www.mongodb.com/learn/nosql
http://www.wikipedia.org
Sparsa Roychowdhury NoSQL Database
What is NoSQL Database Management SystemVarious Data Models
Type of NoSQL DBMSWhy NoSQL DBMS?
Beyond NoSQLBibliography
Thank You!
Sparsa Roychowdhury NoSQL Database