What is a NoSQL document store?
A NoSQL document-oriented database is one that stores, manages and retrieves data using the notion of a document. A document is a collection of data items about an entity, organized into a single item.
For example, using the same example as we did to explain Key Value and Column stores, car insurance data could be held in a document store using this format:
{ "policyNumber": "AB 123 123", "policyAddress": "123 Road Street", "holderName": "Joe Smith", "vehicleID": "19UYA1234L000213", "vehicleModel": "Coupe", "vehicleYear": "2012" } { "policyNumber": "ZN 987987", "policyAddress": "42 Mill Crescent", "holderName": "Chris Bloggs", "vehicleID": "14PLU1234L120213", "vehicleModel": "Estate", "vehicleYear": "2007" } { "policyNumber": "JP 456456", "policyAddress": "12 Sample Street", "holderName": "Michael Richards", "vehicleID": "19UYA1234L000213", "vehicleModel": "Coupe", "vehicleYear": "2012" }
These items can be extracted in any format, such as XML, JSON or plain text, but would need to be parsed into KeyLines’ own JSON format for visualization. Document stores are popular as they offer excellent performance, but also schema flexibility. Database admins aren’t constrained by pre-determined document attributes – new attributes can be easily added later on. Examples of popular document datastores include MongoDB, Cassandra, CouchDB, and MarkLogic.
Converting a NoSQL document store into a graph
When visualizing document store data as a graph, we may first need to convert the flat data structure into a connected graph model of nodes and links. Each document in the NoSQL database can be mapped to a graph item, such as a link or node, with several properties.
For example, if investigating car insurance fraud, it could be advisable to look for vehicles with more than one insurance policy. In this case the Vehicle Identification Numbers and Policy Numbers would be mapped to nodes, with the remaining data entities included as properties:
Mapping to a graph structure with Blueprints
One tool to help with the conversion of a flat structure into a complex interconnected graph structure is the Blueprints API. Part of the Tinkerpop open source graph computing framework, the Blueprints API provides a set of interfaces between NoSQL and Graph databases.
NoSQL Visualization infrastructure
Many of our customers use KeyLines and ReGraph to visualize data in their key-value NoSQL datastores using the following basic architecture:
A user interaction in the graph visualization component raises an AJAX request for data from the database. This can happen via the Blueprints API or your own choice of API. Once the data is retrieved from the database, it is parsed into KeyLines’ or ReGraph’s own published JSON format and merged or loaded into the visualization chart.
Learn more
To learn more about graph visualization and how to visualize your complex connected data, download our ultimate guide to graph visualization
How to visualize your graph data
At Cambridge Intelligence, we help developers build graph visualization tools that are 100% customized to their users, their data and the questions they need to answer.