mongoDB: Why it should (not) replace your SQL database?

2,598 views

Published on

Can MongoDB replace SQL, one of the most popular database model in the world? Are we going to not use relational data models in future? The aim of the presentation is to present basic information about the noSQL and MongoDB. It tries to answer this questions by showing interesting possibilites of this noSQL database.

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
2,598
On SlideShare
0
From Embeds
0
Number of Embeds
1,678
Actions
Shares
0
Downloads
63
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

mongoDB: Why it should (not) replace your SQL database?

  1. 1. Maciej Miara, April 2014
  2. 2. • Non-relational database model • Easy horizontal scalability • Different data structures: - key-value store - key-value cache - object database - document store - graph store - wide-column store • Denormalization
  3. 3. • • •
  4. 4. • • • • Data structure
  5. 5. Data structure
  6. 6. • • Object ID ObjectId("507f191e810c19729de860ea") Seconds since the Unix epoch Machine identifier Process id Counter, starts with random value
  7. 7. • • • • Schema
  8. 8. • • • Schema
  9. 9. Schema Second query confirms, that mongo returns null, when attribute is not found in document
  10. 10. • • Querying embedded data
  11. 11. Querying embedded data
  12. 12. • • • • db.createCollection("log", { capped : true, size : 5242880, max : 5000 } ) • Good for logs or temporary data Capped collections
  13. 13. • • • • • Map-Reduce
  14. 14. • • • • • • Indexes
  15. 15. • • • • Geospatial indexes
  16. 16. • • • • • • • Geospatial queries
  17. 17. Geospatial queries - examples Source: http://docs.mongodb.org
  18. 18. • • • • • • Full text search
  19. 19. Full text search Supported languages: danish, dutch, english, finnish, french, german, hungarian, italian, norwegian, portuguese, norwegian, rommanian, russian, spanish, swedish, turkish Source: http://docs.mongodb.org
  20. 20. Sharding • • • •
  21. 21. Sharding Source: http://docs.mongodb.org
  22. 22. • • • • • • GridFS
  23. 23. • • • • Javascript driven
  24. 24. • • • • ACID
  25. 25. • • • Transaction system
  26. 26. • • • • Journaling
  27. 27. • • • • • Write concern
  28. 28. Unacknowledged Source: http://docs.mongodb.org
  29. 29. Acknowledged Source: http://docs.mongodb.org
  30. 30. Journal acknowledged Source: http://docs.mongodb.org
  31. 31. Replica acknowledged Source: http://docs.mongodb.org
  32. 32. Some people complain about Mongo, but…
  33. 33. …they just don’t know, why they chose it
  34. 34. • „My friend from studies used it” • „I was just curious” • „Recommended by other company (in their project it worked well)” • „Technical (!) client wanted it” • „After all-night long party I decided to use it” • „I heard that Microsoft/Google/NYT/(fill in any corpo you want) uses it”
  35. 35. Do NOT use Mongo, if you: • like joins • Need really transactional system • Have relational data • Want full ACID without any compromises
  36. 36. Any questions? maciej.miara@gmail.com

×