introducing neo4j 3.1: new security and clustering architecture

111
Introducing Neo4j 3.1 New Security and Clustering Architecture

Upload: neo4j-the-fastest-and-most-scalable-native-graph-database

Post on 16-Apr-2017

619 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Introducing Neo4j 3.1: New Security and Clustering Architecture

Introducing Neo4j 3.1New Security and Clustering Architecture

Page 3: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 4: Introducing Neo4j 3.1: New Security and Clustering Architecture

●●

●○○○

Page 5: Introducing Neo4j 3.1: New Security and Clustering Architecture

3.1

Page 6: Introducing Neo4j 3.1: New Security and Clustering Architecture

New Binary Protocol ProceduresNew Language Drivers

Page 7: Introducing Neo4j 3.1: New Security and Clustering Architecture

3.1

Page 8: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 9: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 10: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 11: Introducing Neo4j 3.1: New Security and Clustering Architecture

3.1

Page 12: Introducing Neo4j 3.1: New Security and Clustering Architecture

http://graphconnect.com/

Page 13: Introducing Neo4j 3.1: New Security and Clustering Architecture

Massive Throughput

Page 14: Introducing Neo4j 3.1: New Security and Clustering Architecture

Data Redundancy

Page 15: Introducing Neo4j 3.1: New Security and Clustering Architecture

Data Redundancy

Page 16: Introducing Neo4j 3.1: New Security and Clustering Architecture

Data Redundancy

Page 17: Introducing Neo4j 3.1: New Security and Clustering Architecture

Data Redundancy

Page 18: Introducing Neo4j 3.1: New Security and Clustering Architecture

High Availability

Page 19: Introducing Neo4j 3.1: New Security and Clustering Architecture

High Availability

Page 20: Introducing Neo4j 3.1: New Security and Clustering Architecture

High Availability

Error!503: Service Unavailable

Page 21: Introducing Neo4j 3.1: New Security and Clustering Architecture

High Availability

Error!503: Service Unavailable

Page 22: Introducing Neo4j 3.1: New Security and Clustering Architecture

High Availability

Error!503: Service Unavailable

Page 23: Introducing Neo4j 3.1: New Security and Clustering Architecture

High Availability

Error!503: Service Unavailable

Page 24: Introducing Neo4j 3.1: New Security and Clustering Architecture

High Availability

Error!503: Service Unavailable

Page 25: Introducing Neo4j 3.1: New Security and Clustering Architecture

Data RedundancyMassive Throughput High Availability

Page 26: Introducing Neo4j 3.1: New Security and Clustering Architecture

Data RedundancyMassive Throughput High Availability

3.0

Page 27: Introducing Neo4j 3.1: New Security and Clustering Architecture

Data RedundancyMassive Throughput High Availability

3.0

Bigger Clusters Consensus Commit Built-in load balancing

3.1Causal

Clustering

Page 28: Introducing Neo4j 3.1: New Security and Clustering Architecture

Replica

Core

Page 29: Introducing Neo4j 3.1: New Security and Clustering Architecture

• Small group of Neo4j databases• Fault-tolerant Consensus Commit • Responsible for data safety

Core

Page 30: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing to the Core Cluster

Neo4j Driver Neo4j Cluster

Page 31: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing to the Core Cluster

Neo4j Driver

CREATE (:User {...})

Neo4j Cluster

Page 32: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing to the Core Cluster

Neo4j Driver

CREATE (:User {...})

Neo4j Cluster

Page 33: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing to the Core Cluster

Neo4j Driver

CREATE (:User {...})

Neo4j Cluster

Page 34: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing to the Core Cluster

Neo4j Driver

CREATE (:User {...})

Neo4j Cluster

Page 35: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing to the Core Cluster

Neo4j Driver

CREATE (:User {...})

Neo4j Cluster

Page 36: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing to the Core Cluster

Neo4j Driver

Success

Neo4j Cluster

Page 37: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing to the Core Cluster

Neo4j Driver

Success

Neo4j Cluster

Page 38: Introducing Neo4j 3.1: New Security and Clustering Architecture

• Small group of Neo4j databases• Fault-tolerant Consensus Commit • Responsible for data safety

Core

Page 39: Introducing Neo4j 3.1: New Security and Clustering Architecture

• For massive query throughput• Read-only replicas• Not involved in Consensus Commit • Disposable, suitable for auto-scaling

Replica

Page 40: Introducing Neo4j 3.1: New Security and Clustering Architecture

Propagating updates to the Replica

Neo4j Driver Neo4j Cluster

Page 41: Introducing Neo4j 3.1: New Security and Clustering Architecture

Propagating updates to the Replica

Neo4j Driver Neo4j Cluster

Write

Page 42: Introducing Neo4j 3.1: New Security and Clustering Architecture

Propagating updates to the Replica

Neo4j Driver Neo4j Cluster

Write

Page 43: Introducing Neo4j 3.1: New Security and Clustering Architecture

Reading from the Replica

Neo4j Driver Neo4j Cluster

