Your SlideShare is downloading. ×
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Perform Like a frAg Star
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Perform Like a frAg Star

3,101

Published on

A reworking of the infamous "CouchDB Perform Like a Pron Star" presentation, done for the Maine Ruby User Group

A reworking of the infamous "CouchDB Perform Like a Pron Star" presentation, done for the Maine Ruby User Group

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

No Downloads
Views
Total Views
3,101
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
35
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CouchDB Perform like a frAg star Casey Rosenthal Maine Ruby Users Group Slides by Renae Bair
  • 2. How do you identify a developer/frAg star?
  • 3. size - memory usage - amount of servers - infrastructure
  • 4. reliability
  • 5. fault-tolerant - no downtime - ready for traffic peaks - ready for more data
  • 6. plays well with others
  • 7. plays well with others - public interfaces - no discrimination
  • 8. scalability
  • 9. scalability - reaction under load - handle concurrent connections - number of requests/s - latency
  • 10. performance
  • 11. ¿frAg star?
  • 12. kinda!
  • 13. CouchDB Apache’s Document-Oriented Database
  • 14. Relational Database Management Systems
  • 15. Relational Database Management Systems Data Columns Relationships Tables Data Rows
  • 16. RDBMS table name primary key structured data scalar values column name SQL consistency integrity constraints
  • 17. RDBMS challenges for the web - most/all fields become optional - many-to-many relationships - joins - replication - auto incremental ids
  • 18. RDBMS scaling is a pain
  • 19. Column Oriented DBMS Hypertable Bigtable
  • 20. Distributed Hash Table node B Key/Value node C Key/Value node A Key/Value node M Key/Value node L Key/Value node Z Key/Value
  • 21. Distributed Hash Table -decentralized -add/remove nodes ➟ scale -fault tolerant -p2p & IM -memcached -memcached ➟ disk -MemcacheDB -Project Voldemort -Scalaris -Tokyo Cabinet -Redis
  • 22. CouchDB
  • 23. CouchDB
  • 24. key/value store CouchDB Key: "user-077-socialsecuritynumber" value: "477-289-4690"
  • 25. decentralized CouchDB
  • 26. replication CouchDB
  • 27. replication CouchDB
  • 28. fault tolerant CouchDB
  • 29. compute data CouchDB map/reduce built-in
  • 30. compute data CouchDB function(doc) { if (doc.type == 'Card' && doc.tags) { doc.tags.forEach(function(tag){ emit(tag, 1); }) } }
  • 31. more tricks
  • 32. full ACID compliance
  • 33. HTTP REST interface
  • 34. Load Balancing
  • 35. Caching
  • 36. conflict management
  • 37. MVCC Multiversion concurrency control
  • 38. couchdb-lucene http://github.com/rnewson/couchdb-lucene/
  • 39. ruby
  • 40. couchrest
  • 41. core couch = CouchRest.new("http://127.0.0.1:5984") db = couch.database!('GoGaRuCo') db.save_doc({ 'type' => 'attendee', 'first_name' => 'John', 'last_name' => 'Doe', 'age' => 32, 'tags' => ['Merb', 'MacRuby', 'JS'] })
  • 42. more class Card < CouchRest::ExtendedDocument include CouchRest::Validation use_database SERVER.default_database property :first_name property :last_name, :alias => :family_name property :pid, :read_only => true timestamps! validates_present :first_name end
  • 43. more Card.first Card.all Card.by_first_name(:key => 'Matt') Card.by_last_name(:keys => ['Aimonetti','Vega']) Card.get('matt_aimonetti') Card.by_phone_number( :startkey => [760,{}], :endkey => [815,{}])
  • 44. more property :questions, :cast_as => ['Question'] property :professor, :cast_as => 'Person' property :final_test_at, :cast_as => 'Time'
  • 45. more view_by :date, :descending => true view_by :user_id, :date
  • 46. more view_by :tags, :map => "function(doc) { if (doc['couchrest-type'] == 'Article' && doc.tags) { doc.tags.forEach(function(tag){ emit(tag, 1); }); } }", :reduce => "function(keys, values, rereduce) { return sum(values); }"
  • 47. more save_callback :before, :generate_slug_from_title
  • 48. when to use couch? -when you need to scale your DB -when availability is more important than consistency -when your data is decentralized -when you need to compute data
  • 49. Thanks

×