intro to graph world

139
1 Andreas Kollegger @akollegger #neo4j Introduction to Neo4j Thursday, January 24, 13

Upload: neo4j

Post on 09-May-2015

304 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intro to graph world

1

Andreas Kollegger@akollegger #neo4j

Introduction toNeo4j

Thursday, January 24, 13

Page 2: Intro to graph world

1

Andreas Kollegger@akollegger #neo4j

Introduction toNeo4j

Thursday, January 24, 13

Page 3: Intro to graph world

1

Thursday, January 24, 13

Page 4: Intro to graph world

2

Thursday, January 24, 13

Page 5: Intro to graph world

The Path Forward

2

Thursday, January 24, 13

Page 6: Intro to graph world

The Path Forward

1.Why graphs?

2

Thursday, January 24, 13

Page 7: Intro to graph world

The Path Forward

1.Why graphs?

2.What's a graph database?

2

Thursday, January 24, 13

Page 8: Intro to graph world

The Path Forward

1.Why graphs?

2.What's a graph database?

3.How do people use Neo4j?

2

Thursday, January 24, 13

Page 9: Intro to graph world

3

Thursday, January 24, 13

Page 10: Intro to graph world

Why graphs, why now?

3

!⛵☕

$

%⚾'

()* +,-

.

✈⛽ 1

23

4☕ 5

6

7 89:

;<

=

>

?@

B

C

D

E $F%

GHI

J

K

L

M

()

NOP

,Q

-*

Thursday, January 24, 13

Page 11: Intro to graph world

1.Big Data is the trend

Why graphs, why now?

3

! " #

$

%

&

*+

,⚽

.

/ 0

1

3

4

5 ⚾

7

8

9

:

;<

=> ?

@ A B

C!D

E F

G

H"

$

✈⛽,

.

0

1

I☕J

<

@KBL

MNG

OJ

#

%&

P

*

+Q

R

/

S

3

T

4U5

O

⚾7

8 V

9

W

:

X

;

=>

YZ

C

[

D\E

F]

H

AX

?!⛵☕

$

%⚾'

()* +,-

.

✈⛽ 1

23

4☕ 5

6

7 89:

;<

=

>

?@

B

C

D

E $F%

GHI

J

K

L

M

()

NOP

,Q

-*

Thursday, January 24, 13

Page 12: Intro to graph world

1.Big Data is the trend

2.NOSQL is the answer

Why graphs, why now?

3

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

! " #

$

%

&

*+

,⚽

.

/ 0

1

3

4

5 ⚾

7

8

9

:

;<

=> ?

@ A B

C!D

E F

G

H"

$

✈⛽,

.

0

1

I☕J

<

@KBL

MNG

OJ

#

%&

P

*

+Q

R

/

S

3

T

4U5

O

⚾7

8 V

9

W

:

X

;

=>

YZ

C

[

D\E

F]

H

AX

?!⛵☕

$

%⚾'

()* +,-

.

✈⛽ 1

23

4☕ 5

6

7 89:

;<

=

>

?@

B

C

D

E $F%

GHI

J

K

L

M

()

NOP

,Q

-*

Thursday, January 24, 13

Page 13: Intro to graph world

1.Big Data is the trend

2.NOSQL is the answer

3.Large in volume, and in variety

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

Why graphs, why now?

3

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

! " #

$

%

&

*+

,⚽

.

/ 0

1

3

4

5 ⚾

7

8

9

:

;<

=> ?

@ A B

C!D

E F

G

H"

$

✈⛽,

.

0

1

I☕J

<

@KBL

MNG

OJ

#

%&

P

*

+Q

R

/

S

3

T

4U5

O

⚾7

8 V

9

W

:

X

;

=>

YZ

C

[

D\E

F]

H

AX

?!⛵☕

$

%⚾'

()* +,-

.

✈⛽ 1

23

4☕ 5

6

7 89:

;<

=

>

?@

B

C

D

E $F%

GHI

J

K

L

M

()

NOP

,Q

-*

Thursday, January 24, 13

Page 14: Intro to graph world

1.Big Data is the trend

2.NOSQL is the answer

3.Large in volume, and in variety

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

Why graphs, why now?

3

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

! " #

$

%

&

*+

,⚽

.

/ 0

1

3

4

5 ⚾

7

8

9

:

;<

=> ?

@ A B

C!D

E F

G

H"

$

✈⛽,

.

0

1

I☕J

<

@KBL

MNG

OJ

#

%&

P

*

+Q

R

/

S

3

T

4U5

O

⚾7

8 V

9

W

:

X

;

=>

YZ

C

[

D\E

F]

H

AX

?!⛵☕

$

%⚾'

()* +,-

.

✈⛽ 1

23

4☕ 5

6

7 89:

;<

=

>

?@

B

C

D

E $F%

GHI

J

K

L

M

()

NOP

,Q

-*

! " #

$

%

&

'

+,

-

.

0

1

2 3

4

5

7

8

9

:

;

< ⚾

>

?@

A

B

C

DE

FG H

I J

KL

M

N

O!

PQ

R

S T

U V

W

X

Y

Z"

$

✈⛽-

1

3

4

5☕[

E

IKMP

SWX

\[

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾>

? @

A

B

C

]

D

FG

LN

O

Q

RTU

VY

Z

J]

H

! " #

$

%

&

'

+,

-

.

0

1

2 3

4

5

7

8

9

:

;

< ⚾

>

?@

A

B

C

DE

FG H

I J

KL

M

N

O!

PQ

R

S T

U V

W

X

Y

Z"

$

✈⛽-

1

3

4

5☕[

E

IKMP

SWX

\[

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾>

? @

A

B

C

]

D

FG

LN

O

Q

RTU

VY

Z

J]

H!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

!"#

$

%

&

'

+,

-

.

0

1

23

4

5

7

8

9

:

;

<⚾

>

?@

A

B

C

D E

FGH

IJ

KL

M

N

O !

PQ

R

ST

UV

W

X

Y

Z"

$

✈⛽ -

1

3

4

5☕ [

E

I KMP

S WX

\ [

#

%&

'

+

,.

0

2

7

8

9

:;<

\

⚾ >

?@

A

B

C

]

D

FG

LN

O

Q

R TU

VY

Z

J]

H

Thursday, January 24, 13

Page 15: Intro to graph world

3

Thursday, January 24, 13

Page 16: Intro to graph world

4

Thursday, January 24, 13

Page 17: Intro to graph world

4

Everyone is talking about graphs...

Thursday, January 24, 13

Page 18: Intro to graph world

4

Everyone is talking about graphs...

Facebook Open Graph

Thursday, January 24, 13

Page 19: Intro to graph world

4

Everyone is talking about graphs...

Facebook Open Graph

Thursday, January 24, 13

Page 20: Intro to graph world

5

Text

Thursday, January 24, 13

Page 21: Intro to graph world

Graphs are everywhere! I even have one...

5

Text

Thursday, January 24, 13

Page 22: Intro to graph world

A graph...

6

Thursday, January 24, 13

Page 23: Intro to graph world

A graph...

6

๏you know the common data structures

Thursday, January 24, 13

Page 24: Intro to graph world

A graph...

6

๏you know the common data structures

•linked lists, trees, object "graphs"

Thursday, January 24, 13

Page 25: Intro to graph world

A graph...

6

๏you know the common data structures

•linked lists, trees, object "graphs"

๏a graph is the general purpose data structure

Thursday, January 24, 13

Page 26: Intro to graph world

A graph...

6

๏you know the common data structures

•linked lists, trees, object "graphs"

๏a graph is the general purpose data structure

•suitable for any data that is related

Thursday, January 24, 13

Page 27: Intro to graph world

A graph...

6

๏you know the common data structures

•linked lists, trees, object "graphs"

