softacad bg nikolay tomitov co ceo at softacad learning
play

www.softacad.bg Nikolay Tomitov - Co-CEO at SoftAcad learning - PowerPoint PPT Presentation

www.softacad.bg Nikolay Tomitov - Co-CEO at SoftAcad learning center. Danail Alexiev Software Consultant at Axway, lector at SoftAcad learning center. www.softacad.bg 1. Document oriented databases 2. Introduction to JSON data format


  1. www.softacad.bg

  2. � Nikolay Tomitov - Co-CEO at SoftAcad learning center. � Danail Alexiev – Software Consultant at Axway, lector at SoftAcad learning center. www.softacad.bg

  3. 1. Document oriented databases 2. Introduction to JSON data format 2. Introduction to JSON data format 3. Meet CouchDB 4. Meet MongoDB 5. CouchDB vs. MongoDB 6. Demo www.softacad.bg

  4. Documental Databases Relational Databases www.softacad.bg

  5. www.softacad.bg

  6. www.softacad.bg

  7. Introduction to CouchDB 1. Create, Update, Remove, Query Operations Create, Update, Remove, Query Operations 2. 2. Views & Aggregation 3. Concurrency 4. Replication 5. Pros and cons 6. Resources Resources 7. 7. www.softacad.bg

  8. � Data is stored and returned in JSON format � Data is stored and returned in JSON format � Queried via HTTP RESTful API � Index building language: Javascript � Simple and intuitive interface www.softacad.bg

  9. { "_id": "debd7e7385464f4874dd2a38043f7825", "_rev": "3-839e43865b653a1ed73c3d21cc17c5dd", "name": "Homer", "last_names": ["Simpson", "Duff"], "phone_numbers": { "mobile": "555-666-777", “work": "666-777-555“, “work": "666-777-555“, "bar": "777-666-555“ }, "interests": ["beer", "donuts", "couches"] } www.softacad.bg

  10. Key www.softacad.bg

  11. Create: • • • HTTP PUT /db/test HTTP PUT /db/test Read: • • HTTP GET /db/test Update: • • HTTP PUT /db/test Delete: • • HTTP DELETE /db/test www.softacad.bg

  12. � Views: the way to arrange data to answer our questions questions � Method to build views: Incremental MapReduce using Javascript www.softacad.bg

  13. www.softacad.bg

  14. www.softacad.bg

  15. www.softacad.bg

  16. www.softacad.bg

  17. www.softacad.bg

  18. www.softacad.bg

  19. www.softacad.bg

  20. � Views are useful for many purposes: ◦ Filtering the documents in your database to find those relevant ◦ Filtering the documents in your database to find those relevant to a particular process. ◦ Extracting data from your documents and presenting it in a specific order. ◦ Building efficient indexes to find documents by any value. ◦ Use these indexes to represent relationships among documents. ◦ With views you can make all sorts of calculations on the data ◦ With views you can make all sorts of calculations on the data in your documents. www.softacad.bg

  21. { "_id": "debd7e7385464f4874dd2a38043f7825", "_rev": "3-839e43865b653a1ed73c3d21cc17c5dd", "name": "Homer", "last_names": ["Simpson", "Duff"], "phone_numbers": { "mobile": "555-666-777", "work": "666-777-555", "work": "666-777-555", "bar": "777-666-555" }, "interests": ["beer", "donuts", "couches"] } www.softacad.bg

  22. Temenujka Temenujka CouchDB CouchDB Sofroniy Sofroniy www.softacad.bg

  23. Temenujka Temenujka CouchDB CouchDB Sofroniy Sofroniy www.softacad.bg

  24. Temenujka Temenujka CouchDB CouchDB www.softacad.bg

  25. Temenujka Temenujka CouchDB CouchDB www.softacad.bg

  26. Temenujka Temenujka CouchDB CouchDB www.softacad.bg

  27. Temenujka Temenujka CouchDB CouchDB www.softacad.bg

  28. CouchDB CouchDB www.softacad.bg

  29. � MVCC means no locking ! www.softacad.bg

  30. www.softacad.bg

  31. � What is replication ? � What is replication ? � It could be bidirectional � Offline by default � Continious replication www.softacad.bg

  32. � POST /_replicate {"source":"database", {"source":"database", "target":"http://example.org/database"} � By using Admin UI www.softacad.bg

  33. Fault tolerant ( it’s written in Erlang ) Fault tolerant ( it’s written in Erlang ) ‣ Intuitive REST/HTTP interface ‣ Easy replication ‣ Deep structures and no schemas ‣ Stable and scalable, so it is successful in ‣ production The only database solution optimized for The only database solution optimized for ‣ ‣ mobile www.softacad.bg

  34. It’s too new ‣ There is no security model ‣ Too slow for building views ‣ Doesn’t support fancy SQL queries Doesn’t support fancy SQL queries ‣ ‣ www.softacad.bg

  35. � Get it from here: � Get it from here: http://couchdb.apache.org/downloads.html � Case studies : http://www.couchbase.com/customers/case- studies � Practice Map Reduce: � Practice Map Reduce: http://blog.mudynamics.com/wp- content/uploads/2009/04/icouch.html www.softacad.bg

  36. www.softacad.bg

  37. Introduction to MongoDB 1. Create, Update, Remove Operations Create, Update, Remove Operations 2. 2. Querying MongoDB 3. Concurrency 4. Indexes 5. Aggregation 6. Replication (Sharding) Replication (Sharding) 7. 7. Pros and cons 8. www.softacad.bg

  38. � Scale out rather than scale down � Replace the row with the more flexible � Replace the row with the more flexible document � Built for speed � Drivers available for large range of programming languages � Almost no administration needed www.softacad.bg

  39. � Create � Update � Update � Delete www.softacad.bg

  40. � find and findOne � Query Criteria and Conditionals � Query Criteria and Conditionals � Type – Specific Queries � $where www.softacad.bg

  41. � Database level locking � Yielding � Yielding www.softacad.bg

  42. � Almost identical to relational database indexes indexes � Geospatial indexes www.softacad.bg

  43. � count � distinct � distinct � group � Map/Reduce www.softacad.bg

  44. � Master-Slave Replication � Sharding � Sharding www.softacad.bg

  45. � Pros: scalable, fast, flexible, almost administration free administration free � Cons: no atomic operations, no validation www.softacad.bg

  46. CouchDB vs. MongoDB � MVCC (Multiversion concurrency control) � Horizontal scalability � Horizontal scalability � Query Expression � Atomicity � Durability � Map Reduce � Javascript � Javascript � REST � Performance � Use cases

  47. www.softacad.bg

  48. nikolay.tomitov nikolay.tomitov @softacad.bg danail.alexiev @softacad.bg www.softacad.bg

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend