riak intro to

34
Wednesday, March 13, 13

Upload: adron-hall

Post on 06-May-2015

647 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Riak intro to

Wednesday, March 13, 13

Page 2: Riak intro to

#WHOISAdron Hall | @adron | Coder, Messenger, Recon

Wednesday, March 13, 13

Page 3: Riak intro to

芭蕉

Wednesday, March 13, 13

Page 4: Riak intro to

Distributed, masterless, highly-available key/value store

Wednesday, March 13, 13

Page 5: Riak intro to

Horizontal Scalability

Fault-Tolerance

Low-latency

Ops Friendliness

Predictability

High-Availability

DESIGN GOALS

Wednesday, March 13, 13

Page 6: Riak intro to

Metadata Users/Profiles

Object StorageSession Storage

Sensor Data Logging Systems

Record SystemsNotification Systems

Use, when & what to use Riak for...

Wednesday, March 13, 13

Page 7: Riak intro to

IN PRODUCTION AT

And 1000s more...

Wednesday, March 13, 13

Page 8: Riak intro to

DATA MODEL

Wednesday, March 13, 13

Page 9: Riak intro to

{“Key”:“Value”}

• Values are stored against keys

• Key/Value + Metadata = Object

• Fundamental Unit of Replication

• Any Datatype will work

• Record to disk in binary format

Wednesday, March 13, 13

Page 10: Riak intro to

<<BUCKET>>/<<KEY>>

• Virtual Namespace

• Bucket + Keys = Object Address

• Buckets have properties

• Objects in bucket inherit properties

• No relationships between buckets

Wednesday, March 13, 13

Page 11: Riak intro to

DATA ACCESS

Wednesday, March 13, 13

Page 12: Riak intro to

INTERFACES

HTTP API - Via a little piece of magic called Webmachine

Protocol Buffers API - Thanks, Google!

Largely-faithful REST implementation

Compact, binary protocol

Wednesday, March 13, 13

Page 13: Riak intro to

CLIENT LIBSPython

Ruby

PHP

OCaml

Java

Perl

Erlang

Node.js

C/C++

Haskell

Clojure

Scala

Go Dart

.NET

...and more via Basho or our community.

Wednesday, March 13, 13

Page 14: Riak intro to

RIAK GIVES YOU [FOUR] WAYS TO STORE, RETRIEVE, AND QUERY

DATA

Wednesday, March 13, 13

Page 15: Riak intro to

123456789101112131415161718

CRUD

// PUTPUT  /buckets/bucket/keys/key            //  User-­‐defined  key

POST  /buckets/bucket/keys/key        //  Riak-­‐defined  key

DELETE  /buckets/bucket/keys/key      

GET  /buckets/bucket/keys/key        

// GET

// DELETE

Wednesday, March 13, 13

Page 16: Riak intro to

MapReduce

Distributed processing system using Riak Pipe

Efficient for targeted queries over known key range

Write jobs in Erlang or JS. (Erlang more performant)

Wednesday, March 13, 13

Page 17: Riak intro to

Secondary Indexing (2i)

riak_object

riak_object

X-Riak-Index-email_bin

X-Riak-Index-value_int

[email protected]

“42”

Tag objects with custom metadata on PUT...Exact match and range queries...No multi-index queries yet...

Pagination is on its way...

Wednesday, March 13, 13

Page 18: Riak intro to

Riak Search

Store and index documents (JSON, text, XML, etc)

Current Riak Search supports subset of Solr API

Next iteration (Yokozuna; in beta)will implement distributed Solr on Riak. It will be sexy.

Looking for beta testers to help harden Yokozuna

Wednesday, March 13, 13

Page 19: Riak intro to

ARCHITECTURE

The scaleability and ease of operation goals inform architectural decisions.

These come with tradeoffs.

Consistent Hashing

Virtual Nodes

Append-only storage

Handoff/Rebalancing

Vector Clocks

Active Anti-Entropy*

Wednesday, March 13, 13

Page 20: Riak intro to

Consistent Hashing

Location of data in the Riak ring is determined based on hash of bucket + key.

Provides even distribution of storage and query load

Trades off advantages gained from locality

