NoSQL
THE NEW ERA OF
INTERPRETING DATA
NAME:- AJAYKANT C. JHA
EXAM NO:- 2845
3rd
Year B.C.A, 6th
Semester
S.D.J INTERNATIONAL COLLEGE
1
Content
2
 Origination
 What is NoSQL ?
 NoSQL: Main Categories
 Pros and Cons of NoSQL
 RDBMS VS NoSQL
 Performance
 Comparisons
 Summary
 Bibliography
Origination
3
• 1998 –
• Carlo Strozzi used the term NoSQL to name its
lightweight open-source relational DB with no SQL
interface.
• Strozzi suggests NoREL referring to ‘No Relational’
• 2009 –
• Eric Evans reintroduced the terms NoSQL when Johan
Oskarsson of Last.fm wanted to organize an event to
discuss open source distributed databases.
What is NoSQL ?
4
• NoSQL is an approach towards data store about users,
objects and products, the frequency in which this data is
accessed, and performance and processing needs.
• Actually Not only SQL
• Eventually consistent, depends…
• RDBMS is based on ACID Theorem but NoSQL is based
on CAP Theorem
NoSql : Main Categories
5
Key-Value Stores
6
• Data Model:
• Global collection of Key/Value pairs
• Support relationship but with each table having only two columns
• Every item in the database is stored in the pairs of keys(Indexes) and
values
• Key is used to access Value
• Value contains blobs with keys without joins
• E.g a gaming website that constantly updates the top 10 scores and players
Blob datatype
String dataype
7
• A table with two columns and a simple
interface
• Get(key), returns the value associated
with the provided key.
• Put( key, value), associates the value
with the key
• Multi-get (key1,key2,…,keyN), returns
the list of values associated with the list
of keys.
• Delete (key), removes the entry for the
key from data store.
Key
Valu
e
Key
Key-Value Stores
Key-Value Stores
8
The Locker Metaphor
Key-Value Stores
9
Key-Values Stores are Like Dictionaries
The “key” is just the word “gouge” The “value” is all the definitions and images
Key-Value Stores
10
No Subset Queries in Key-Value Stores
• Traditional Relational Model
• Result set based on row values
• Values of rows for large data sets must be indexed
• Values of columns must all have the same data type
• Key-Value Store Model
• All queries return a single item
• No indexes on values
• Values may contain any data type
Key-Value Stores
11
• Pros:
• Scalable
• Simple Data Model (Get, Put, Multi-get, Delete)
• Cons:
• No way to query based on the content of the value
• Cannot update the value of the key
• No relationship, create your own foreign keys
• Not suitable for complex data
Wide Column Store
12
• Data Model :
• Rows and Columns
• It is also known as Column Family Store
• Stores data tables as sections of columns of data rather than
as rows of data that have many columns associated with a
row key
• Column families are groups of related data that is often
accessed together
Wide Column Store
13
• There are two types of Column Families:
• Standard Column Family: Consists of a key value pair,
where the key is mapped to a value that is set of columns.
• Super Column Family: Consists of a key-value pair,
where the key is mapped to a value that are column
families.
Wide Column Store
14
Use a combination of Row and Column as a Key
Column ID
Row ID
Key
Row
Number
Column
Number
Value
Wide Column Store
15
Key
• Systems have keys that include Row ID, Column Family,
Column Name and Timestamp
• Key is permanent name of the record.
• Each key is associated with multiple Columns and includes
a row, column family and column name
• Timestamps contains the last modified value
• Values are just ordered bytes and have no strongly typed
data system
Timestamp Value
Column
Name
Column
Family
Row ID
Wide Column Store
16
Col1 Col100000
Wide Column Store
17
Table
Super
Col X
Super
Col Y
Fam1
Col-BCol-A
Fam2
• Column Families are created when a
table is created
• Column Family is how the data is stored
on the disk
• Group columns into “Column families”
• Column Family can contains Columns
and Super Columns
• Super column contains other columns but
not super columns
Wide Column Store
18
• Pros:
• Scalable
• Queries can be done on rows, column families and column names
• Store blobs in one large table
• Cons:
• Cannot query blob content, row and column
• Not suitable for relational data
Document Store
19
• Data Model :
• Collections of key value collection
• Good at handling content management, profile management
• Eventual consistency
• Similar to a Key/Value database but with a major difference
between, Values are stored in structured documents in nested
hierarchies which provide some structure and encoding of
the data
Document Store
20
Darker lines mean
“required” and Light lines
mean “optional elements”
Books can have 0 to many
author- names
<books> is our root element
Format and license
elements are codes
that must be in a
fixed list of choices
books> contain Each <book> only valid URL characters
a sequence of one contains the
to many <book> following sequence
Elements of elements
Must be a valid decimal number
Id
Type: xs.string
title
Type: xs.string
author-name
Type: xs.string
format-code
Type: format-code-type
list-price
Type: xs.decimal
url
Type: xs.anyURL
isbn
Type: xs.string
license code
Type: license code-type
description
Type: xs.string
bookbooks . .
Document Store
21
• Pros
• Simple & Powerful Data model
• Scalable
• Any number of fields can be added
• Any item in the document can be queried
• Each document in the document store is independent and there is
relational integrity
• Cons
• Not suitable for relational data
• Querying limited to keys & Indexes
Graph Store
22
• Data Model:
• Nodes
• Edges between Nodes
• Properties
• These databases uses edges and nodes to represent and store
data.
• These nodes are organised by some relationships with one
another, which is represented by edges between the nodes
• Both the nodes and the relationships have some defined
properties
Graph Store
23
• Used when the relationship and relationships types between
items are critical
• Focused on modelling the structure of the data-
interconnectivity
• Data is stored in a series of nodes, relationship and
properties
• Ideal when relationships between data is key: E.g Social
Networks
Graph Store
24
Nodes are “joined” to create graphs
Has-Author
Has-Name
Has-Author Has-Name
Book
Person
123
Person
123
“Dan”Book
“Dan”
Person
123
Wide Column Store
25
• Pros:
• Connected data is locally indexed
• Extremely powerful
• Cons:
• Difficult to scale up
Pros of NoSQL
26
Cons of NoSQL
27
• Need whole value from the key; to read / write any partial
information
• Data store is merely a storage layer cannot be used to
generate report
• Not recognized by ISO
• Response time, depends on each solution
RDBMS vs. NoSQL
28
NoSQL is real and it’s here to stay
Performance
29
Data Model Performance Flexibility Complexity Functionality
Key-Value
store
High High None Variable
(none)
Wide Column
Store
High Moderate Low Minimal
Document
Store
High High Low Variable (low)
Graph Store Variable High High Graph theory
Relational
Store
Variable Low Moderate Relational
Algebra
.
Comparisons
30
SQL Databases NoSQL Databases
Types One type with minor
variations
Many different types
Development
history
1970 2009
Data Individual records are
stored much like
spreadsheets
Varies based on database type
Scaling DBA is must DBA may be required
Development
model
Mix of open source Open source
SUMMARY
31
• Pick right data model for right problem
• Pick the right tool for right job
• Understand the data storage
• Compare pros and cons
• NoSQL is a great tool for solving data availability problems
Bibliography
32
• http://manning.com/mccreary
• http://NoSQLNOW.com
• http://Pass.ly/NoSQLTechGuide
• http://en.wikipedia.org/wiki/NoSQL
• http://vineetgupta.com/2010/01/nosql-database-part-1-
landscape.html
• http://venublog.com
• http://nosql.mypopescu.com/
• http://highscalability.com/
• http://scalein.com
33
Questions ?
34
THANK YOU

