neo4j google test drive user guide · 2018-05-23 · 4 neo4j.com google test drive user guide...

25
The #1 Platform for Connected Data neo4j.com EVALUATION GUIDE Neo4j Google Test Drive User Guide David Allen, Solution Architect, Neo4j

Upload: others

Post on 12-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

The #1 Platform for Connected Data

neo4j.com

EVALUATION GUIDE

Neo4j Google Test Drive User GuideDavid Allen, Solution Architect, Neo4j

Page 2: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.comB

Google Test Drive User Guide

Table of Contents Introduction to Neo4j 1

About the Test Drive 2

Important Test Drive Tips 2

Logging In 3

Navigating through the Neo4j Browser 3

Lab 1: Orientation & Graph Concepts 4

Neo4j Is a Graph Database 5

The Property Graph Model 5

Nodes can be Labeled 5

Neo4j Is Schema Free 5

Connecting Nodes in the Graph 5

Relationship Properties 6

The Neo4j Browser 6

Lab 2: Intro to Cypher 7

Introduction 7

Graph Patterns 7

Nodes 7

Relationships 7

Aliases 7

Predicates 8

Aggregations 8

Dissecting a Cypher Statement 8

Lab 3: Recommendations Use Case Walkthrough 9

Introduction 9

Personalized Product Recommendations 9

The Open Movie Graph Data Model 10

Nodes 10

Relationships 10

Properties 10

Page 3: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.comC

Google Test Drive User Guide

Lab 4: Network and IT Operations 11

Introduction 11

Network Management – Introduction 12

Modeling 12

Network Exploration 13

Software: Operating Systems and Applications 13

Dependency Analysis 13

ConfigurationManagement 13

IT Monitoring and Governance 14

Lab 5: Neo4j Desktop 14

Introduction 14

Download Neo4j Desktop 14

Launch Neo4j Desktop 14

Log In 15

Set up a Project to Connect to our Google Test Drive Instance 17

Next Steps 18

Lab 6: Basic Administration 18

Introduction 19

Working with Users 19

System Information 20

Next Steps 21

Get Involved with the Neo4j Community 21

Explore Neo4j Integrations 21

Explore Neo4j Learning Resources 21

Appendices 21

Deployment Architecture 21

Core Servers 22

Read Replicas 22

Page 4: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com1

User Guide

The Leading Graph Database

Neo4j Google Test Drive User GuideDavid Allen

Introduction to Neo4jNeo4j is a high-performance graph database platform used today by hundreds of thousands of companies and organizations in almost all industries. Use cases include matchmaking, networkmanagement,softwareanalytics,scientificresearch,packagerouting,organizationaland project management, real-time recommendations, social networks, fraud detection, cybersecurity and more.

Neo4jimplementsthepropertygraphmodelefficientlydowntothestoragelevel.Asopposed to graph processing or in-memory libraries, Neo4j provides full database characteristics including ACID transaction compliance, cluster support and runtime failover, making it awesome for graph data in production scenarios.

Some particular features that make Neo4j popular among users, developers, and DBAs include:

• Materializing of relationships at creation time, resulting in no penalties for complex runtime queries

• Constant-time traversals for relationships in the graph both in depth and in breadth due toefficientrepresentationofnodesandrelationships

• All relationships in Neo4j are equally important and fast, making it possible to materialize and use new relationships later on to “shortcut” and speed up the domain data when new needs arise

• Compactstorageandmemorycachingforgraphs,resultinginefficientscale-upandbillions of nodes in one database on moderate hardware

• Written on top of the JVM

• A very easy to learn and use graph query language called Cypher

• Native application drivers for Java, JavaScript, Python and .NET

Neo4j is a high-performance graph database platform used today by hundreds of thousands of companies and organizations in almost all industries.

Page 5: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com2

Google Test Drive User Guide

About the Test DriveThis test drive will help you experience the capabilities of Neo4j. Neo4j ships with a feature-rich web application called the Neo4j Browser as well as other tools to provide users with a nice interface to work with applications deployed to the platform.

