Creating an application often leads to the following data workflow:
Serialized data → memory data → view data → memory data →serialized data
The application deserializes data then optionally process it into memory then display it in a view.
A user can modify a data through a view, which is optionally processed in memory and then stored into a file or a database.
Because the serialized object, the memory objects, and view objects are different entities, the code will have some code like this:
myMemoryObject.memoryPropertyName = mySerializedObject.serializedPropertyName;
myViewObject.viewPropertyName = myMemoryObject.memoryPropertyName;
…
Which means that the synchronization between the different entities are based on a static key value system.
Unfortunately, during the development the system will change a lot for different reasons among:
When a change occurs, the developer must update the bindings in the code using some find and replace operations and recompile the application.
There are many developer’s tools that efficiently handle these tasks, but the base Graph seems to offer great possibilities to deal with binding.
The current experimentation is trying to leverage on Graph database to have a dynamic binding system.
The system will also put the primitive values at the center of relationships showing how to automatically build subset of interesting queries.
The document will explore the creation of a simple Angular web app, displaying data from a Neo4j Graph database.
The final code can be found at : https://github.com/mathiastiberghien/graph_based_coding.git
To make it work, without any changes, you’ll need to install Neo4j Desktop create a database with ‘admin’ as password. The database mus have the setting ‘cypher.lenient_create_relationship’ at true in the neo4j.conf file of the database.
This document is targeting Graph database users or application developers. The sample provided in the documents are very simple and are more focused on the concept that the technology. We will describe the relevant piece of code so that developers can follow the development logic, step by step but this document is not really a tutorial.
Note: I’m very new to Graph database, and I tried through these experiments to understand the reasons of starting to use Graph database in production applications.
Before to begin, we need to define the way we will store data into the database. We decided to consider an abstract model representing data from a developer perspective.
Here’s the schema of our graph database:
Dynamic model schema
It contains 5 labels:
And 8 relationships:
This describe the following:
#cypher #development #neo4j #dynamic-programming #graph-database #database