Read

Page 44: Introducing Neo4j 3.1: New Security and Clustering Architecture

Replica

Core Updating the graph

Queries, analysis, reporting

Page 46: Introducing Neo4j 3.1: New Security and Clustering Architecture

:sysinfo

Page 47: Introducing Neo4j 3.1: New Security and Clustering Architecture

Writing an application forNeo4j Causal Clustering

Page 48: Introducing Neo4j 3.1: New Security and Clustering Architecture

App Server

Neo4j Driver

Bolt protocol

Page 49: Introducing Neo4j 3.1: New Security and Clustering Architecture

Java<dependency> <groupId>org.neo4j.driver</groupId> <artifactId>neo4j-java-driver</artifactId></dependency>

Python

pip install neo4j-driver

.NET

PM> Install-Package Neo4j.Driver

JavaScript

npm install neo4j-driver

Page 50: Introducing Neo4j 3.1: New Security and Clustering Architecture

https://neo4j.com/developer/language-guides

Page 51: Introducing Neo4j 3.1: New Security and Clustering Architecture

bolt://

GraphDatabase.driver( "bolt://aServer" )

Page 52: Introducing Neo4j 3.1: New Security and Clustering Architecture

bolt+routing://

GraphDatabase.driver( "bolt+routing://aCoreServer" )

Page 53: Introducing Neo4j 3.1: New Security and Clustering Architecture

GraphDatabase.driver( "bolt+routing://aCoreServer" )

Bootstrap: specify any core server to route load across the whole cluster

bolt+routing://

Page 54: Introducing Neo4j 3.1: New Security and Clustering Architecture

Application Server

Neo4j DriverMax

Jim

Jane

Mark

Page 55: Introducing Neo4j 3.1: New Security and Clustering Architecture

Routed write statements

driver = GraphDatabase.driver( "bolt+routing://aCoreServer" );

try ( Session session = driver.session( AccessMode.WRITE ) )

{

try ( Transaction tx = session.beginTransaction() )

{

tx.run( "MERGE (user:User {userId: {userId}})",

parameters( "userId", userId ) );

tx.success();

}

}

Page 56: Introducing Neo4j 3.1: New Security and Clustering Architecture

Routed read queries

driver = GraphDatabase.driver( "bolt+routing://aCoreServer" );

try ( Session session = driver.session( AccessMode.READ ) )

{

try ( Transaction tx = session.beginTransaction() )

{

tx.run( "MATCH (user:User {userId: {userId}})-[*]-(:Product) RETURN *",

parameters( "userId", userId ) );

tx.success();

}

}

Page 57: Introducing Neo4j 3.1: New Security and Clustering Architecture

Consistency

Page 58: Introducing Neo4j 3.1: New Security and Clustering Architecture

Register

Login

You need to login in

to continue your

purchase!

Page 59: Introducing Neo4j 3.1: New Security and Clustering Architecture

Register

Login

You need to login in

to continue your

purchase!

Username:

Password:

Create Account

Page 60: Introducing Neo4j 3.1: New Security and Clustering Architecture

Register

Login

You need to login in

to continue your

purchase!

Username:

jim_w

Password:

********

Create Account

Page 61: Introducing Neo4j 3.1: New Security and Clustering Architecture

Register

Login

You need to login in

to continue your

purchase!

Username:

Password:

Login

Page 62: Introducing Neo4j 3.1: New Security and Clustering Architecture

Username:

jim_w

Password:

********

Login

Page 63: Introducing Neo4j 3.1: New Security and Clustering Architecture

Purchase

Login Successful

Try again

No account found!Username:

jim_w

Password:

********

Login

Page 64: Introducing Neo4j 3.1: New Security and Clustering Architecture

Username:

jim_w

Password:

********

A few moments later...

Login

Page 65: Introducing Neo4j 3.1: New Security and Clustering Architecture

Purchase

Login SuccessfulUsername:

jim_w

Password:

********

Login

A few moments later...

Page 66: Introducing Neo4j 3.1: New Security and Clustering Architecture

Q Why didn’t this work?A Eventual Consistency

Page 67: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

Create Account

App Server A Driver

Page 68: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

Page 69: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

Page 70: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11CREATE (:User)Create Account

App Server A Driver

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

Page 71: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11CREATE (:User)Create Account

App Server A Driver

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

Page 72: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

Page 73: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

MATCH (:User)Login

App Server B Driver

Page 74: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

MATCH (:User)Login

App Server B Driver

Page 75: Introducing Neo4j 3.1: New Security and Clustering Architecture

Bookmark

• Session token• String (for portability)• Opaque to application• Represents ultimate user’s most recent

view of the graph• More capabilities to come

Page 76: Introducing Neo4j 3.1: New Security and Clustering Architecture

Let’s try again, with Causal Consistency

Page 77: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

Create Account

App Server A Driver

Page 78: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

Page 79: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

Page 80: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11CREATE (:User)Create Account

App Server A Driver

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

Page 81: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11CREATE (:User)Create Account

App Server A Driver

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