This test drive will step you through several labs that will orient you to the product, give you an idea of what kinds of use cases are in Neo4j’s sweet spot, and provide a tutorial on the property graph model as well as the Cypher query language.

Neo4j Browser provides for a way to step through a lot of the content in this document within the application itself.

Important Test Drive Tips

Neo4j ships with a feature-rich web application called the Neo4j Browser as well as other tools to provide users with a nice interface to work with applications deployed to the platform.

Page 6: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com3

Google Test Drive User Guide

Logging InUsing the URL you were provided as part of the test drive will lead to a login page, where you can use the username and password provided with the test drive to gain access, as in the screenshot below. Please note that you may receive a warning from your web browser on theSSLcertificateinuse;becauseyourtestdriveisnotassociatedwithahostname,theSSLcertificateisnotsignedandcausesthiswarning.

Navigating Through the Neo4j BrowserWhenyoufirstlogintotheNeo4jBrowser,youshouldseeascreenlikethis:

Using the URL you were provided as part of the test drive will lead to a login page, where you can use the username and password provided with the test drive to gain access.

Page 7: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com4

Google Test Drive User Guide

During the test drive, you will encounter on-screen Browser guides, such as the screenshot below.

Notice the grey arrows at left and at right of the guide pane. You can use these to navigate through the steps of an individual lab. If you need more space, you can also click the maximize button (which looks like two diagonal arrows in the upper right-hand portion of theBrowserguide)tomovetheguide’scontenttofillthescreen.Finally,youcanusethepinicon on the top right hand row to make sure that this pane does not get pushed down as you execute queries and do other work. You may want to pin each of the guides as you go along.

Lab 1: Orientation & Graph ConceptsWhat you’ll learn in this lab: the basics of the Neo4j property graph model, and how to get around the interface of the Neo4j Browser.

To begin this lab, we’ll be using Neo4j Browser. Please note the IP address of your test drive, and navigate your web browser to https://1.2.3.4:7473/ replacing “1.2.3.4” with the IP address of your test drive instance.

When you arrive, you will see an empty query window at the top. Enter :play concepts into the window and click the play button at far right to begin.

You will see the panel below appear in the Neo4j Browser. Most of the content in this test drive will be available in the form of Neo4j Browser guides, which are on-screen tutorials and content that will step you through each piece and allow you to interactively run code as you go. In this example above, the :play command simply displays some content for the tutorial, but this command window is a fully-functioning Cypher execution environment, where you can do anything with your graphs. But before diving into queries, this lab will cover the basics ofgraphsfirst.

For convenience, the rest of the content in this document for Lab 1 is a summary of what youwillfindinthatBrowserguide.WerecommendfollowingalongthestepsinyourBrowserwindow, where you’ll get even more. If you are following along in your Browser, you can skip the remainder of this section and go to the next lab.

In Lab 1, you’ll learn the basics of the Neo4j property graph model, and how to get around the interface of the Neo4j Browser.

Page 8: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com5

Google Test Drive User Guide

Neo4j Is a Graph Database

The Property Graph ModelThe simplest graph has just a single node with some named values called Properties. We might create a single node record with a property name: “Emil” and from: “Sweden”. Properties are just simple key/value pairs.

Nodes can be Labeled Nodes can be grouped together by applying a Label to each member. In a social graph, you might label each node as representing a Person. From our example above, we’d apply that Person label to the node we created for Emil. Any node can have zero or more properties. Nodes are not required to have labels though, and labels do not have any properties.

Neo4j is Schema Free Like any database, storing data in Neo4j can be as simple as adding more records. In the Browser example, more nodes can be added withdifferentproperties: 1. Emil has a klout score of 99 2. Johan, from Sweden, who is learning to surf 3. Ian, from England, who is an author 4. Rik, from Belgium, has a cat named Orval 5. Allison, from California, who surfs

Things to keep in mind: •Similarnodescanhavedifferentproperties • Properties can be strings, numbers or Booleans • Neo4j can store billions of nodes • If you need schema-like functionality, the database does support uniqueness and existence constraints as well as creating Node Keys and composite keys from combinations of properties.

