an introduction to nosql databases karol rástočný, eduard kuric
TRANSCRIPT
![Page 1: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/1.jpg)
AN INTRODUCTION TO NOSQL DATABASESKarol Rástočný, Eduard Kuric
![Page 2: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/2.jpg)
Motivation Not stable data
No fixed tables Big data
Horizontal scalability Distributed computing/querying
Concurrent access Consistency
2
![Page 3: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/3.jpg)
What is NoSQL? NoSQL = No + SQL More-accurately:
Not Only SQL NoRel – No relational
3
![Page 4: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/4.jpg)
NoSQL Databases - Classification
Sorted Ordered Column-Oriented Stores Key/Value Stores Document Databases Graph Databases
4
![Page 5: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/5.jpg)
Column-Oriented Stores Contrast with row-oriented RDBMS Data unit
Set of key(column)/value pairs Sorted by row-key (primary key)
Nulls are not stored Columns are organized in column-families
Name: FirstName, LastName, Location: Address, State, GPS
5
![Page 6: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/6.jpg)
Column-Oriented Stores Bigtable
Google HBase
Facebook, Yahoo!, Mahalo Hypertable
Zvents, Baidu, Redif Cloudata
6
![Page 7: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/7.jpg)
Key/Value Stores Idea
HashMap – fast O(1) access Data unit: Key/Value pair
Key – string Value
Basic types: int, string, … Collections of basic types: set, list, …
7
![Page 8: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/8.jpg)
Key/Value Stores Membase
Zynga, NHN Redis
Craigslist, Seznam, ALEF Dynamo
Amzon Cassandra
Facebok, Twitter, Digg Voldemort
8
![Page 9: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/9.jpg)
Document Databases Data unite:
Document = Object Stored as a whole (not fragmented)
JSON (BSON) notation Allows indexes on attributed
9
![Page 10: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/10.jpg)
Document Databases CouchDB
Apple, BBC, Cern, PeWeProxy MongoDB
Github, ForSquare, Shutterfly, Sourceforge
10
![Page 11: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/11.jpg)
Graph Databases Data unite:
Node with relations to incident nodes Representation
Set of triples – object, predicate, subject Set of pointers to incident nodes
11
![Page 12: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/12.jpg)
Graph Databases AllegroGraph
TwitLogic, Pfizer FlockDB
Twitter Neo4j
Box.net
12
![Page 13: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/13.jpg)
Use cases13
Access to attributes, computation over attributes Sorted ordered column-oriented stores
Temporal store, frequent add/remove operations Key/Value stores
Operations over whole objects Document databases
Relations store, deduction Graph databases
![Page 14: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/14.jpg)
Main Properties Data modeling Querying Scalability Consistency
14
![Page 15: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/15.jpg)
Data Modeling No standardized data model Sorted ordered column-oriented stores
Structure in class-families level Key/Value stores
Data structures of collections Document databases
Rudimentary “class” diagrams Graph databases
Graph schema definitions
15
![Page 16: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/16.jpg)
Querying MapReduce
Distributed computing and “views” generation Custom languages
Mostly based on JavaScript SQL-like languages
Apache Hive, HQL, CQL, SPARQL, … Language bindings
Apache Thrift, REST API, Java API, custom Drivers, …
16
![Page 17: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/17.jpg)
Scalability Multi-master replication Data partitioning (shards) Fraud tolerance Limits
Maximal number of rows, columns, column-families, documents, nodes, replicas, shards, …
Maximal size of index, data unit, …
17
![Page 18: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/18.jpg)
Consistency Strong Consistency
One master for write, multiple slaves for read
Eventual Consistency Multiple write masters Updates are propagated in low load phases
Consistency level Transaction, row, column, document, …
18
![Page 19: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/19.jpg)
Resources Tiwari, S.: Professional
NoSQL Comparison of NoSQL
databases (http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis)
Web sites of databases
19
![Page 20: AN INTRODUCTION TO NOSQL DATABASES Karol Rástočný, Eduard Kuric](https://reader036.vdocuments.us/reader036/viewer/2022081512/56649e155503460f94b00182/html5/thumbnails/20.jpg)
Upcoming Presentations Cassandra – Eduard Kuric CouchDB – PeWeProxy team Graph Databases – Michal Holub MongoDB – Karol Rástočný Redis – Alef team
and a lot more (board is opened for everyone )
20