๏a graph is the general purpose data structure

•suitable for any data that is related

๏well-understood patterns and algorithms

Thursday, January 24, 13

Page 28: Intro to graph world

A graph...

6

๏you know the common data structures

•linked lists, trees, object "graphs"

๏a graph is the general purpose data structure

•suitable for any data that is related

๏well-understood patterns and algorithms

•studied since Leonard Euler's 7 Bridges (1736)

Thursday, January 24, 13

Page 29: Intro to graph world

A graph...

6

๏you know the common data structures

•linked lists, trees, object "graphs"

๏a graph is the general purpose data structure

•suitable for any data that is related

๏well-understood patterns and algorithms

•studied since Leonard Euler's 7 Bridges (1736)

•Codd's Relational Model (1970)

Thursday, January 24, 13

Page 30: Intro to graph world

A graph...

6

๏you know the common data structures

•linked lists, trees, object "graphs"

๏a graph is the general purpose data structure

•suitable for any data that is related

๏well-understood patterns and algorithms

•studied since Leonard Euler's 7 Bridges (1736)

•Codd's Relational Model (1970)

•not a new idea, just an idea who's time is now

Thursday, January 24, 13

Page 31: Intro to graph world

A graph database...

7

Thursday, January 24, 13

Page 32: Intro to graph world

A graph database...

7

๏optimized for the connections between records

Thursday, January 24, 13

Page 33: Intro to graph world

A graph database...

7

๏optimized for the connections between records

๏really, really fast at querying across records

Thursday, January 24, 13

Page 34: Intro to graph world

A graph database...

7

๏optimized for the connections between records

๏really, really fast at querying across records

๏a database: transactional with the usual operations

Thursday, January 24, 13

Page 35: Intro to graph world

A graph database...

7

๏optimized for the connections between records

๏really, really fast at querying across records

๏a database: transactional with the usual operations

๏“A relational database may tell you the average age of everyone in this webinar,

but a graph database will tell you how to drive from Baltimore to San Francisco.”

Thursday, January 24, 13

Page 36: Intro to graph world

That last bullet is the key insight...

8

Thursday, January 24, 13

Page 37: Intro to graph world

9

Thursday, January 24, 13

Page 38: Intro to graph world

You know relational

9

Thursday, January 24, 13

Page 39: Intro to graph world

You know relational

9

Thursday, January 24, 13

Page 40: Intro to graph world

You know relational

9

foo

Thursday, January 24, 13

Page 41: Intro to graph world

You know relational

9

foo bar

Thursday, January 24, 13

Page 42: Intro to graph world

You know relational

9

foo barfoo_bar

Thursday, January 24, 13

Page 43: Intro to graph world

You know relational

9

foo barfoo_bar

Thursday, January 24, 13

Page 44: Intro to graph world

You know relational

9

foo barfoo_bar

Thursday, January 24, 13

Page 45: Intro to graph world

You know relational

9

foo barfoo_bar

Thursday, January 24, 13

Page 46: Intro to graph world

You know relational

9

now consider relationships...

Thursday, January 24, 13

Page 47: Intro to graph world

You know relational

9

now consider relationships...

Thursday, January 24, 13

Page 48: Intro to graph world

You know relational

9

now consider relationships...

Thursday, January 24, 13

Page 49: Intro to graph world

You know relational

9

now consider relationships...

Thursday, January 24, 13

Page 50: Intro to graph world

You know relational

9

now consider relationships...

Thursday, January 24, 13

Page 51: Intro to graph world

You know relational

9

now consider relationships...

Thursday, January 24, 13

Page 52: Intro to graph world

9

Thursday, January 24, 13

Page 53: Intro to graph world

10

Thursday, January 24, 13

Page 54: Intro to graph world

We're talking about aProperty Graph

10

Thursday, January 24, 13

Page 55: Intro to graph world

We're talking about aProperty Graph

10

Nodes

Thursday, January 24, 13

Page 56: Intro to graph world

