CouchConf-Chicago-Couchbase-in-production

872 views
794 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
872
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • Based upon real-world experience from customers like Zynga, Quepasa, TribalCrossing and many others.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Slow down on demo, describe each section of setup\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • CouchConf-Chicago-Couchbase-in-production

    1. 1. Couchbase Server 2.0 in Production Matt Ingenthron Couchbase Inc. 1
    2. 2. Couchbase Server 2.0: Overview = Simple. Fast. Elastic. • Membase + CouchDB • Managed memory caching layer = super high performance • Clustering and online data redistribution (Rebalancing) • Indexing and Querying via JSON Map-Reduce • New SDK’s and client libraries • Developer Preview available today! • http://www.couchbase.com/downloads 2
    3. 3. Let’s build a social game… www.facebook.com/farm_town_wars Load Balancer Web Servers Couchbase Servers 3
    4. 4. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Test Deploy Maintain 4
    5. 5. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Initial Setup Test Deploy View Development Maintain 4
    6. 6. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Client setup Initial Setup Test Deploy View Development Sizing Maintain 4
    7. 7. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Client setup Initial Setup Test Deploy View Development Sizing Monitor Grow Maintain Upgrade Backup/Restore Failures 4
    8. 8. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Client setup Initial Setup Test Deploy View Development Sizing Monitor Grow Maintain Upgrade Backup/Restore Failures 4
    9. 9. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Initial Setup Test View Development 4
    10. 10. Couchbase Server 2.0 in Production: Initial Setup Extremely easy to get up and running: • RPM/deb/OSX/exe installation • Simple Web UI and setup wizard 5
    11. 11. Couchbase Server 2.0 in Production: Data and Indexes• Data goes “in and out” via the Memcached protocol• Queries/indexes are created and accessed via an HTTP protocol• Both are available separately, Couchbase-provided SDK’s will expose a single API to the developer and abstract the actual traffic 6
    12. 12. Couchbase Server 2.0 in Production: Data and Indexes• Indexes/views are based on incremental map-reduce: • Indexes are updated with incremental changes (not batch)• View processing is done per-vbucket: • Parallel processing on subset of data • Couchbase provides scatter-gather aggregation 7
    13. 13. Couchbase Server 2.0 in Production: Data and Indexes• Views are “developed” off of a random (or specific) sampling of the overall dataset and then deployed • Faster • Less load on system• Updated views can be applied without rescanning entire dataset 8
    14. 14. Couchbase Server 2.0 in Production: Data and Indexes (Demo) 9
    15. 15. Couchbase Server 2.0 in Production: Data and IndexesExample JSON Document:{ "_id": "Keith4540", "jsonType": "player", "name": "Keith4540", "level": 4, … …} (Demo) 9
    16. 16. Couchbase Server 2.0 in Production: Data and IndexesExample JSON Document:{ "_id": "Keith4540", "jsonType": "player", "name": "Keith4540", "level": 4, + … …} (Demo) 9
    17. 17. Couchbase Server 2.0 in Production: Data and IndexesExample JSON Document: Example view:{ function (doc) "_id": "Keith4540", {    if (doc.jsonType == "player") "jsonType": "player", + { "name": "Keith4540",      emit(["Level", doc.level], doc._id); "level": 4,    } } … …} (Demo) 9
    18. 18. Couchbase Server 2.0 in Production: Data and IndexesExample JSON Document: Example view:{ function (doc) "_id": "Keith4540", {    if (doc.jsonType == "player") "jsonType": "player", + { "name": "Keith4540",      emit(["Level", doc.level], doc._id); "level": 4,    } } … …} = (Demo) 9
    19. 19. Couchbase Server 2.0 in Production: Data and IndexesExample JSON Document: Example view:{ function (doc) "_id": "Keith4540", {    if (doc.jsonType == "player") "jsonType": "player", + { "name": "Keith4540",      emit(["Level", doc.level], doc._id); "level": 4,    } } … …} = Secondary index of players, by level (Demo) 9
    20. 20. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Client setup Deploy Sizing 10
    21. 21. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE 10
    22. 22. Couchbase Server 2.0 in production: Sizing Sizing Question: How many nodes do I need? Considerations: RAM Disk Network Data Safety 11
    23. 23. Couchbase Server 2.0 in production: Sizing Sizing Question: How many nodes do I need? Considerations: RAM • Metadata • Working set Active+Replica • Buffer/overhead 12
    24. 24. Couchbase Server 2.0 in production: Sizing 500,000 keys to begin with: -20 bytes in length -average value size of 2k -metadata of about 150 bytes per key = ~1Gb to store active data, an extra 1Gb to store replica dataAdding in some headroom: Give 3GB RAM to Couchbase to start and grow with 13
    25. 25. Couchbase Server 2.0 in production: Sizing Sizing Question: How many nodes do I need? Considerations: Disk: • Sustained write rate • Index generation (space and IO) • Append-only B-Tree • Compaction 14
    26. 26. Couchbase Server 2.0 in production: Sizing Sizing Question: How many nodes do I need? Considerations: Network: • Client traffic • Replication • Rebalancing 15
    27. 27. Couchbase Server 2.0 in production: Sizing Sizing Question: How many nodes do I need? Considerations: Data Safety1 node = single point of failure (bad)2 nodes = 1 replica copy (better)3+ nodes = 1 replica copy AND data/load distribution 16
    28. 28. Couchbase Server 2.0 in production: Sizing Sizing Question: How many nodes do I need? Considerations: RAM Disk Network Data Safety 17
    29. 29. Couchbase Server 2.0 in production: Client-side Deployment Farm Town Wars Farm Town Wars App Code App Code Application server Application server Couchbase PHP Client Couchbase Java Library Client library Moxi (Couchbase proxy) OR 11210 5984 11210 5984 Query API Query API Couchbase Server Couchbase Couchbase Couchbase Server Client-side Moxi (“smart”) library 18
    30. 30. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Monitor Grow Maintain Upgrade Backup/Restore Failures 19
    31. 31. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE 19
    32. 32. Couchbase Server 2.0 in production: MonitoringIMMENSE amount of information available•Real-time traffic graphs•REST API accessible•Per bucket, per node and aggregate statistics•Application and inter-node traffic•RAM <-> Disk•Inter-system timing 20
    33. 33. 21
    34. 34. Couchbase Server 2.0 in production: Growth (Demo) 22
    35. 35. Couchbase Server 2.0 in production: GrowthGoing from 1 hundred users to 2 million users… – RAM usage is growing: • Ejecting data to and fetching data from disk • Resident item ratios decreasing – might impact failover – Disk write queue grows higher than usual (Demo) 22
    36. 36. Couchbase Server 2.0 in production: GrowthGoing from 1 hundred users to 2 million users… – RAM usage is growing: • Ejecting data to and fetching data from disk • Resident item ratios decreasing – might impact failover – Disk write queue grows higher than usual (Demo) 22
    37. 37. Couchbase Server 2.0 in production: GrowthGoing from 1 hundred users to 2 million users… – RAM usage is growing: • Ejecting data to and fetching data from disk • Resident item ratios decreasing – might impact failover – Disk write queue grows higher than usualNeed to add a few more nodes... (Demo) 22
    38. 38. Couchbase Server 2.0 in production: GrowthGoing from 1 hundred users to 2 million users… – RAM usage is growing: • Ejecting data to and fetching data from disk • Resident item ratios decreasing – might impact failover – Disk write queue grows higher than usualNeed to add a few more nodes... (Demo) 22
    39. 39. Couchbase Server 2.0 in production: GrowthGoing from 1 hundred users to 2 million users… – RAM usage is growing: • Ejecting data to and fetching data from disk • Resident item ratios decreasing – might impact failover – Disk write queue grows higher than usualNeed to add a few more nodes...Now we have more RAM and more disk throughput without anydowntime (Demo) 22
    40. 40. Couchbase Server 2.0 in production: General Maintenance• Persistence is CouchDB: – Append-only B-tree – Reliability and data integrity – Constantly growing on-disk files• Compaction is the answer: – Automatic – “Fragmentation” data – Scheduled compaction – Partial compaction via per-vbucket database (saves disk space and time) 23
    41. 41. Couchbase Server 2.0 in production: General Maintenance• Backup/Restore: – Backup is as simple as a file-level copy (thanks CouchDB!) – Server will automatically “warmup” from disk files upon reboot• Upgrade: – Add nodes of new version, rebalance… – Remove nodes of old version, rebalance… – Done! – No disruption – Upgrade from existing Membase 1.7 installations to Couchbase 2.0 24
    42. 42. Couchbase Server 2.0 in production: Failures • Failures happen: – Hardware – Network – Bugs • Failover to replica data for immediate access • Remove and rebalance “malfunctioning” node (Demo)25
    43. 43. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Client setup Initial Setup Test Deploy View Development Sizing Monitor Grow Maintain Upgrade Backup/Restore Failures 26
    44. 44. COUCHBASE SERVER 2.0 IN PRODUCTION: DEV/OPS LIFECYCLE Initial Setup Test View Development 26
    45. 45. THANK YOU! Q&AMatt Ingenthron - matt@couchbase.com @ingenthr 27

    ×