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
Graphs + Hamsters
Search
Lucas Dohmen
November 09, 2013
Programming
0
310
Graphs + Hamsters
My talk about Graphs, Hamsters & ArangoDB from yesterday.
Lucas Dohmen
November 09, 2013
Tweet
Share
More Decks by Lucas Dohmen
See All by Lucas Dohmen
Frontend Architecture
moonglum
1
66
Weird Parts
moonglum
0
79
Webanwendungen – Eine Frage des Stils
moonglum
0
260
AdequateJS: Where should I run my Code?
moonglum
0
45
Per Anhalter durch JavaScript
moonglum
0
140
Architectures for Modern Web Front Ends
moonglum
2
470
Per Anhalter durch JavaScript
moonglum
0
180
Architectures for Modern Web Front Ends
moonglum
0
100
AdequateJS: Wie viel JavaScript darf es denn sein?
moonglum
1
360
Other Decks in Programming
See All in Programming
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
250
開発効率向上のためのリファクタリングの一歩目の選択肢 ~コード分割~ / JJUG CCC 2024 Fall
ryounasso
0
370
gopls を改造したら開発生産性が高まった
satorunooshie
8
240
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
200
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
150
WEBエンジニア向けAI活用入門
sutetotanuki
0
300
CSC509 Lecture 08
javiergs
PRO
0
110
GCCのプラグインを作る / I Made a GCC Plugin
shouth
1
150
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
250
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
160
cXML という電子商取引の トランザクションを支える プロトコルと向きあっている話
phigasui
3
2.3k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
440
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
50
7.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
Optimizing for Happiness
mojombo
376
69k
Faster Mobile Websites
deanohume
304
30k
GraphQLとの向き合い方2022年版
quramy
43
13k
A designer walks into a library…
pauljervisheath
202
24k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
107
49k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Building an army of robots
kneath
302
42k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
Rails Girls Zürich Keynote
gr2m
93
13k
Transcript
RWTH Aachen, Computer Science Student triAGENS GmbH, Developer moonglum moonbeamlabs
by Lucas Dohmen Graphs and Hamsters Modelling things differently
Hamster + Food = ❤️
Cave 1 Cave 2 Tunnel
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9
Task • The hamster wants to know how much grain
and how much nuts it has • It can’t remember the way back if it travels through more than two caves • It remembers which caves it already has visited
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9 Grain: 0 Nuts: 0
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9 Grain: 2 Nuts: 3
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9 Grain: 4 Nuts: 3
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9
Grain: 0 Nuts: 0 Grain: 2 Nuts: 3 Grain: 2
Nuts: 0 Grain: 5 Nuts: 5 Grain: 1 Nuts: 1 Grain: 0 Nuts: 2 Grain: 1 Nuts: 1 Grain: 2 Nuts: 1 Grain: 8 Nuts: 9
Grain: 13 Nuts: 13
The hamster is a visitor • There’s a natural way
to implement it called traversals • There are a lot of things that you can implement very comfortably with traversals
ArangoDB • Free & Open Source • Documents & Graphs
• ArangoDB Query Language, but also simple queries • Real transactions • Master/Slave Replication • Extensible API • Embedded V8 • Extremely space efficient • High performance
Post Request to /_api/traversal { "startVertex": "caves/Start", "edgeCollection": "tunnel", "direction":
"any", "minDepth": 1, "maxDepth": 2, "uniqueness": { "vertices":"global", "edges":"global" }, "init": "result.grain = 0;result.nuts = 0;", "visitor": "result.grain += vertex.grain;result.nuts += vertex.nuts" }
ArangoDB + Graphs • Graphical Graph Explorer is part of
the admin interface • AQL has support for graphs • Iterators as shown before • Built in algorithms like shortest path etc.
ArangoDB + Ruby • Ashikawa Core (https://github.com/triagens/ ashikawa-core): Low Level
Driver • Guacamole (https://github.com/triagens/ guacamole): ODM with Rails Support