We're talking about aProperty Graph

10

Nodes

Relationships

Thursday, January 24, 13

Page 57: Intro to graph world

Emil

Andrés

Lars

Johan

Allison

Peter

Michael

Tobias

Andreas

IanMica

Delia

knows

knows

knowsknows

knows

knows

knows

knows

knows

knowsMica

knowsknowsMica

Delia

knows

We're talking about aProperty Graph

10

Nodes

Relationships

Properties (each a key+value)

+ Indexes (for easy look-ups)

Thursday, January 24, 13

Page 58: Intro to graph world

10

Thursday, January 24, 13

Page 59: Intro to graph world

Neo4j - the Graph Database

11

Thursday, January 24, 13

Page 60: Intro to graph world

Google "neo4j"

12

Thursday, January 24, 13

Page 61: Intro to graph world

Google "neo4j"๏neo4j.org

12

Thursday, January 24, 13

Page 62: Intro to graph world

Google "neo4j"๏neo4j.org

๏neotechnology.com

12

Thursday, January 24, 13

Page 63: Intro to graph world

Google "neo4j"๏neo4j.org

๏neotechnology.com

๏github.com/neo4j

12

Thursday, January 24, 13

Page 64: Intro to graph world

Google "neo4j"๏neo4j.org

๏neotechnology.com

๏github.com/neo4j

๏neo4j.meetup.com

12

Thursday, January 24, 13

Page 65: Intro to graph world

Google "neo4j"๏neo4j.org

๏neotechnology.com

๏github.com/neo4j

๏neo4j.meetup.com

๏graphconnect.com

12

Thursday, January 24, 13

Page 66: Intro to graph world

How to get started?

13

Thursday, January 24, 13

Page 67: Intro to graph world

How to get started?๏ Documentation

13

Thursday, January 24, 13

Page 68: Intro to graph world

How to get started?๏ Documentation

•docs.neo4j.org - tutorials+reference

13

Thursday, January 24, 13

Page 69: Intro to graph world

How to get started?๏ Documentation

•docs.neo4j.org - tutorials+reference

•Neo4j in Action

13

Thursday, January 24, 13

Page 70: Intro to graph world

How to get started?๏ Documentation

•docs.neo4j.org - tutorials+reference

•Neo4j in Action

•Good Relationships

13

Thursday, January 24, 13

Page 71: Intro to graph world

How to get started?๏ Documentation

•docs.neo4j.org - tutorials+reference

•Neo4j in Action

•Good Relationships

๏ Get Neo4j

13

Thursday, January 24, 13

Page 72: Intro to graph world

How to get started?๏ Documentation

•docs.neo4j.org - tutorials+reference

•Neo4j in Action

•Good Relationships

๏ Get Neo4j

•http://neo4j.org/download

13

Thursday, January 24, 13

Page 73: Intro to graph world

How to get started?๏ Documentation

•docs.neo4j.org - tutorials+reference

•Neo4j in Action

•Good Relationships

๏ Get Neo4j

•http://neo4j.org/download

•http://addons.heroku.com/neo4j/

13

Thursday, January 24, 13

Page 74: Intro to graph world

How to get started?๏ Documentation

•docs.neo4j.org - tutorials+reference

•Neo4j in Action

•Good Relationships

๏ Get Neo4j

•http://neo4j.org/download

•http://addons.heroku.com/neo4j/

๏ Participate

•ask questions on Stack Overflow

•http://groups.google.com/group/neo4j

•http://neo4j.meetup.com

13

Thursday, January 24, 13

Page 75: Intro to graph world

How to get started?๏ Documentation

•docs.neo4j.org - tutorials+reference

•Neo4j in Action

•Good Relationships

๏ Get Neo4j

•http://neo4j.org/download

•http://addons.heroku.com/neo4j/

๏ Participate

•ask questions on Stack Overflow

•http://groups.google.com/group/neo4j

•http://neo4j.meetup.com

•webinars, every month on everything from intro to production13

