Riak at Engine Yard Cloud

Click here to load reader

  • date post

  • Category


  • view

  • download


Embed Size (px)


Given at Big Nerd Ranch in Atlanta.

Transcript of Riak at Engine Yard Cloud

  • 1.Getting Started with Riak in the Cloud Big Nerd Ranch

2. About Me InesSombra@RandomMood 3. Our AgendaAbout UsOur CustomersThe ProblemThe Solution 4. Engine Yard 5. About USClouds Regions100% CloudBased Stacks SupportCritical servicesDRMUST be up HA24/7/365 6. Our Customershttp://www.flickr.com/photos/meetrajesh/6972883401 7. An APPLICATIONAppAppDBMaster us-east-1aDBReplicaAppus-east-1b 8. Then AWS Crashed http://www.flickr.com/photos/brandongrasley/8227882239/ 9. Our App AFTERAppApp XDB Masterus-east-1a DB ReplicaApp us-east-1b 10. This sucked, A LOT! Time to strengthenour HA/DR Story$ Customers and usneed to be up allthe time! 11. Our ResearchData Models Consistency PartitionsRelationalAre ACID ConsistencypropertiesDocument AvailabilityreallyKey/Value needed?Column 12. Impedance MismatchRelational Model 13. Impedance MismatchMemory data-structure 14. We needed a faulttolerant and highlyavailable (clustered) datastore 15. OSS, Dynamo-based,distributed K/V storeHello RIAK!Linearly scalableFault-tolerantFinally provideHA/DR solution 16. Riaks Use CasesApplication Type KeyValueSessionUser/Session id DataAdvertisingCampaign idDataLogs Date Log filetext, json,Contenttitle, integerxml, media.. 17. When is Riak a good fitWhen availability is moreimportant than consistencyWhen data can bemodeled as keys/valuesWhen the problem fits 18. Riak is OPS FRIENDLY Xnode 1.2.1 Growth nodenode1.2.1 1.2.1 Reduction node1.2.1 node 1.2.1 Upgradesnode 1.3.0 Failures 19. Worlds most famous slide 20. Riak is SO MUCH MORE Consistent Hashing Hinted Handoff Active Anti Entropy Tuneable consistency N|W|R 21. OUR APP AFTERApp node1.3.0 Appnode node 1.3.0 22. We need a RiakCluster but we have no hardware 23. RIAK In the Wild18th and Harrison, San Francisco, CA 24. Lets build A PRODUCThttp://www.flickr.com/photos/worldbank/8261699153/ 25. Your CHOICES You are tryingto create a Riak cluster. Do you need any help? 1 Number of Nodes 2 Instance Type 3 Data Location 4 Backend Type 26. What we GIVE YOU 27. Our SUPPORT X2 28. HOWTO What youOPS to know 29. Prepare YourselfMore instances to compensate for theperformance variability ofvirtualized resources 30. Choosing INSTANCES ^ m1.large & m1.xlarge EBS-optimized or PIOPs High I/O Quadruple XL (hi1.4xlarge) - SSDs! 31. Cluster Sizes5 nodes or moreBest performance& growthScales linearlyDont be stingy 32. Ring SIZEChange DefaultCANNOT BE RESETRing Size at 256 (8-64 vnodes per node)DONT GO OVER 512 33. Our PROVISIONINGRiak Cluster Riak ClusterAppMyRiakCluster: node-0 haproxy HTTPor MyRiakCluster: node-1 ProtobuffApp haproxy MyRiakCluster: node-2App MyRiakCluster: node-3 haproxy MyRiakCluster: node-4 34. Disable SWAP ^ Riak process pages should not hit swap Swap usage can result in unresponsive server Let the kernel kill it 35. Mount & SCHEDULER ^ Mount with noatime flag Use deadline scheduler on EBS cat /sys/block/xvdj1/queue/scheduler noop [deadline] cfq echo deadline > /sys/block/xvdj1/queue/ scheduler 36. Linux FILESYSTEMS ^ xfs, ext3 ext4 barrier = 0 data = writeback ZFS not recommended 37. Backup STRATEGY ^ Backup both the ring and data directories scp or rsync data dir EBS snapshots 38. Monitoring STRATEGYStats Interfaceriak-admin statusCollectdNagios 39. Scaling RIAK^ Verticalriak-admin cluster replace ^ Horizontalriak-admin cluster add 40. How we SCALE RIAK 41. Hybrid Solutions FTWRIAK + PostgreSQLRIAK + FTS Engine*RIAK + Redis 42. Try OUR RIAK 43. How difficult IS IT? 44. Finally! A fewthoughts 45. Polyglot PERSISTENCEPick the right toolfor the jobApps & Servicescan have multipledatabases 46. On SOA My super nice e-commerce siteShopping Cart &CompletedInventory and Recommendations Session Data Orders Item Pricing EngineSession Order Inventory & Nodes andStorage Persistence Price servicerelationsservice service service RDBMSK/V StoreDocumentGraph Store StoreNoSQL Distilled: Fowler & Sadalage 47. We RECOMMEND Dont optimize too quickly Take time to understand your problem Complexity increases with more databases 48. Do KEEP IN MIND Different paradigms are differentDocumentRelational != Store 49. WhateverGive meMOAR! 50. Great RESOURCES Little Riak Book (https://github.com/coderoshi/little_riak_book/) docs.basho.com blog.engineyard.com nosql.mypopescu.com 51. Questions?