Connecting Nodes in the Graph The real power of Neo4j is in representing and traversing connected data. To associate any two nodes, add a Relationship which de-scribes how the records are related. In our social graph, we simply say who KNOWS whom: 1. Emil KNOWS Johan and Ian 2. Johan KNOWS Ian and Rik 3. Rik and Ian KNOWS Allison

Things to keep in mind: • Relationships always have direction • Relationships always have a type • Relationships form patterns of data •Youcanhavemultipleinstancesofthesamerelationship(thisisadifferentiatorfromRDF) • A node can attach a relationship to itself

Page 9: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com6

Google Test Drive User Guide

Relationship Properties Inapropertygraph,relationshipsaredatarecordsthatcanalsocontainproperties(thisisalsoadifferentiatorfromRDF).Lookingmore closely at Emil’s relationships, note that: • Emil has known Johan since 2001 • Emil rates Ian as 5 (out of 5) • Everyone else can have similar relationship properties

The Neo4j Browser

The Neo4j Browser is a command-driven client, like a web-based shell environment. It is perfect for running ad hoc graph queries, withjustenoughpowertoprototypeaNeo4j-basedapplication.TheNeo4jBrowserincludesthefollowingbenefits:

Developer focused, for writing and running graph queries with Cypher Exportable tabular results of any query result Graph visualization of query results containing nodes and relationships Convenient exploration of Neo4j’s REST API

After you have completed the lab, make sure to note that documentation is available live in the Browser whenever it is needed via the notebook tab on the left side of the screen.

Page 10: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com7

Google Test Drive User Guide

Lab 2: Intro to Cypher

Introduction Cypher is a declarative, SQL-inspired language for visually describing patterns in graphs using an ASCII-art syntax. Cypher allows you to state what you want to select, insert, update or delete from your graph data without requiring you to describe exactly how to do it. It is designed to be easy to read, as well as learn.

What you’ll learn in this lab: the basics of the Cypher graph query language, what it can do, and how to read basic queries that navigate the graph, process data and return results.

Graph Patterns Cypher is the query language for graphs and is centered around graph patterns. Graph pat-terns are expressed in Cypher using ASCII-art like syntax.

Nodes

Nodes are defined within parentheses (). Optionally, we can specify node label(s): (:Movie)

Relationships

Relationships are defined within square brackets []. Optionally we can specify type and direction:

(:Movie)<-[:RATED]-(:User)

Aliases

Graph elements can be bound to aliases that can be referred to later in the query:

(m:Movie)<-[r:RATED]-(u:User)

In Lab 2, the basics of the Cypher graph query language, what it can do, and how to read basic queries that navigate the graph, process data and return results.

Page 11: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com8

Google Test Drive User Guide

Predicates

Filters can be applied to these graph patterns to limit the matching paths. Boolean logic operators, regular expressions and string comparison operators can also be used here.

Aggregations

There is an implicit group when using aggregation functions such as COUNT. Be sure to use the Cypher Refcard as a reference for learning Cypher syntax.

Dissecting a Cypher Statement

Let’s look at a Cypher query that answers the question “How many reviews does each Matrix movie have?”. Don’t worry if this seems complex, we’ll build up our understanding of Cypher as we move along.

How many reviews does each Matrix movie have? Click on the block to put the query in the top-most window on the query editor. Hit the triangular button or press Ctrl+Enter to run it and see the resulting visualization.

Page 12: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com9

Google Test Drive User Guide

Lab 3: Recommendations Use Case Walkthrough

Throughouttheguideyou’llfindCypherstatementsthatyoucanexecutebyclickingonthemand then executing them by hitting the run button.

Introduction Real-time recommendation engines are key to the success of any online business. To make relevant recommendations in real time requires the ability to correlate product, customer, inventory, supplier, logistics and even social sentiment data. Moreover, a real-time recom-mendation engine requires the ability to instantly capture any new interests shown in the customer’s’ current visit – something that batch processing can’t accomplish. Matching histor-ical and session data is trivial for a graph database like Neo4j.

