Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Riak at Engine Yard - given at Big Nerd Ranch

Riak at Engine Yard - given at Big Nerd Ranch

Riak is an open source, highly scalable and fault-tolerant distributed database. Its high availability features in particular make Riak an ideal fit for cloud environments where your resources may disappear without notice but your database must continue to serve requests.

This talk will introduce you to Riak’s use cases and overall architecture. We’ll also cover how we run Riak at Engine Yard.

Ines Sombra

March 29, 2013
Tweet

More Decks by Ines Sombra

Other Decks in Technology

Transcript

  1. About US 100% Cloud Based Critical services MUST be up

    24/7/365 Clouds Regions Stacks Support HA DR
  2. ! This sucked, A LOT Time to strengthen our HA/DR

    Story Customers and us need to be up all the time! $
  3. Relational Document Key/Value Column Data Models Consistency Partitions Our Research

    Are ACID properties really needed? Consistency Availability
  4. Riak’s Use Cases Application Type Key Value Session User/Session id

    Data Advertising Campaign id Data Logs Date Log file Content title, integer text, json, xml, media..
  5. When is Riak a good fit When availability is more

    important than consistency When data can be modeled as keys/values When the problem fits
  6. Riak is OPS FRIENDLY node 1.2.1 node 1.2.1 node 1.2.1

    node 1.2.1 node 1.2.1 Growth Reduction Upgrades Failures node 1.3.0 X
  7. Riak is SO MUCH MORE Consistent Hashing Hinted Handoff Active

    Anti Entropy Tuneable consistency N | W | R
  8. OUR APP AFTER App App node 1.3.0 node 1.3.0 node

    1.3.0 node 1.3.0 node 1.3.0 App
  9. 1 2 3 4 Number of Nodes Your CHOICES You

    are trying to create a Riak cluster. Do you need any help? Instance Type Data Location Backend Type
  10. ^ m1.large & m1.xlarge EBS-optimized or PIOPs High I/O Quadruple

    XL (hi1.4xlarge) - SSDs! Choosing INSTANCES
  11. Change Default CANNOT BE RESET (8-64 vnodes per node) Ring

    SIZE Ring Size at 256 DONT GO OVER 512
  12. Our PROVISIONING App haproxy MyRiakCluster: node-0 MyRiakCluster: node-1 MyRiakCluster: node-2

    MyRiakCluster: node-3 MyRiakCluster: node-4 Riak Cluster HTTP or Protobuff App haproxy App haproxy Riak Cluster
  13. ^ Riak process pages should not hit swap Swap usage

    can result in unresponsive server Let the kernel kill it Disable SWAP
  14. ^ Mount with noatime flag Use deadline scheduler on EBS

    Mount & SCHEDULER cat /sys/block/xvdj1/queue/scheduler noop [deadline] cfq echo deadline > /sys/block/xvdj1/queue/ scheduler
  15. ^ xfs, ext3 ext4 barrier = 0 data = writeback

    ZFS not recommended Linux FILESYSTEMS
  16. ^ Backup both the ring and data directories scp or

    rsync data dir EBS snapshots Backup STRATEGY
  17. Pick the right tool for the job Apps & Services

    can have multiple databases Polyglot PERSISTENCE
  18. On SOA My super nice e-commerce site Shopping Cart &

    Session Data Completed Orders Inventory and Item Pricing Recommendations Engine Session Storage service K/V Store Order Persistence service Document Store Inventory & Price service RDBMS Nodes and relations service Graph Store NoSQL Distilled: Fowler & Sadalage
  19. Don’t optimize too quickly Take time to understand your problem

    Complexity increases with more databases We RECOMMEND