Thursday, January 24, 13

Page 76: Intro to graph world

Neo4j is a Graph Database

14

Thursday, January 24, 13

Page 77: Intro to graph world

Neo4j is a Graph Database• A Graph Database:

14

Thursday, January 24, 13

Page 78: Intro to graph world

Neo4j is a Graph Database• A Graph Database:

• a Property Graph with Nodes, Relationshipsand Properties on both

14

Thursday, January 24, 13

Page 79: Intro to graph world

Neo4j is a Graph Database• A Graph Database:

• a Property Graph with Nodes, Relationshipsand Properties on both

• perfect for complex, highly connected data

14

Thursday, January 24, 13

Page 80: Intro to graph world

Neo4j is a Graph Database• A Graph Database:

• a Property Graph with Nodes, Relationshipsand Properties on both

• perfect for complex, highly connected data

• A Graph Database:

14

Thursday, January 24, 13

Page 81: Intro to graph world

Neo4j is a Graph Database• A Graph Database:

• a Property Graph with Nodes, Relationshipsand Properties on both

• perfect for complex, highly connected data

• A Graph Database:

• reliable with real ACID Transactions

14

Thursday, January 24, 13

Page 82: Intro to graph world

Neo4j is a Graph Database• A Graph Database:

• a Property Graph with Nodes, Relationshipsand Properties on both

• perfect for complex, highly connected data

• A Graph Database:

• reliable with real ACID Transactions• scalable: 32 Billion Nodes, 32 Billion Relationships, 64 Billion

Properties

14

Thursday, January 24, 13

Page 83: Intro to graph world

Neo4j is a Graph Database• A Graph Database:

• a Property Graph with Nodes, Relationshipsand Properties on both

• perfect for complex, highly connected data

• A Graph Database:

• reliable with real ACID Transactions• scalable: 32 Billion Nodes, 32 Billion Relationships, 64 Billion

Properties

• Server with REST API, or Embeddable on the JVM

14

Thursday, January 24, 13

Page 84: Intro to graph world

Neo4j is a Graph Database• A Graph Database:

• a Property Graph with Nodes, Relationshipsand Properties on both

• perfect for complex, highly connected data

• A Graph Database:

• reliable with real ACID Transactions• scalable: 32 Billion Nodes, 32 Billion Relationships, 64 Billion

Properties

• Server with REST API, or Embeddable on the JVM• high-performance with High-Availability (read scaling)

14

Thursday, January 24, 13

Page 85: Intro to graph world

15

Thursday, January 24, 13

Page 86: Intro to graph world

And, but, so how do you query this "graph" database?

15

Thursday, January 24, 13

Page 87: Intro to graph world

16

Thursday, January 24, 13

Page 88: Intro to graph world

16

Cypher - a graph query language๏a pattern-matching query language

๏declarative grammar with clauses (like SQL)

๏aggregation, ordering, limits

๏create, read, update, delete

Thursday, January 24, 13

Page 89: Intro to graph world

16

Cypher - a graph query language๏a pattern-matching query language

๏declarative grammar with clauses (like SQL)

๏aggregation, ordering, limits

๏create, read, update, delete// get node from an index named “foo”start foo=node:people(name=‘Andreas’) return foo

// find “bar” nodes related to Andreasstart foo=node:people(name=‘Andreas’)match (foo)-->(bar) return bar

// create a nodecreate (me {name:'Andreas'})

Thursday, January 24, 13

Page 90: Intro to graph world

17

Thursday, January 24, 13

Page 91: Intro to graph world

Is it production ready?

17

Thursday, January 24, 13

Page 92: Intro to graph world

18

Thursday, January 24, 13

Page 93: Intro to graph world

Neo4j HA - High Availability Cluster

18

Thursday, January 24, 13

Page 94: Intro to graph world

Neo4j HA - High Availability Cluster

18

•master-slave replication

Load Balancer

Thursday, January 24, 13

Page 95: Intro to graph world