The key technology in enabling real-time recommendations is the graph database, a technology that is fast leaving traditional relational databases behind. Graph databases easily outperform relational and other NoSQL data stores for connecting masses of buyer and product data (and connected data in general) to gain insight into customer needs and product trends.

What you’ll learn in this lab: how Neo4j can be used to implement recommendation systemsthroughavarietyoftechniquesincludingcollaborativefiltering.

Personalized Product Recommendations Personalized product recommendations can increase conversions, improve sales rates and provide a better experience for users. In this Neo4j Browser guide, we’ll take a look at how you can generate graph-based, real-time personalized product recommendations using a datasetofmoviesandmovieratings,butthesetechniquescanbeappliedtomanydifferenttypes of products or content.

In Lab 3, how Neo4j can be used to implement recommendation systems through a variety of techniques including collaborative filtering.

Page 13: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com10

Google Test Drive User Guide

Generating personalized recommendations is one of the most common use cases for a graphdatabase.Someofthemainbenefitsofusinggraphstogeneraterecommendationsinclude:

1. Performance. Index-free adjacency allows for calculating recommendations in real time, ensuringtherecommendationisalwaysrelevantandreflectingup-to-dateinformation.

2. Data model. The labeled property graph model allows for easily combining datasets from multiple sources, allowing enterprises to unlock value from previously separated data silos.

There are two basic approaches to recommendation algorithms.

1. Content-Based Filtering: recommending items that are similar to those that a user is viewing, rated highly or purchased previously.

2. Collaborative Filtering: Use the preferences, ratings and actions of other users in the networktofinditemstorecommend.

Make sure to use the in-browser guide to examine samples of each kind of query, and try them out to see the results.

The Open Movie Graph Data Model

Nodes

Movie, Actor, Director, User and Genre are the labels used in this example.

Relationships

ACTED_IN, IN_GENRE, DIRECTED and RATED are the relationships used in this example.

Properties

title, name, year and rating are some of the properties used in this example.

Generating personalized recommendations is one of the most common use cases for a graph database.

Page 14: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com11

Google Test Drive User Guide

Lab 4: Network and IT Operations

Throughouttheguideyou’llfindCypherstatementsthatyoucanexecutebyclickingonthemandthenexecutingthembyhittingtherun button.

Introduction ThesizeandcomplexityofnetworksandITinfrastructurerequireaconfigurationmanagementdatabase(CMDB)morepowerfulthananythingrelationaldatabaseshavetooffer.UsingNeo4j,youcancorrelateyournetwork,datacenterandITassetstohelpwithtrou-bleshooting, impact analysis and capacity or outage planning.

A graph database enables you to connect your many monitoring tools and gain critical insights into the complex relationships betweendifferentnetworkordatacenteroperations.Fromdependencymanagementtoautomatedmicroservicemonitoring,theuses for graphs in network and IT operations is endless.

What you’ll learn in this lab: how to use Neo4j to interrelate information about a network or hardware topology, so that you can make it easy to isolate faults and understand your network structure.

Page 15: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com12

Google Test Drive User Guide

Network Management - Introduction Computer networks span all levels of the stack from physical connections up to mobile and web-applicationsconnectingnetworksofusers.Graphdatabasesofferanaturalwayofmodeling, storing and querying all these types of computer networks. A graph database like Neo4j can be utilized for: •Configurationmanagement • Impact analysis • Planning • Security and hardening of networks • Intrusion detection •Trafficanalytics • Analytics of user behavior

In this example, we want to look at network management and impact analysis from the level of routing (TCP/IP) upwards to managing applications and tracing their dependencies. Modeling

Wecanmodelthenetworkendpoints(boxeslikeservers,routers,firewalls,racks)ofthedatacenter as nodes and the “cables” between them as relationships.

Another type of node represent networks and interfaces.

On the application level, we have the operating system, virtual machines, applications and services that are modeled as entities.

Imagine we have a Data Center connected to an interconnect via an Egress Router. The data center uses a 10.x.x.x/8 IP address range.

The data center consists of several zones which are connected to the main backbone each via a Router(10.zone.*/16).

From there, each zone is broken down into rows of Racks.

