Download presentation
Presentation is loading. Please wait.
Published byByron Haynes Modified over 9 years ago
1
7 databases in 7 weeks Part 3. Riak
2
Yes and no Yes distributed data-replicating enhanced key-value store no single point of failure HTTP(Protobuf) Availability Speed, huge data handling
3
Yes and no No No need of scaling Local distribution Financial transactions simple queryability complex data structures rigid schema
4
CRUD, Links, and MIMEs http://localhost:8091/stats http://localhost:8091/stats { "vnode_gets":0, "vnode_puts":0, "vnode_index_reads":0,... "connected_nodes":[dev2@127.0.0.1,"dev3@127.0.0.1"],dev2@127.0.0.1... "ring_members":["dev1@127.0.0.1","dev2@127.0.0.1","dev3@127.0.0.1 ], "ring_num_partitions":64, "ring_ownership":"[{'dev3@127.0.0.1',21},{'dev2@127.0.0.1',21},{'dev1 @127.0.0.1',22}]“... }
5
Bucket,value http://SERVER:PORT/riak/BUCKET/KEY http://SERVER:PORT/riak/BUCKET/KEY Curl –X GET http://localhost:8091/riak?buckets=true
6
Simple bad query $curl –I http://localhost:8091/riak/no_bucket/no_key HTTP/1.1 404 Object Not Found Server: MochiWeb/1.1WebMachine/1.7.3(participate in the frantic) Date: Thu, 04 Aug 2011 01:25:49 GMT Content- Type: text/plain Content-Length:10
7
CRUD Curl –v –X PUT http://localhost:8091/riak/animals/ace \ http://localhost:8091/riak/animals/ace -H "Content-Type: application/json“ \ -d '{"nickname“ : "The Wonder Dog", "breed":"GermanShepherd"}' Returns 204 Curl http://localhost:8091/riak/animals/acehttp://localhost:8091/riak/animals/ace Curl –I –X DELETE http://localhost:8091/riak/animals/ace
8
Links Link: ;riaktag=\“fuu\“ Curl –X PUT http://localhost:8091/riak/cages/1\ -H "Content-Type: application/json"\ -H "Link: ;riaktag=\"contains\""\ -d '{"room":101}‘ link relationship is one-directional. Link is returned in the header
9
Link walking Curl http://localhost:8091/riak/cages/1/_,_,_ http://localhost:8091/riak/cages/1/_,_,_ /_,_,_ - bucket,tag,keep Curl http://localhost:8091/riak/cages/2/_,next_ to,0/animals,_,_
10
MIME Types Binary-encoded value Curl –X PUT http://localhost:8091/riak/photos/polly.jpg \ -H "Content-type: image/jpeg"\ -H "Link: ;riaktag=\"photo\"" \ --data-binary @polly_image.jpg
11
Mapreduce
12
Mapreduce in riak
13
Reduce Procedures, build in functions, keyfilters,link walking
14
Riak ring
15
Nodes/Writes/Reads Curl http://localhost:8091/riak/animals/ace?r= 3 http://localhost:8091/riak/animals/ace?r= 3 {"n_val":3,"r":2,"w":1} One,All,Quorum,Default(3) Curl http://localhost:8091/riak/animals/polly?r= quorum
16
Conflicts and hooks Vector Clocks Resolving conflicts as in git,svn Vector pruning Pre/Post-commit Hooks
17
Search and index Curl http://localhost:8091/solr/animals/select? q=breed:Shepherd http://localhost:8091/solr/animals/select? q=breed:Shepherd Wild cards Curl http://localhost:8091/solr/animals/select\ ?wt=json&q=nickname:rin%20breed:shepherd &q.op=and Indexing is done on metadata attached
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.