No SQL
No SQL
NoSQL
MOHAMMAD HOSSEIN SHOJAEINIA
2
History of databases(a little basics)
Atomicity
All of a transaction will be done, or nothing of it
Consistency
Any transaction that is done, must be valid (transmit DB from a valid state, to
another)
Isolation
Concurrent transactions must not affect each other
Durability
Makes sure if a transaction is committed, the result will remain at any
circumstances
6
What?
Pros?
NoSQL Cons?
A.KA Object-Oriented model!!!
7
NoSQL
Document
MongoDB, Apache CouchDB, IBM Domino
Key/Value
Amazon DynamoDB, Oracle NoSQL DB, Redis
Graph
Apache Giraph, Neo4J, ArangoDB
9
NoSQL
10
NoSQL vs Relational
Simple comparison:
NoSQL Relational
Database Database
Collection Table
ODM ORM
13
ORM? ODM?
14
Class like!
class User{
int id;
String name;
ArrayList<Post> posts;
ArrayList<Like> likes;
ArrayList<Comments> comments;
}
15
Database like!(Relational)
16
Database like!(NoSQL)
{
"_id" : ObjectId("58e38f64308976031f2eb4e1"),
“name”:”Mohammad Hossein Shojaeinia” ,
“posts”:[
…
]
“likes”:[
…
]
…
}
17
Which one?
NoSQL? Relational?
Consistency
Every read gets the most recent write (or an error)
Availability
Every request gets a response(not error, response!)
Partitioning-tolerance
System continues working even if any number of messages being
dropped or delayed
19
CAP theorem, cont’d
C A
P
20
CAP theorem, cont’d
Let’s design!
23
24
25
“
Questions?
”
26
“
Thanks for attention!
”
Provided by AytenSoft
aytensoft.ir