Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
riak-js
Search
Mathias Meyer
January 17, 2013
Programming
320
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
riak-js
History and tour of riak-js, the Node.js client for Riak.
Mathias Meyer
January 17, 2013
More Decks by Mathias Meyer
See All by Mathias Meyer
Building and Scaling an Distributed and Inclusive Team
roidrage
0
1.4k
cooking infrastructure with chef
roidrage
4
260
The Message Queue is Dead, Long Live the Message Queue
roidrage
4
730
designing for concurrency with riak
roidrage
11
1.9k
metrics, monitoring, logging
roidrage
82
15k
design for cloud - jax 2012
roidrage
2
340
A Riak Query Tale
roidrage
5
1k
Don't Use NoSQL
roidrage
10
1.1k
Designing Applications for Amazon Web Services (GOTO Aarhus)
roidrage
6
380
Other Decks in Programming
See All in Programming
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.3k
アクセシビリティから考える情報設計
high_g_engineer
0
310
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.5k
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
760
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
640
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
0
250
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
150
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
130
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
2
760
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
120
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
デプロイ直後のレイテンシスパイクを調べたら、 Railsの仕様にたどり着いた
nhsykym
0
110
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
Code Review Best Practice
trishagee
74
20k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
890
Ruling the World: When Life Gets Gamed
codingconduct
0
330
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.9k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
930
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Transcript
riak-js Mathias Meyer, @roidrage, Riak Meetup NYC
travis-ci.org
riakhandbook.com
riak-js
simple node.js library for riak
simple node.js library for riak
heavily used in riak handbook
ancient history
first commit
2 march 2010
frank06/riak-js
javascript
port to coffeescript
rewritten in javascript
mostlyserious/riak-js
senchalabs/riak-js
mostlyserious/riak-js
apply(roidrage)
october 2011
v0.4.1
api changes
november 2012
v0.9.0
simple interface
riak = require('riak-js').getClient()
riak.get('users', 'roidrage')
user = {name: 'Mathias Meyer'} riak.save('users', 'roidrage', user)
riak.get('users', 'roidrage', function(error, data) { console.log(data); } )
riak.get('users', 'roidrage', function(error, data) { if (error.notFound) { console.log('User doesn't
exist!'); } } )
meta
riak.get('users', 'roidrage', {r: 1});
riak.get('users', 'roidrage', function(error, data, meta) { console.log(meta.vclock); } )
reusable
riak.get('users', 'roidrage', function(error, user, meta) { user.city = 'Berlin'; riak.save('users',
'roidrage', user, meta); } )
links
riak.save('users', 'roidrage', user, {links: [{bucket: 'users', key: 'tsantero', tag: 'bromance'}]
});
riak.walk('users', 'roidrage', [['users', '_', 'bromance']])
map reduce
riak.mapreduce.add('users'). map('Riak.mapValuesJson'). run()
riak.mapreduce.add('users'). map(function(obj) { return [obj.values[0]]; }). run()
javascript!
riak.mapreduce.add('users'). map(function(v) { return [v.values[0].name]; }). reduce('Riak.reduceSort'). run()
search
riak.saveBucket('users', {search: true})
riak.save('users', 'roidrage', {name: 'Mathias Meyer'});
riak.search.find('users', 'name:Mathias*')
search — map reduce
riak.mapreduce.search('users', 'name:Mathias*'). map('Riak.mapValuesJson'). run()
secondary indexes
riak.save('users', 'roidrage', {name: 'Mathias Meyer'}, {index: {name: 'Mathias Meyer', born:
1977}});
riak.query('users', {born: 1977})
riak.query('users', {born: [1977, 1980]})
instrumentation
riak.registerListener({ 'riak.request.end': function(event) {}, 'riak.request.start': function(event) {} });
metrics
riak.registerListener({ 'riak.request.end': function(event) { var duration = event.finished_at - event.started_at,
name = 'riak.request.' + event.method.toLowerCase(); metrics.timing(name, runtime); } });
related: http://www.paperplanes.de/2012/12/27/a-plea-for-client-library-instrumentation.html
the future
protocol buffers
custom agents
reconciling conflicts
riak.get('users', 'roidrage', function(error, data, meta) { if (meta.status == 300)
{ // merge siblings } } )
riak.onConflict(function(siblings) { return siblings.reduce(...); })
riak cs
yokozuna