NoSQL DB
NoSQL DB
NoSQL
Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Instructor
Aula Magna –Eric
Rettorato
Umuhoza, PhD
Mercoledì 27 maggio 2015
[email protected]
@EricUmuhoza
NoSQL History
2000
2010
Relational Databases - Advantages
1980
1990
Object Databases
2000
2010
NoSQL History
1980
1990
Relational DBMS continued to dominate over
OODB
2000 Integration DB
o Multiple applications storing their data in a
shared DB
2010
o Improves communication
NoSQL History
How to cope with lots of traffic generated by websites and social media
applications?
o Scale up (bigger machines, more processors, disk storage, and memory)
o Use lots of small machines in a cluster
Relational databases are not designed to run efficiently on clusters
o Alternative route to data storage
2007:
o The research paper on Amazon Dynamo is released
o The document database MongoDB is started
2008:
o Cassandra project
o Voldemort
The #NoSQL Story
A meetup
o Johan Oskarssonin SF, CA, June 2009
A hashtag: #nosq
BUT
Carlo Strozzi used the term NoSQL in 1998 to name his lightweight, open-
source relational database that did not expose the standard SQL
interface.
Definition
Non- relational
o They don’t use the relational data model and
thus don’t use the SQL language
Cluster-friendly
o They tend to be designed to run on a cluster
Open Source
Schema-less
o They don’t have a fixed schema
o They allow you to store any data in any record
NoSQL Originators
Key-Value Store
o A key that refers to a payload (actual content /
data)
o MemcacheDB, Azure Table Storage, Redis
Column Store
o Column data is saved together, as opposed to
row data
o Super useful for data analytics
o Hadoop, Cassandra, Hypertable
Different Types of NoSQL
Graph Store
o Nodes are stored independently, and the
relationship between nodes (edges) are stored
with data
o Neo4j
Key-Value
Key
100
215
325
Key-Value
information about it
amazon.com item number
Column Storage
Row-store Column-store
Usually in JSON
Graph databases
organize data into
node and edge graphs
They work best for
data that has complex
relationship structures!
o How about relational
database?
o Relation doesn’t
mean relationship
Classification of NoSQL
Classification of NoSQL
Key Value CRUD Operations
o get(key)
o delete(key)
Example of NoSQL System: MongoDB
NoSQL pros
o Data modeling can be an iterative process
o Linear scaling occurs as nodes are added to the cluster
o Native integration of Map/Reduce Frameworks and Full-
text search engines
o Easy and efficient storage of high-variable data
Conclusions
NoSQL “cons”
o Implicit schema at the application level
o Applications need to check for consistency and integrity constraints
o No transactions (across multiple objects), conflict resolution must
be done by the client application
o ACID transactions are limited to just one element (row, document,
entity, etc.) in contrast with RDBMS
o 2nd generation NoSQL or NewSQL databases try to cope with this problem
o Data models and query languages are proprietary and create
vendor lock-in
o Data structure is chosen upfront, based on the queries that will be
expressed.
o If queries change also data need to be changed