Each RackcontainsdifferenttypesofServers and has its own Switch to connect to the data center routers backplane.

Graph databases offeranaturalwayof modeling, storing and querying all these types of computer networks.

\

Page 16: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com13

Google Test Drive User Guide

Each Server has external network Interfaces that connect to the rack switch, the local networks being 10.zone.rack.*/24.

Each machine either runs a real operating system (OS) or a virtualization manager that runs a number of virtual machines.

For operational simplicity we only run one Application per OS which uses a number of Ports on the external interface.

Usuallywewouldgetthiskindofinformationfromaconfigurationmanagementdatabase(CMDB),networkmanagementtoolsoragents installed on the machines.

Network Exploration

The data center consists of 4 zones, each of which has its own separate Network 10.zone.*/16, and its own Router.

We can draw out that verbal description in a query with patterns matching the network parts.

To visualize the data center and its components so far, we can also start at the center and then go three hops out.

Use the in-browser guide to try these queries out and visualize the network!

Software: Operating Systems and Applications

Bare-metal hardware is cool, but something has to run on it to make it useable.

Most likely it will be some kind of virtualization infrastructure that allows dynamic reallocation of the compute, memory and disk resources.

Forthistest-drive,wedifferentiatebetweenOperating Systems, Services and Applications (which could also be microservices).

Each of them has a name, version(s) and dependencies.

In a more elaborate model, we could also handle other resource requirements like RAM / CPU / DISK per running software instance.

Follow the in-browser prompts to explore software, operating systems and machines.

Dependency Analysis

We can also look at dependencies between data center elements on the physical level, like routers, switches and interfaces.

Another way to look at it is to determine dependencies between machines based on their internal and external connections.

But we can also use the software and its dependencies to determine bottlenecks and frequently depended-upon components.

Use the in-browser guide to see all the software that uses Neo4j and the running Neo4j instances.

Configuration Management

ProperITinfrastructuresusealargenumberofconfigurationparameterstocustomizecommodityhardwareandsoftware.Tomanageallofthevariables,ConfigurationManagementDatabases(CMDBs)areused.SystemsrequirecertainvariablesandcanreportwhatiscurrentlyconfiguredsothattheCMDBcandetectissuesandsendnecessaryupdates.

Inthepast,CMDBsweremostlyusedfornetwork,hardwareandOS-levelconfiguration.Today,theirusehasexpandedintoservicesto support modern architectures. A number of related systems have popped up, such as ZooKeeper, Konsul, Eureka, and others.

Duetothevarietyofsystemsusedforprovidingconfigurationtotheinfrastructure,itisveryusefultocreateaunified,up-to-dateviewof the situation in your systems graph. Use the in-browser guide to see how Neo4j can help automate the management of these processes.

Page 17: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com14

Google Test Drive User Guide

IT Monitoring and Governance Live network operations need to be supervised to ensure smooth operations, prevent bottlenecks, protect from attacks and vulnerabilities and allow maintenance planning and failure handling.

Theinformationiseitheracquiredbylisteningonnetworktrafficandinferringrunningservices and user and application activity combined with port-scans.

Alternatively, agents installed on the machines report the state of each server to the network or centralized databases which update the live state of the network.

Based on our existing model, those incoming messages and events can do the following:

Create new entries for servers, switches and interfaces Trackrunningservicesviausedportsandtraffic Infer user and application activity and group them by network segment, source or used service Detect abnormal operations like attacks or potential bottlenecks and issue warnings Trackviolationsofrules,likeisolationoftheDMZ,certainfirewallrules,etc.

Use the in-browser guide to see examples of new information coming in and how to respond.

Lab 5: Neo4j Desktop

Introduction Neo4j Desktop is the new mission control center for developers. It’s free with registration, and it includes a development license for Enterprise Edition as well as an installer for the APOC library. It will also connect to your production servers, and eventually also install other components like the graph algorithms or Java upgrades.

What you’ll learn: how to use Neo4j Desktop tooling to create as many database instances as you like locally, and how to connect the desktop tooling to a remote cloud database.

