In a previous eclipse blog entitled Semantic Web and Unstructured Data, the underpinning storage mechanism is the graph database. Graph database is based on Leonhard Euler’s work on graph theory which focuses on vertices or nodes (“things”) and edges (relationship between things).
Traditional relational database management systems (RDBMS) emphasize storing data and entities in tables, rows and columns, with relationships defined by keys. However, when the database schema changes, often times this requires re-work to the database and re-programming on the related API’s. Graph database emphasis the relationships between entities. Therefore, a schema change to the database would be a simple addition of a node and/or new relationship without disrupting the existing database.
Take a medication like Tylenol, for example. In order to thoroughly catalog this medication, one would need to understand the relationship the drug has on patients (i.e. indications, side effects, allergies, usage, and patient age), relationship with manufacturer (i.e. ingredients, patents, companies, countries) relationship with other drugs (interactions), relationship with vendors etc. A graph database is the perfect tool for tracking such complex relationships, and the end result is that your data models become simpler but more expressive.
The following is another example. HUCA (Central Hospital of Asturias Spain) has created a graph data model to find which pharmaceutical specialties are available to prescribe and what is the cheapest for the hospital to purchase. The data model classifies each drug based on anatomical functional area (ATC code). From the ATC, catalog the relationship to active ingredients.
From the active ingredients, catalog the relationship to posology:
From the posology, catalog the code, name, and price:
The graph data model would ultimately look per below:
With these relationships tracked in the graph data model, users can run queries against the graph database to find answers to questions like:
- Find all different anatomic-functional areas
- What are the active ingredients of the mechanism of action ‘Antithrombotic’?
- Find every posology for each active ingredient
- What are the pharmaceutical specialties for the posology ‘Famotidine 10 mg’?
- What is the least expensive medicine for each mechanism of action?
- Find every medicine for the mechanism of action ‘Anti-ulcer’ but exclude those with active ingredient ‘Famotidine’.
Although graph database will not replace RDBMS, its usage should be considered especially when business needs require, or can benefit, from the tracking of complex relationships.