Neo4j HA - High Availability Cluster

18

•master-slave replication

• read-scaling

Load Balancer

Thursday, January 24, 13

Page 96: Intro to graph world

Neo4j HA - High Availability Cluster

18

•master-slave replication

• read-scaling

• single datacenter, or global zones

Load Balancer

Thursday, January 24, 13

Page 97: Intro to graph world

Neo4j HA - High Availability Cluster

18

•master-slave replication

• read-scaling

• single datacenter, or global zones

• tolerance for high-latency

Load Balancer

Thursday, January 24, 13

Page 98: Intro to graph world

Neo4j HA - High Availability Cluster

18

•master-slave replication

• read-scaling

• single datacenter, or global zones

• tolerance for high-latency

• redundancy provides improved uptime

Load Balancer

Thursday, January 24, 13

Page 99: Intro to graph world

Neo4j HA - High Availability Cluster

18

•master-slave replication

• read-scaling

• single datacenter, or global zones

• tolerance for high-latency

• redundancy provides improved uptime

• automatic failoverLoad Balancer

Thursday, January 24, 13

Page 100: Intro to graph world

Neo4j HA - High Availability Cluster

18

•master-slave replication

• read-scaling

• single datacenter, or global zones

• tolerance for high-latency

• redundancy provides improved uptime

• automatic failoverLoad Balancer

Thursday, January 24, 13

Page 101: Intro to graph world

Neo4j HA - High Availability Cluster

18

Load Balancer

Thursday, January 24, 13

Page 102: Intro to graph world

19

Real World Use Cases:

Thursday, January 24, 13

Page 103: Intro to graph world

19

[A] Mmm Pancakes

Real World Use Cases:

Thursday, January 24, 13

Page 104: Intro to graph world

19

[A] Mmm Pancakes[B] ACL from Hell

Real World Use Cases:

Thursday, January 24, 13

Page 105: Intro to graph world

19

[A] Mmm Pancakes[B] ACL from Hell[C] Master of your Domain

Real World Use Cases:

Thursday, January 24, 13

Page 106: Intro to graph world

Thursday, January 24, 13

Page 107: Intro to graph world

[A] Mmm Pancakes

Thursday, January 24, 13

Page 108: Intro to graph world

[A] Mmm Pancakes

Thursday, January 24, 13

Page 109: Intro to graph world

Thursday, January 24, 13

Page 110: Intro to graph world

[A] Mozilla Pancake

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 111: Intro to graph world

[A] Mozilla Pancake

• Experimental cloud-based browser

• Built to improve how users Discover, Collect, Share & Organize things on the web

• Goal: help users better access & curate information on the net, on any device

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 112: Intro to graph world

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 113: Intro to graph world

Why Neo4J?

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 114: Intro to graph world

Why Neo4J?

• The internet is a network of pages connected to each other. What better way to model that than in graphs?

• No time lost fighting with less expressive datastores

• Easy to implement experimental features

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 115: Intro to graph world

Cute meta + data

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 116: Intro to graph world

Cute meta + data

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 117: Intro to graph world

Neo4J Co-Existence

• Node uuids as refs in external ElasticSearch also in internal Lucene

• Custom search ranking for user history based on node relationship data

• MySQL for user data, Redis for metrics

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 118: Intro to graph world

Mozilla Pancake

Available on BitBucket:https://bitbucket.org/mozillapancake/pancake

Questions?Olivier Yiptong: [email protected]

This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/

Thursday, January 24, 13

Page 119: Intro to graph world

Thursday, January 24, 13

Page 120: Intro to graph world

[B] ACL from Hell

One of the top 10 telcos worldwide

Thursday, January 24, 13

Page 121: Intro to graph world

Background

Telenor calculated in 2010 that it´s self-service web solution for companies, MinBedrift, would not scale with the projected customer and subscription growth beyond 2012.

Projected Growth

2010 2015

Limit

Thursday, January 24, 13