Download Neo4j Desktop Thefirstthingyou’llneedtodoisheadovertotheNeo4jDownloadspageanddownloadacopy of Neo4j Desktop, which is included by default. Installation instructions will be provided by that page, and distributions are available for various operating systems such as OSX and Windows.

Launch Neo4j Desktop Thefirstthingyouneedtodoafterlaunchistoacceptthelicenseagreement.Click“IAgree.”

Lab 5 will cover how to use Neo4j Desktop tooling to create as many database instances as you like locally, and how to connect the desktop tooling to a remote cloud database.

Page 18: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com15

Google Test Drive User Guide

Log In Next, follow the prompts to log into Neo4j Desktop. You are welcome to sign up for a new account with any email address, but you may also use existing credentials from popular sites such as Google, GitHub, LinkedIn or Twitter. Having an account with Neo4j Desktop enables it to save queries and preferences that you use.

Neo4j Desktop is the new mission control center for developers. It’s free with registration, and it includes a development license for Enterprise Edition as well as an installer for the APOC library.

Page 19: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com16

Google Test Drive User Guide

After logging in, you will see a screen indicating that Neo4j Desktop is downloading the latest components necessary to launch databases locally, as well as supporting applications.

When the download process is complete, you will arrive at the main screen.

Neo4j Desktop divides all of your local content into a set of projects. You can create, edit and delete projects as necessary. Inside of each project, you can have any number of Neo4j database instances, either remote or local.

In the next step, we will set up a project that lets us use Neo4j Desktop tooling with our remote Google Test Drive instance.

Page 20: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com17

Google Test Drive User Guide

Set Up a Project to Connect to our Google Test Drive Instance

Click on the “My Project” label at the top, and let’s title this project “Google Test Drive.”

Next, click on the “New Database” panel just below the name and choose “Remote Database.”

Examinetheconfigurationsettingsabove.Makesuretouseport7687(thisistheportNeo4juses for the Bolt protocol that sends queries and data back and forth). The IP address should be the IP address or hostname provided to you when you launched your Google Test Drive. You may choose to encrypt the connection or not at your option.

Neo4j Desktop divides all of your local content into a set of projects. You can create, edit and delete projects as necessary.

Page 21: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com18

Google Test Drive User Guide

After clicking “Create” you should see a window like this image above. Click the “Activate” button to open that connection and enable Neo4j Desktop to work with it.

Next Steps Congratulations! You have now set up a remote Neo4j database instance connected to Neo4j Desktop. From here, you can launch Neo4j Browser from within Neo4j Desktop. You can also create any number of additional local databases for testing purposes after your test drive has ended.

From here, to learn more about Neo4j Desktop please consult the Neo4j Desktop FAQ on GitHub.

Lab 6: Basic Administration

Congratulations! You have now set up a remote Neo4j database instance connected to Neo4j Desktop. From here, you can launch Neo4j Browser from within Neo4j Desktop.

Page 22: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com19

Google Test Drive User Guide

Introduction WhendeployingNeo4jaspartofacomplexapplication,aconfigurationandmanagementsurfaceisneededtoallowforitsmaintenance. Much of this functionality is exposed via Cypher procedures, so you can run much of the code in this section either in the Neo4j Browser, or via a command-line Cypher application, such as cypher-shell that ships with Neo4j Desktop.

An important note on Cypher: In these examples, you’ll see use of the CALL keyword. That’s the signal that what comes next is a stored Cypher procedure. At any time if you would like to see a complete index of all procedures available, you can run CALL dbms.procedures() to inspect the list.

Other commands you may run in to the Neo4j Browser start with a colon, such as :sysinfo. These are Browser commands rather than actual Cypher code. Where possible, we’ll indicate the Cypher version, because these can be used in many environments outside of the Neo4j Browser.

What you’ll learn: In this lab, we’ll cover the basics of permissions, health checking for your Neo4j instance and more.

Working with Users To examine current valid users and roles in Neo4j, run call dbms.security.listUsers()

Users can be created by providing a username and password to CALL dbms.security.createUser(username, password). As indicated in the screenshot below, the Neo4j Browser will provide contextual hints about what arguments are required as you go.

