Couchdb + Membase = Couchbase
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Couchdb + Membase = Couchbase

  • 7,560 views
Uploaded on

Couchdb + Membase = Couchbase

Couchdb + Membase = Couchbase

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
7,560
On Slideshare
6,236
From Embeds
1,324
Number of Embeds
9

Actions

Shares
Downloads
148
Comments
0
Likes
8

Embeds 1,324

http://blog.nosqlfan.com 1,295
http://www.slideshare.net 14
https://twitter.com 9
http://reader.youdao.com 1
http://xianguo.com 1
http://cache.baidu.com 1
http://cafe.naver.com 1
http://www.uplook.cn 1
http://xue.uplook.cn 1

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. Data management for interactive web and mobile applications.DALE HARVEY 1
  • 2. RELAX@perezd
  • 3. What is Couchbase? 1+1 really does equal 3 3
  • 4. WHAT IS MEMBASE? 4
  • 5. Deployments Leading Membase Leading cloud service (PAAS) Social game leader – FarmVille, provider Mafia Wars, Café World Over 65,000 hosted Over 230 million monthly users applications Membase Server Membase Server serving over is the 500,000 ops-per-second 1,200 Heroku customers (as of database behind FarmVille and June 10, 2010) Café World 5
  • 6. Ad targeting 40 milliseconds to come up with an answer. 3 profiles, real time campaign statistics 2 1 profiles, campaigns events 6
  • 7. Membase is a distributed database Application user Web application server Web application server Web application server Membase Servers In the data center On the administrator console 7
  • 8. Membase is Simple, Fast, Elastic Five minutes or less to a working cluster • Downloads for Linux and Windows • Start with a single node • One button press joins nodes to a cluster Easy to develop against • Just SET and GET – no schema required • Drop it in. 10,000+ existing applications already “speak membase” (via memcached) • Practically every language and application framework is supported, out of the box Easy to manage • One-click failover and cluster rebalancing • Graphical and programmatic interfaces • Configurable alerting 8
  • 9. Data is sharded into vBuckets 9
  • 10. Clustering With Membase SET request arrives at SET acknowledgement KEY’s master server 1 2 returned to application 3 3 Listener-Sender RAM membase storage engine 4 Disk Disk Disk Disk Disk DiskReplica Server 1 for KEY Master server for KEY Replica Server 2 for KEY 10
  • 11. Membase is Simple, Fast, Elastic Zero-downtime elasticity • Spread I/O and data across commodity servers (or VMs) • Consistent performance with linear cost • Dynamic rebalancing of a live cluster All nodes are created equal • No special case nodes • Any node can replace any other node, online • Clone to grow Extensible • Filtered TAP interface provides hook points for external systems (e.g. full-text search, backup, warehouse) • Data bucket – engine API for specialized container types 11
  • 12. WHAT IS CouchDB? 12
  • 13. Robust JSONReplicationMap Reduce GeoCouch HTTP 13
  • 14. USE CASES 14
  • 15. DOCUMENT STORE=> GET http://127.0.0.1:5984/mydatabase/uniqueid=> PUT http://127.0.0.1:5984/mydatabase/uniqueid http://127.0.0.1:5984/mydatabase=> POST=> DELETE http://127.0.0.1:5984/mydatabase/uniqueid{ “_id” : “uniqueid”, “_rev” : 1234567, “title” : “My New Blog Post”, “body” : “A quick brown fox .......”, “_attachments”: { “profile.jpg”: { ...... } }} 15
  • 16. ROBUST STORAGE ENGINEAppend-OnlyReliable & ConcurrentHot BackupsCompaction 16
  • 17. INCREMENTAL MAP REDUCE 17
  • 18. PEER-BASED REPLICATIONcurl -X POST http://127.0.0.1:5984/_replicate -d{ "source": "http://couch.example.com:5984/remote-db", "target": "local-db"} 18
  • 19. NAILING MOBILE • Extremely Robust Storage Engine Consumer devices may lose power at any time • Lightweight Runtime Small install, low memory footprint, easy on battery life • Offline sync via Replication Multi-master synchronization engine • GeoSpatial Index Mapping and location aware apps • HTML5 Application Server Easy to add a web view to your mobile datahttps://github.com/couchbaselabs/iOS-Couchbase 19
  • 20. GEOCOUCH CIVICAPI.COM, ETCAdvanced R-Tree Index 20
  • 21. ARCHITECTURE
  • 22. 2.0 Architecture Overview Application Couchbase SDK API MCD Couch Application Tier Elastic Couchbase Server Cluster Moxi Memcached Couch Proxy ep_engine Cluster Manager Couchbase Server vBucket Data View Data 22
  • 23. JSON Document Handling• Per Bucket JSON Document Mode toggle• JSON Document Mode disabled (or invalid JSON) – Values are opaque to couch (and in views) – Stored as attachments to documents that hold metadata – Returned values are guaranteed bitwise identical• JSON Document Mode enabled – Values are expected to be valid JSON – Stored in document along metadata 5 – Returned values may not be bitwise identical but
  • 24. JSON Document Encodings for memcached Couch Document Meta Data Key:”zdfasf” Expiration:43452345 { Flags:2352145 “_id”: ”zdfasf” “$Expiration”: 43452345, “$Flags”: 2352145, “$AttachReason”:”JSON Mode Disabled”, //Other Value reasons “Invalid JSON”, etc. [“$KeyMangled”: false,] //only included if true “_attachments”: { “$value”: { … } } 0x87632f98,0xa76b876d, …! } Couch Document Meta Data Key:”zdfasf” Expiration:43452345 Flags:2352145 { “_id”: ”zdfasf” “$Expiration”: 43452345, “$Flags”: 2352145, JSON Document [“$KeyMangled”: false,] //only included if true “foo”: ”bar” { } “foo”: ”bar” } 24
  • 25. Scatter Gather Map Reduce• Get next answer from local vBuckets and from child nodes to select the next result for a node• Result includes info on number of vBuckets not included – Timeouts, Incorrect Design Doc version, etc 8
  • 26. Scatter Gather Example 9
  • 27. Scatter Gather Example 10
  • 28. Scatter Gather Example 11
  • 29. Scatter Gather Example 12
  • 30. Scatter Gather Example 13
  • 31. Scatter Gather Example 14
  • 32. Scatter Gather Example 15
  • 33. Scatter Gather Example 16
  • 34. Scatter Gather Example 17
  • 35. Scatter Gather Example 18
  • 36. Scatter Gather Example 19
  • 37. Q&ADALE HARVEYDALE@COUCHBASE.COM@DALEHARVEY 37