- e.g. Range queries and aggregates

Wednesday, March 13, 13

Page 21: Riak intro to

Consistent Hashing

Wednesday, March 13, 13

Page 22: Riak intro to

Virtual Nodes

Unit of addressing and concurrency in Riak

Each physical host manage many vnodes Partition count / physical machines = vnodes/machine*

Decouples physical assets from data distribution. This provides:

- simplicity in cluster sizing - failure isolation

Wednesday, March 13, 13

Page 23: Riak intro to

Handoff/Rebalancing

Mechanisms for data rebalancing

When nodes join/leave cluster, handoff and rebalancing manage the date shuffling dynamically

Trades off speed of convergence vs. effects on cluster performance

- causes disk & network load

Wednesday, March 13, 13

Page 24: Riak intro to

Vector Clocks

VCs used to rectify object consistency at READ time.

Lots of knobs to turn; well-documented

Trades off space, speed, and complexity for safety

- will store all sibling objects until resolved- can lead to object size issues

Wednesday, March 13, 13

Page 25: Riak intro to

Append-Only Storage

Riak provides a pluggable backend interface. (Write your own; we’ll probably hire you...)

Bitcask, LevelDB are most-heavily used. Both are append - only

Provides crash safety and speed.

Trade off: periodic compaction/merge ops

Wednesday, March 13, 13

Page 26: Riak intro to

RIAK 1.3 (AKA “new hotness”)

Active Anti Entropy MapReduce ImprovementsIPv6 Support

Riaknostic included by default

Much more Riak Control improvements

Full release notes: https://github.com/basho/riak/blob/1.3/RELEASE-NOTES.md

Wednesday, March 13, 13

Page 27: Riak intro to

FUTURE WORK*(1.4 and beyond)

(* all code subject to ship early, late, or not at all)

Dynamic Ring SizeYokozunaCRDTs/Data TypesRiak Object

Consistency2i ImprovementsRiak Pipe workMuch more

Wednesday, March 13, 13

Page 28: Riak intro to

S3-API compatible and supports per-tenant reporting for billing and metering use cases. Additional APIs on the way.

Multi-tenant cloud storage software for public and private clouds.

Designed to provide simple, available, distributed cloud storage at any scale.

Stores files of arbitrary size. Under the hood stores 1MB chunks along side a manifest.

Stateless proxy (CS) does chunking. Riak does distribution, storage, etc.

Wednesday, March 13, 13

Page 29: Riak intro to

Data transfer is unidirectional (source -> sink). Bidirectional synchronization can be achieved by configuring a pair of connections between clusters.

Extends Riak's capabilities with:- multi-datacenter replication- SNMP Configuration- JMX-Monitoring- 24x7 support from Basho Engineers

One cluster acts as a "source cluster". The source cluster replicates its data to one or more "sink clusters" using either real-time or full sync.

Wednesday, March 13, 13

Page 30: Riak intro to

RIAK COMMUNITYMailing List - 1300 developers

IRC - 200+ people every day yelling about software

GitHub - 1000s of watchers; 200+ contributors to all projects

Meetups - 10 Countries, 23 Cities, 3700+ Members & growing fast!

Deployments - 1000s in production.

Wednesday, March 13, 13

Page 31: Riak intro to

May 13-14th in New York Cityricon.io/east.html

Talks, hacking, partiesDedicated to the future of Riak and distributed systems in production

REGISTER NOW!

https://ricon-east-2013.eventbrite.com/?discount=lovevnodes

Wednesday, March 13, 13

Page 32: Riak intro to

GETTING STARTEDDownloads - http://docs.basho.com/riak/latest/downloads/Docs - http://docs.basho.comRiak Source Code - github.com/basho/riak

All Basho source Code - github.com/basho/Riak Mailing List - http://bit.ly/riak-list

Email or Tweet me @adron or [email protected]

Wednesday, March 13, 13

Page 33: Riak intro to

Let’s Talk UI & CLI - Demo Things

Wednesday, March 13, 13

Page 34: Riak intro to

#WHOISAdron Hall | @adron | Coder, Messenger, Recon

Wednesday, March 13, 13