Note that to create a user, there is another possibility: the Neo4j Browser command :server user add. Feel free to try it if you like – itallowsyoutofilloutaformratherthanspecifyeverythingupfront.Butingeneral,asyoumovetootherenvironments,theCypherequivalent will be most convenient outside of the Neo4j Browser.

Page 23: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com20

Google Test Drive User Guide

Similar to these, there are several other functions you can use to administer account lifecycles:

CALL dbms.security.deleteUser(username)

CALL dbms.security.suspendUser(username)

CALL dbms.security.activateUser(username)

CALL dbms.security.listUsersForRole(roleName)

System Information Next, run the :sysinfo command to display information about the current database. This will help you keep track of the size of your store on disk, and memory settings such as your page cache as well as transaction throughput information for the system.

You may choose to encrypt the connection or not at your option.

Page 24: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

neo4j.com21

Google Test Drive User Guide

Next StepsGet Involved with the Neo4j Community

• For additional training try the Neo4j GraphAcademy

• Connect with our Developer Relations team or your local Neo4j community

• Request a meeting with your local sales organization

• Further reading about Neo4j concepts, customers and deployments

• Neo4j Documentation

Explore Neo4j Integrations

Neo4j is supported by a rich ecosystem of libraries, tools, drivers and guides provided by partners, users and community contributors.

The Neo4j community ecosystem can be found here;inadditiontocommunitycontributions,you may want to explore:

• Neo4j and Apache Spark

• Neo4j and ElasticSearch

• Neo4j and MongoDB

• Neo4j and Cassandra

• Neo4j and Docker

Explore Neo4j Learning Resources

Neo4j provides a wide variety of learning resources, from public Slack communities, to frequent in-person meetups, a library of graph related books, and of course technical documentation on all aspects of the graph platform.

AppendicesDeployment Architecture

Neo4jcanbedeployedinaclusteredconfiguration,orasasingleinstance.Forthepurposesof keeping the test drive simple, your test drive instance is a single VM running Neo4j Enterprise Edition. For larger installations, the deployment architecture is shown below.

What to do next? Get involved in the Neo4j community, explore Neo4j integrations, and explore other Neo4j learning resources.

Page 25: Neo4j Google Test Drive User Guide · 2018-05-23 · 4 neo4j.com Google Test Drive User Guide During the test drive, you will encounter on-screen Browser guides, such as the screenshot

Neo4j, Inc. is the graph company behind the leading platform for connected data. The Neo4j graph platform helps organizations make sense of their data by revealing how people, processes and digital systems are interrelated. This connections-first approach powers intelligent applications tackling challenges such as artificial intelligence, fraud detection, real-time recommendations and master data.

More than 250 commercial customers, including global enterprises like Walmart, Comcast, Cisco, eBay and UBS use Neo4j to create a competitive advantage from connections in their data.

© 2018 Neo4j. All rights reserved. Cover image: Amy Skyer on Unsplash.

Contact us:[email protected]

neo4j.com

Google Test Drive User Guide

Questions about Neo4j?

Core Servers

Core Servers’ main responsibility is to safeguard data. The Core Servers do so by replicating all transactions using the Raft protocol. Raft ensures that the data is safely durable before confirmingtransactioncommittotheend-userapplication.Inpractice,thismeansoncea majority of Core Servers in a cluster (N/2+1) have accepted the transaction, it is safe to acknowledge the commit to the end user application.

NotethatshouldtheCoreServerclustersufferenoughfailuresthatitcannolongerprocesswrites, it will become read-only to preserve data integrity.

Read Replicas

Read Replicas’ main responsibility is to scale out graph workloads (Cypher queries, procedures, and so on). Read Replicas act like caches for the data that the Core Servers safeguard,buttheyarenotsimplekey-valuecaches.Infact,ReadReplicasarefully-fledgedNeo4jdatabasescapableoffulfillingarbitrary(read-only)graphqueriesandprocedures.

A brief overview of deployment architecture, core servers, and read replicas is helpful to understanding this user guide.