Brief overview of NoSQL & MongoDB for GTUG Tbilisi Event

1,015 views
911 views

Published on

Brief overview of NoSQL & MongoDB for GTUG Tbilisi Event

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,015
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Brief overview of NoSQL & MongoDB for GTUG Tbilisi Event

  1. 1. NoSQL Ioseb Dzmanashvili Lead Architect @ Picktek Teacher @ Caucasus School of TechnologyMonday, April 2, 2012
  2. 2. NoSQL is a ill-defined and volatile field © Martin FowlerMonday, April 2, 2012
  3. 3. It actually means: Not Only SQLMonday, April 2, 2012
  4. 4. NoSQL SQL MongoDB MySql CouchDB Oracle Redis M$SQL Neo4j PostgreSQL Cassandra SQLiteMonday, April 2, 2012
  5. 5. NoSQL Kinds • Document Oriented • Key Value Oriented • Graph Oriented • ... • Something else OrientedMonday, April 2, 2012
  6. 6. Other NoSQL Characteristics • No Relational Structures • No JOIN Queries • No Schema • No Complex TransactionsMonday, April 2, 2012
  7. 7. MongoDB open-source, high-performance, document-oriented database © MongoDBMonday, April 2, 2012
  8. 8. Why MongoDB? It is not the strongest of the species that survives, nor the most intelligent. It is the one that is most adaptable to change. © Charles DarwinMonday, April 2, 2012
  9. 9. Flexible Structure db.blogposts.insert({ name: "ioseb", date: "2012-04-01", title: "NoSQL Sucks", summary: "Yes it Sucks", content: "..." });Monday, April 2, 2012
  10. 10. Flexible Structure db.blogposts.update({ name: "ioseb" }, { name: "ioseb", date: "2012-04-01", title: "NoSQL is Cool!", summary: "Yes its Cool!", content: "...", tags: [ "nosql", "sql" ] } );Monday, April 2, 2012
  11. 11. Flexible Structure var comment = { name: "john doe", email: "john@doe.com", comment: "NoSQL Rulez!!!" }; db.blogposts.update({ name: "ioseb" }, { $push: { comments: comment } } );Monday, April 2, 2012
  12. 12. Flexible Structure var post = db.blogposts.find( {name: "ioseb"} );Monday, April 2, 2012
  13. 13. Flexible Structure { name: "ioseb", date: "2012-04-01", title: "NoSQL is Cool!", summary: "Yes its Cool!", content: "...", tags: [ "nosql", "sql" ], comments: [ {author: "john", email: "john@doe.com", ...} ] }Monday, April 2, 2012
  14. 14. Flexible Indexing // index by name db.blogposts.ensureIndex( {name: true} ); // index by tags array db.blogposts.ensureIndex( {tags: true} ); // index by comments authors db.blogposts.ensureIndex( {"comments.author": true} );Monday, April 2, 2012
  15. 15. Replica Sets • Asynchronous master/slave replication • Automatic failover • Automatic recovery • Consists of two or more nodes • Automatic primary node electionMonday, April 2, 2012
  16. 16. ...Replica Sets Member 2 Member 1 Read Member 3 Primary Read/Write ClientMonday, April 2, 2012
  17. 17. Easy Configuration config = {_id: GTUG, members: [ {_id: 0, host: localhost:27017}, {_id: 1, host: localhost:27018}, {_id: 2, host: localhost:27019} ]} rs.initiate(config);Monday, April 2, 2012
  18. 18. ...Replica Sets Arbiter Member 2 Arbiter No Data Member 1 Read Member 3 Primary Read/Write ClientMonday, April 2, 2012
  19. 19. Easy Configuration config = {_id: GTUG, members: [ {_id: 0, host: localhost:27017}, {_id: 1, host: localhost:27018}, {_id: 2, host: localhost:27019, arbiterOnly: true} ]} rs.initiate(config);Monday, April 2, 2012
  20. 20. Questions?Monday, April 2, 2012
  21. 21. Thank You!Monday, April 2, 2012

×