Page 122: Intro to graph world

[B] Telenor Background

Background

Telenor calculated in 2010 that it´s self-service web solution for companies, MinBedrift, would not scale with the projected customer and subscription growth beyond 2012.

Projected Growth

2010 2015

Limit

Thursday, January 24, 13

Page 123: Intro to graph world

[B] Telenor Background

Background

Telenor calculated in 2010 that it´s self-service web solution for companies, MinBedrift, would not scale with the projected customer and subscription growth beyond 2012.

Projected Growth

2010 2015

Limit

• MinBedrif, a self service web solution for companies

• 2010 - calculated that it would not scale with projected growth

Thursday, January 24, 13

Page 124: Intro to graph world

Example Access Authorization

Access may be given directly or by inheritance

U

C

S

C

A A A

S S S S S

User

Customer

Account

Subscription Inherit = true U

Inherit = true

Inherit = false

C

A

S S

C

A

S S

Thursday, January 24, 13

Page 125: Intro to graph world

Business Case

The business case is built on the negative consequence of NOT addressing the problem.

Loss of customers (income)

Reduced sales transactions (income)

Other

Increased manual support (expenses)

Thursday, January 24, 13

Page 126: Intro to graph world

30

Thursday, January 24, 13

Page 127: Intro to graph world

Current ACL Service

30

Thursday, January 24, 13

Page 128: Intro to graph world

Current ACL Service

•Stored procedure in DB calculating all access

• cached results for up to 24 hours

• minutes to calculate for large customers

• extremely complex to understand (1500 lines)

• depends on temporary tables

• joins across multiple tables

30

Thursday, January 24, 13

Page 129: Intro to graph world

31

Thursday, January 24, 13

Page 130: Intro to graph world

ACL With Neo4j

31

Thursday, January 24, 13

Page 131: Intro to graph world

ACL With Neo4j๏Faster than current solution

๏Simpler to understand the logic

๏Avoid large temporary tables

๏Tailored for service (resource authorization)

31

Thursday, January 24, 13

Page 132: Intro to graph world

Thursday, January 24, 13

Page 133: Intro to graph world

[C] Master of your Domain

Thursday, January 24, 13

Page 134: Intro to graph world

[C] MDM within Ciscomaster data management, sales compensation management, online customer support

Architecture3-node Enterprise cluster with mirrored disaster recovery clusterDedicated hardware in own datacenterEmbedded in custom webapp

Sizing35 million nodes50 million relationships600 million properties

DescriptionReal-time conflict detection in sales compensation management. Business-critical “P1” system. Neo4j allows Cisco to model complex algorithms, which still maintaining high performance over a large dataset.

BackgroundNeo4j replaces Oracle RAC, which was not performant enough for the use case.

BenefitsPerformance : “Minutes to Milliseconds”Outperforms Oracle RAC, serving complex queries in real timeFlexibilityAllows for Cisco to model interconnected data and complex queries with easeRobustnessWith 9+ years of production experience, Neo4j brings a solid product.

Thursday, January 24, 13

Page 135: Intro to graph world

34

Thursday, January 24, 13

Page 136: Intro to graph world

34

Really, once you start thinking in graphs it's hard to stop

Recommendations MDM

Systems ManagementGeospatial

Social computing

Business intelligence

Biotechnology

Making Sense of all that data

your brainaccess control

linguistics

catalogs

genealogy routing

compensationmarket vectors

Thursday, January 24, 13

Page 137: Intro to graph world

34

Really, once you start thinking in graphs it's hard to stop

Recommendations MDM

Systems ManagementGeospatial

Social computing

Business intelligence

Biotechnology

Making Sense of all that data

your brainaccess control

linguistics

catalogs

genealogy routing

compensationmarket vectors

What will you build?

Thursday, January 24, 13

Page 138: Intro to graph world

35

Thursday, January 24, 13

Page 139: Intro to graph world

35

and, Thanks :)

Neo4j

Thursday, January 24, 13