No sql or Not only SQL

  • 1.
    NoSQL THE NEW ERAOF INTERPRETING DATA NAME:- AJAYKANT C. JHA EXAM NO:- 2845 3rd Year B.C.A, 6th Semester S.D.J INTERNATIONAL COLLEGE 1
  • 2.
    Content 2  Origination  Whatis NoSQL ?  NoSQL: Main Categories  Pros and Cons of NoSQL  RDBMS VS NoSQL  Performance  Comparisons  Summary  Bibliography
  • 3.
    Origination 3 • 1998 – •Carlo Strozzi used the term NoSQL to name its lightweight open-source relational DB with no SQL interface. • Strozzi suggests NoREL referring to ‘No Relational’ • 2009 – • Eric Evans reintroduced the terms NoSQL when Johan Oskarsson of Last.fm wanted to organize an event to discuss open source distributed databases.
  • 4.
    What is NoSQL? 4 • NoSQL is an approach towards data store about users, objects and products, the frequency in which this data is accessed, and performance and processing needs. • Actually Not only SQL • Eventually consistent, depends… • RDBMS is based on ACID Theorem but NoSQL is based on CAP Theorem
  • 5.
    NoSql : MainCategories 5
  • 6.
    Key-Value Stores 6 • DataModel: • Global collection of Key/Value pairs • Support relationship but with each table having only two columns • Every item in the database is stored in the pairs of keys(Indexes) and values • Key is used to access Value • Value contains blobs with keys without joins • E.g a gaming website that constantly updates the top 10 scores and players
  • 7.
    Blob datatype String dataype 7 •A table with two columns and a simple interface • Get(key), returns the value associated with the provided key. • Put( key, value), associates the value with the key • Multi-get (key1,key2,…,keyN), returns the list of values associated with the list of keys. • Delete (key), removes the entry for the key from data store. Key Valu e Key Key-Value Stores
  • 8.
  • 9.
    Key-Value Stores 9 Key-Values Storesare Like Dictionaries The “key” is just the word “gouge” The “value” is all the definitions and images
  • 10.
    Key-Value Stores 10 No SubsetQueries in Key-Value Stores • Traditional Relational Model • Result set based on row values • Values of rows for large data sets must be indexed • Values of columns must all have the same data type • Key-Value Store Model • All queries return a single item • No indexes on values • Values may contain any data type
  • 11.
    Key-Value Stores 11 • Pros: •Scalable • Simple Data Model (Get, Put, Multi-get, Delete) • Cons: • No way to query based on the content of the value • Cannot update the value of the key • No relationship, create your own foreign keys • Not suitable for complex data
  • 12.
    Wide Column Store 12 •Data Model : • Rows and Columns • It is also known as Column Family Store • Stores data tables as sections of columns of data rather than as rows of data that have many columns associated with a row key • Column families are groups of related data that is often accessed together
  • 13.
    Wide Column Store 13 •There are two types of Column Families: • Standard Column Family: Consists of a key value pair, where the key is mapped to a value that is set of columns. • Super Column Family: Consists of a key-value pair, where the key is mapped to a value that are column families.
  • 14.
    Wide Column Store 14 Usea combination of Row and Column as a Key Column ID Row ID Key Row Number Column Number Value
  • 15.
    Wide Column Store 15 Key •Systems have keys that include Row ID, Column Family, Column Name and Timestamp • Key is permanent name of the record. • Each key is associated with multiple Columns and includes a row, column family and column name • Timestamps contains the last modified value • Values are just ordered bytes and have no strongly typed data system Timestamp Value Column Name Column Family Row ID
  • 16.
  • 17.
    Wide Column Store 17 Table Super ColX Super Col Y Fam1 Col-BCol-A Fam2 • Column Families are created when a table is created • Column Family is how the data is stored on the disk • Group columns into “Column families” • Column Family can contains Columns and Super Columns • Super column contains other columns but not super columns
  • 18.
    Wide Column Store 18 •Pros: • Scalable • Queries can be done on rows, column families and column names • Store blobs in one large table • Cons: • Cannot query blob content, row and column • Not suitable for relational data
  • 19.
    Document Store 19 • DataModel : • Collections of key value collection • Good at handling content management, profile management • Eventual consistency • Similar to a Key/Value database but with a major difference between, Values are stored in structured documents in nested hierarchies which provide some structure and encoding of the data
  • 20.
    Document Store 20 Darker linesmean “required” and Light lines mean “optional elements” Books can have 0 to many author- names <books> is our root element Format and license elements are codes that must be in a fixed list of choices books> contain Each <book> only valid URL characters a sequence of one contains the to many <book> following sequence Elements of elements Must be a valid decimal number Id Type: xs.string title Type: xs.string author-name Type: xs.string format-code Type: format-code-type list-price Type: xs.decimal url Type: xs.anyURL isbn Type: xs.string license code Type: license code-type description Type: xs.string bookbooks . .
  • 21.
    Document Store 21 • Pros •Simple & Powerful Data model • Scalable • Any number of fields can be added • Any item in the document can be queried • Each document in the document store is independent and there is relational integrity • Cons • Not suitable for relational data • Querying limited to keys & Indexes
  • 22.
    Graph Store 22 • DataModel: • Nodes • Edges between Nodes • Properties • These databases uses edges and nodes to represent and store data. • These nodes are organised by some relationships with one another, which is represented by edges between the nodes • Both the nodes and the relationships have some defined properties
  • 23.
    Graph Store 23 • Usedwhen the relationship and relationships types between items are critical • Focused on modelling the structure of the data- interconnectivity • Data is stored in a series of nodes, relationship and properties • Ideal when relationships between data is key: E.g Social Networks
  • 24.
    Graph Store 24 Nodes are“joined” to create graphs Has-Author Has-Name Has-Author Has-Name Book Person 123 Person 123 “Dan”Book “Dan” Person 123
  • 25.
    Wide Column Store 25 •Pros: • Connected data is locally indexed • Extremely powerful • Cons: • Difficult to scale up
  • 26.
  • 27.
    Cons of NoSQL 27 •Need whole value from the key; to read / write any partial information • Data store is merely a storage layer cannot be used to generate report • Not recognized by ISO • Response time, depends on each solution
  • 28.
    RDBMS vs. NoSQL 28 NoSQLis real and it’s here to stay
  • 29.
    Performance 29 Data Model PerformanceFlexibility Complexity Functionality Key-Value store High High None Variable (none) Wide Column Store High Moderate Low Minimal Document Store High High Low Variable (low) Graph Store Variable High High Graph theory Relational Store Variable Low Moderate Relational Algebra .
  • 30.
    Comparisons 30 SQL Databases NoSQLDatabases Types One type with minor variations Many different types Development history 1970 2009 Data Individual records are stored much like spreadsheets Varies based on database type Scaling DBA is must DBA may be required Development model Mix of open source Open source
  • 31.
    SUMMARY 31 • Pick rightdata model for right problem • Pick the right tool for right job • Understand the data storage • Compare pros and cons • NoSQL is a great tool for solving data availability problems
  • 32.
    Bibliography 32 • http://manning.com/mccreary • http://NoSQLNOW.com •http://Pass.ly/NoSQLTechGuide • http://en.wikipedia.org/wiki/NoSQL • http://vineetgupta.com/2010/01/nosql-database-part-1- landscape.html • http://venublog.com • http://nosql.mypopescu.com/ • http://highscalability.com/ • http://scalein.com
  • 33.
  • 34.