Page 82: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

Page 83: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

CREATE (:User)Create Account

App Server A Driver

MATCH (:User)Login

App Server B Driver

Page 84: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

CREATE (:User)Create Account

MATCH (:User)Login

App Server A

App Server B

Driver

Driver

Page 85: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

CREATE (:User)Create Account

MATCH (:User)Login

App Server A

App Server B

Driver

Driver

11

Page 86: Introducing Neo4j 3.1: New Security and Clustering Architecture

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

CREATE (:User)Create Account

MATCH (:User)Login

App Server A

App Server B

Driver

Driver

11

Page 87: Introducing Neo4j 3.1: New Security and Clustering Architecture

Replica

Core Updating the graph

Queries, analysis, reporting

Page 88: Introducing Neo4j 3.1: New Security and Clustering Architecture

Neo4j 3.0 Neo4j 3.1High Availability Cluster Causal Cluster

Master-Slave architecture

Paxos consensus used for master election

Raft protocol used for leader election, membership changes and commitment of all transactions

Two part cluster: writeable Core and read-only read replicas.

Transaction committed once written durably on the master

Transaction committed once written durably on a majority of the core members

Practical deployments: 10s servers Practical deployments: 100s servers

Page 89: Introducing Neo4j 3.1: New Security and Clustering Architecture

3.1

Page 90: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 91: Introducing Neo4j 3.1: New Security and Clustering Architecture

Page 92: Introducing Neo4j 3.1: New Security and Clustering Architecture

# Choose LDAP connector as both authentication and authorization providerdbms.security.auth_provider=ldap

# Configure LDAP connector to point to the AD serverdbms.security.ldap.host=ldap://myactivedirectory.example.com

# In case where defined users are not allowed to search for themselves,# we can specify credentials for user with read access to all users and groupsdbms.security.ldap.authorization.use_system_account=truedbms.security.ldap.system_username=CN=admin,OU=people,DC=example,DC=comdbms.security.ldap.system_password=admin-password

# Provide details on user structure within LDAPdbms.security.ldap.user_dn_template=CN={0},OU=people,DC=example,DC=comdbms.security.ldap.authorization.user_search_base=OU=people,dc=example,dc=comdbms.security.ldap.authorization.user_search_filter=(&(objectClass=*)(CN={0}))dbms.security.ldap.authorization.group_membership_attributes=memberOf

./conf/neo4j.conf

Page 93: Introducing Neo4j 3.1: New Security and Clustering Architecture

dbms.security.ldap.authorization.group_to_role_mapping= \ "CN=Neo4j Read Only,OU=groups,DC=example,DC=com" = reader; \ "CN=Neo4j Read-Write,OU=groups,DC=example,DC=com" = publisher; \ "CN=Neo4j Schema Manager,OU=groups,DC=example,DC=com" = architect; \ "CN=Neo4j Administrator,OU=groups,DC=example,DC=com" = admin; \ "CN=Neo4j Procedures,OU=groups,DC=example,DC=com" = allowed_role

./conf/neo4j.conf

Page 94: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 95: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 96: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 97: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 98: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 99: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 100: Introducing Neo4j 3.1: New Security and Clustering Architecture

# Configure mapping between groups in the LDAP and roles in Neo4j dbms.security.ldap.authorization.group_to_role_mapping= \ “CN=Neo4j Accounting,OU=groups,DC=example,DC=com” = accounting; \ “CN=Neo4j Operator,OU=groups,DC=example,DC=com” = operator

CALL dbms.security.createRole(‘accounting’)CALL dbms.security.addRoleToUser(‘accounting’, ‘bobsmith’)

Page 101: Introducing Neo4j 3.1: New Security and Clustering Architecture

•••

••

Page 102: Introducing Neo4j 3.1: New Security and Clustering Architecture

3.1

Page 103: Introducing Neo4j 3.1: New Security and Clustering Architecture

http://www.opencypher.org/

Page 104: Introducing Neo4j 3.1: New Security and Clustering Architecture

http://www.opencypher.org/

Page 105: Introducing Neo4j 3.1: New Security and Clustering Architecture

•••

Page 107: Introducing Neo4j 3.1: New Security and Clustering Architecture
Page 109: Introducing Neo4j 3.1: New Security and Clustering Architecture

neo4j-admin restore --from=<backup-directory> --database=<database-name> [--force]

Restore a backed up database.

neo4j-admin dump

neo4j-admin load

neo4j-admin backup [--from=<address>] --to=<backup-path> [--check-consistency] [--additional-config=<config-file-path>] [--timeout=<timeout>]

Perform a backup, over the network, from a running Neo4j server into a local copy of the database store (the backup).

neo4j-admin check-consistency --database=<database> [--additional-config=<file>] [--verbose]

Check the consistency of a database.

neo4j-admin import --mode={database|csv} --database=<database-name>

Import a collection of CSV files with --mode=csv, or a database from a pre-3.0 installation with --mode=database.

Page 111: Introducing Neo4j 3.1: New Security and Clustering Architecture