Conhecendo o CouchDB
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Conhecendo o CouchDB

on

  • 5,575 views

Apresentação sobre o banco não relacional (NoSQL) CouchDB, sua API Rest, e funções de consulta Map/Reduce

Apresentação sobre o banco não relacional (NoSQL) CouchDB, sua API Rest, e funções de consulta Map/Reduce

Statistics

Views

Total Views
5,575
Views on SlideShare
5,490
Embed Views
85

Actions

Likes
2
Downloads
64
Comments
0

10 Embeds 85

http://blog.gogs.com.br 62
http://gogs.com.br 9
http://coderwall.com 6
http://gogs.me 2
http://www.slideshare.net 1
http://henriquegogo.tumblr.com 1
http://paper.li 1
http://10.101.48.119 1
https://twitter.com 1
http://twitter.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Conhecendo o CouchDB Presentation Transcript

  • 1. Conhecendo o Henrique Gogó - www.gogs.com.br
  • 2. O que é o CouchDB
  • 3. NoSQL
  • 4. NoSQL Not only SQL
  • 5. Alguns bancos de dados NoSQL
  • 6. Por que CouchDB?
  • 7. Por que CouchDB? OpenSource Livre de esquemas HTTP / REST JavaScript Escalabilidade Replicação
  • 8. Um novo modelo: documentos No mundo real armazenamos dados em documentos
  • 9. JSON
  • 10. JSON
  • 11. JSON
  • 12. RESTful POST, GET, PUT e DELETE
  • 13. RESTful POST, GET, PUT e DELETE basicamente um C.R.U.D. CREATE, READ, UPDATE e DELETE
  • 14. Basicamente, mas não literalmente, ok?
  • 15. Map / Reduce
  • 16.  
  • 17. Futon
  • 18. E não é só isso...
  • 19. Controle de usuário Validação CouchApp Nuvem
  • 20. Entendendo um pouco mais
  • 21. API RESTful
  • 22. GET http://localhost:5984/ {"couchdb":"Welcome","version":"1.0.1"}
  • 23. Criar banco de dados PUT http://localhost:5984/database {"ok":true}
  • 24. PUT http://localhost:5984/database {"ok":true} PUT http://localhost:5984/database {"error":"file_exists","reason":"The database could not be created, the file already exists."}
  • 25. Deletar banco de dados DELETE http://localhost:5984/database {"ok":true}
  • 26. DELETE http://localhost:5984/database {"ok":true} DELETE http://localhost:5984/database {"error":"not_found","reason":"missing"}
  • 27. Criar documento PUT http://localhost:5984/database/doc -d '{"nome":"Henrique","apelido":"Gogó"}' {"ok":true,"id":"doc","rev":"1-446a0c701e94053b4c3baaa5ef3fe68c"}
  • 28. Criar documento gerando o id automaticamente POST http://localhost:5984/database/ -d '{"site":"http://www.gogs.com.br"}' -H "Content-Type: application/json" {"ok":true,"id":"468df12f72c2629fd9319b6dfd0009dd","rev":"1-0a48dec3e05fc52dae8b2943a4a55864"}
  • 29. Ver documento GET http://localhost:5984/database/doc {"_id":"doc","_rev":"1-446a0c701e94053b4c3baaa5ef3fe68c","nome":"Henrique","apelido":"Gogu00f3"}
  • 30. Atualizar documento PUT http://localhost:5984/database/doc -d '{"_rev":"1-446a0c701e94053b4c3baaa5ef3fe68c", "apelido":"Gogs"}' {"ok":true,"id":"doc","rev":"2-191182436ca9a532ec1124aa91b5a8da"}
  • 31. Deletar documento DELETE http://localhost:5984/database/doc?rev=2-191182436ca9a532ec1124aa91b5a8da {"ok":true,"id":"doc","rev":"3-4c1033574d7d38e57fe92a1b51fc667d"}
  • 32. Todos os dbs e docs GET http://localhost:5984/_all_dbs GET http://localhost:5984/database/_all_docs
  • 33. Map Reduce
  • 34. Map
    • {"total_rows":3,"offset":0,"rows":[
        • {"id":"fc2636bf50556346f1ce46b4bc01fe30","key":"Lena","value":25},
        • 35. {"id":"1fb2449f9b9d4e466dbfa47ebe675063","key":"Lisa","value":14},
        • 36. {"id":"8ede09f6f6aeb35d948485624b28f149","key":"Sarah","value":16}
    • ]}
  • 37. /database/_design/application/_view/ viewname?key="Lena" {"total_rows":3,"offset":1,"rows":[ {"id":"fc2636bf50556346f1ce46b4bc01fe30","key":”Lena”, "value":25} ]}
  • 38. Reduce
    • {"rows":[
      • {"key":null,"value":55}
    • ]}