Graph Database A Gist - NEO4J-Part 2

Please refer to the initial post of graph DB for basics Graph Database A Gist - NEO4J

NEO4J uses property model graph. So to associate various nodes in graph DB uses relationships.Relationships connect nodes.
(Note: Relationships are directional in NEO4j , if directions aren't defined Neo4j throws error)

Relationships are typed as
  1. Uni-directional
  2. Bi-directional
Volkswagen brands Polo
Volkswagen brands Vento
Volkswagen brands Jetta
Relationships should direction and type. It is very similar to properties with name/value pairs. In the above example the car  "BRANDS" relates various type of cars that volkswagen produces. There can be many relationships that connect two nodes.

Volkswagen BRANDS Polo RATING  5
Volkswagen BRANDS Vento RATING 4
Skoda BRANDS Rapid RATING 5
The pointing direction shows the traversal path.In general the directions can be incoming or outgoing .  

Monitor application usage statistics with Javamelody.


Javamelody is open source package. It measures various real time statistical data and computes them with respect to operations of a web application, depending on the usage of the application by users. It monitors application server, JVM, data usage, memory management and analyzes various issues in the developed application. It helps in finding delayed responses and optimizing it. It generates various charts for error in http-requests, sql-requests, JVM memory and user sessions. It also monitors CPU execution time on a request with which the developer can manipulate the performance. The package also gives an additional option in generating a scheduled email of the various statistics to the application admin.

HTTP Sessions:

Javamelody computes various HTTP sessions that a server handles for the web application in the given time period. It calculates average number of request per-minute and generates a report for the number of sessions with the session created time. Javamelody also generates the detail about various attributes that a session handles and its properties. It also handles a list of various HTTP errors in the application.


Sample chart of HTTP request graph
Javamelody has lot more details with respect to HTTP sessions. Below a sample that shows various requests at various times.


 

Statistics sql:

Javamelody calculates various SQL sessions that a database server handles for the web application in the given time period. It calculates average number of request per-minute for each query. Normally it generates a report with the number of sessions and session created time. Javamelody also generates the detail about various queries’ that a session handles and its properties. It also handles a list of various SQL errors in the application.

Sample graph for the list of SQL errors

Sample SQL Statistics graph


Javamelody calculates various SQL errors that occur in a session and generates a graph for the same. This data helps us to tune the performance of the application

Statistics JSP

Javamelody generates a list of various JSP page displayed in a given session. It calculates cumulative percentage time taken to load that particular page and develops a report with the number of JSP page hits per minute. Javamelody also generates the detail about various attributes that a session handles and its properties. It also handles a list of various JSP errors in the loading a JSP page


Sample JSP pages list.


Sample graph for % of JSP page errors in a day

Sample graph for JSP page hits/minute
Similar way the Javamelody generates report for CPU time, memory usage, currently active threads and open JDBC connection.
Sample graph for JVM memory usage



CPU Time for each execution

Graph Database A Gist - NEO4J

 Graph Database - The Comprehensive Landscape  


Graph Database as the name states, it's a database that uses various graph structures for storing & representing data. Its a NoSQL database which users graph theory to store, map and query the relationships. Since we say its a NoSQL all values are stored in (KV) pairs. Graph DB will handle more complex data and relationships, which are backed in at the data record level.

          When we say graph, we know its not going to be about tables, rows and columns. The graph DB uses nodes which will have  properties, labels etc. A record that is well known in a traditional DB is represented as an node. Every node will have values which is called properties.

For example 
 Any real world entity can be represented as a node. 
Let's take an example of a CAR

CAR is a node which contains the following properties

Name : Skoda 
Type  : Sedan 

A property can be a String, boolean, array, etc. We cannot have NULL as a property value, instead we can remove the property.

The nodes can be grouped by Labels. A Label can only be represented by String. it can't take up a numeric or alpha-numeric value.The Labels should Start with Camel-case and it can't properties tagged to them.

For example 

we have a Label Cars which will have following nodes
Name : Skoda              Name: Chev
Type : Sedan              Type : SUV

All the nodes are tagged to single Label Cars. A node can be connected to any number of labels or can also be left alone :). Similar to RDBMS graph DB can also have billions of records stored & grouped by labels.

NFC potentates payments in Near Future

In the E-commerce world ,NFC in the pool alongside many other payment technologies , we explore a fresh, innovative standing point through a stark comparison of NFC Payments versus all other types of technologies, to measure and plan your future strategy. Originally mobile payments and other mobile services, like mobile banking, relied on text messaging to complete transactions.  NFC offers the best of both worlds. Smartphones let a customer store multiple credit cards and other payment methods all in one device that the customer is likely to carry everywhere with them already. It cuts out the unnecessary hassle of texting or swiping through menus to make payments and yet still offers the security of a credit card. By offering a high level of compatibility with different companies and technologies, NFC can evolve into a one-step payment method that works anywhere the customer wants to make a purchase.
 

Contributors

Social Connect


View Sadagopan K V's profile on LinkedIn