Page 10 "Я из Одессы я просто бухаю." translation: I'm from Odessa I just drink. Meaning his drinking a lot of "Vodka" ^_^ (@tuc @hackernews)
This is local meme - when someone asking question and you will look stupid in case you don't have answer.
Max KlymyshynHead of Software Architecture at Takeoff Technologies, Inc. um Takeoff Technologies, Inc.
4. Relational to Graph model
crash course
“Switching from relational to the graph model”!
by Luca Garulli
http://goo.gl/z08qwk!
!
http://www.slideshare.net/lvca/switching-from-relational-to-the-graph-model
9. create table nodes (
node integer primary key,
name varchar(10) not null,
feat1 char(1), feat2 char(1))
!
create table edges (
a integer not null references nodes(node) on update cascade on delete cascade,
b integer not null references nodes(node) on update cascade on delete cascade,
primary key (a, b));
!
create index a_idx ON edges(a);
create index b_idx ON edges(b);
!
create
!
unique index pair_unique_idx on edges (LEAST(a, b), GREATEST(a, b));
; and no self-loops
alter table edges add constraint no_self_loops_chk check (a <> b);
!
insert
insert
insert
insert
insert
insert
insert
!
into
into
into
into
into
into
into
nodes
nodes
nodes
nodes
nodes
nodes
nodes
values
values
values
values
values
values
values
(1,
(2,
(3,
(4,
(5,
(6,
(7,
'node1',
'node2',
'node3',
'node4',
'node5',
'node6',
'node7',
'x',
'x',
'x',
'z',
'x',
'x',
'x',
'y');
'w');
'w');
'w');
'y');
'z');
'y');
insert into edges values (1, 3), (2, 1),
(2, 4), (3, 4), (3, 5), (3, 6), (4, 7), (5, 1), (5, 6), (6, 1);
!
; directed graph
select * from nodes n left join edges e on n.node = e.b where e.a = 2;
!
; undirected graph
select * from nodes where node in (select case when a=1 then b else a end from edges where 1
in (a,b));
!
12. Most famous graph
database.
•
1,333 mentions within repositories on Github
•
1,140,000 results in Google
•
26,868 tweets
•
Really nice Admin interface
•
Awesome help tips
13. A lot of python libraries
Py2Neo, Neomodel, neo4django, bulbflow
14. ; Create a node1, node2 and
; relation RELATED between two nodes
CREATE (node1 {name:"node1"}),
(node2 {name: "node2"}),
(node1)-[:RELATED]->(node2);
!
16. neo4j is friendly and powerful.
The only thing is a bit complex
querying language – Cypher
25. •
NoSQL Database storage
•
Graph of documents
•
AQL (arango query language) to execute graph queries
•
Edge data type to create edges between nodes (with
properties)
•
Multiple edges collections to keep different kind of
edges
•
Support of Gremlin graph query language
26. Small experiment with graphs and twitter:!
I’ve looked on my tweets and people who added it
to favorites.
After that I’ve looked to that person’s tweets and did
the same thing with people who favorited their
tweets.