Thinking Globally in Business.

I was recently lucky enough to spend some time in Bogota, Colombia for my third One Young World conference. As it always is — this was a deeply humbling and inspiring (as well as exhausting!)…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Introducing the Neo4j Database Analyzer

A tool to get a quick understanding of the data structures in your Neo4j Database.

Over the years working with Neo4j, I was creating small tools to help me to understand what kind of data a Neo4j database contains. I wanted to know what the label and relationships counts were in the database and which properties are there to give a good estimate, how a database will grow over time.

With the availability of Neo4j Desktop, I created a Neo4j Desktop App based on the small tools I used before called Analyze Database. While doing this I added two more tools. Live Count which counts all the Nodes per Label and Relationships per Relationship Type every n seconds and plot this in a timeline chart and Model which gives you the ability to explore the database schema. This is especially useful when the normal “call db.schema()” gives you a hairball structure in the Neo4j Browser. I created this Neo4j Desktop App with the valuable help from Michael Hunger.

Install the Neo4j Database Analyzer as follows in the Neo4j Desktop
(1.1.10 or later) is easy:

Select a Project and press ‘+ Add Application’ in the applications list
Choose here the “Neo4j Db Analyzer” to add it to your Project

In the following sections a more in depth explanation is given for each tool.

When you press “Analyze Database” the database structures will be counted. While the tool is analyzing the database you will see in the “Summary” tab a listing of all the steps the tool is doing to analyze the database. When finished this listing is moved to the “Log” tab and the results of the counts are displayed in the “Summary” tab.

With the default settings this tool will execute counts while using the count store (database statistics), which means that the queries are not expensive for the database. The following counts are executed while using the count store:

It is best to start with the default settings.

When you want to analyze Node or Relationship properties or Label Combinations the count store cannot be used which means that the query load on the database will be more involved. Therefore you have to specify in the Label Filter and Relationship Type Filter which Labels and Relationship Types you want to analyze.

Be careful with very big databases to analyze properties or label combinations, don’t do it on a database powering production workloads, rather on a backup or a read-replica/follower.

The following information is gathered when you analyze Properties and Label Combinations:

When the amount of nodes, or the amount of relationships is above a configurable threshold, sampling is used to limit the load on the server. Press the “Sampling” button to edit the threshold values.

Note that when sampling is used, the found properties and label combinations are an estimate.

The default count, without property analysis and checking on Label combinations, took 2 seconds. The analysis with all Label/RelationshipType Properties and Label Combinations took ~15 minutes.

In this tab you can see all the details of a Label by clicking on the ‘Label’ row. That row also contains the count of the Nodes with this specific label.

In this tab a tile is shown per label combination with the count of it.

In this tab a bar is shown for every Relationship Type with the Relationship count. Only when Relationship properties are analyzed then the detail section will be shown when you click on the bar. In the details we see the property list and the possible property combinations.

For convenience the Indexes and Constraints of the database are listed here. The Log tab contains the logging of the analysis which is shown in the Summary tab during analyzing.

In this tool every 10 seconds (default) the nodes per selected label and relationships per selected relationship type are counted. Note that these queries are using the database statistics so these queries are very ‘light’ for the database. By default the first Label of the label list and the first Relationship Type of the Relationship Type list is selected. While counting you can add or remove labels or relationship types from the ‘count’. You will see these changes in the ‘next’ count. This tool counts structures in the database ‘Live’ however if you want to monitor the database you can use the Neo4j Desktop App Halin.

This tab makes it possible to ‘walk’ over your database model even when there are a lot of Labels and Relationship Types. The visualization only contains data, when the Database has been analyzed.

The database model starts with an empty canvas and you can start the exploration of the Model via selecting a Label via the “Labels Filter” or by pressing “Show All”. When the model complexity is too high, you will get a warning that showing the complete model will probably fail when clicking on “Show All”. In that case you can better use the “Labels Filter” to start your model exploration. The complexity of the model is calculated ad follows:

For smaller schema’s this option will the fastest way to get a quick overview of the database model.

When a Node is selected it becomes blue, and the properties of the Node will be shown on the Right. This will contain the Node Count of the Label and the Incoming and Outgoing Relationship Types with their Relationship counts. When the properties of this Label are analyzed you will see here also a property list with property types.

With the context menu on a selected “Label” Node you can add the incoming and outgoing relationship types to the visualisation including the connected “Label” Nodes. It is also possible to remove a Relationship Type or a “Label” Node from the canvas.

Note that when you ‘Clear’ a Label or Relationship Type the Connected Nodes will remain on the canvas.

Add a comment

Related posts:

7 Simple Things You Can Do Today To Increase Your Motivation Levels

We get up in the morning and feel uninspired. Our days seem repetitive, and we lack clear-cut objectives. That’s where positive, motivation-boosting activities come into play. No matter your talent…

Advanced solution regarding Internal standards for biomarker discovery and reproducibility

The advanced metabolic profiling tools have been helping in eliminating all the relevant hassles in an incomparable way. Therefore, when it comes to simplifying the research process in the realm of…

What ought our world be like?

What ought our world be like? I would say everyone knows how the world really is, but I just finished Educated by Tara Westover, so maybe it is safer to say that most people know how the world…