Non-Relational Database Example
A non-relational or NoSQL database is any kind of data store that doesn’t use the traditional tables, column, and rows (sometimes called records) functionality of a traditional relational/SQL database. This means that there are many types of non-relational databases. In this section, we'll discuss examples for graph databases, hierarchical databases, distributed databases, and document databases.
To learn more, we have an article about NoSQL database examples.
Graph Database Example
A graph database uses nodes to hold data, and edges define relationships between them.
Movie Database
One example of data you can store in a graph database is information about movies and the people who make them. The nodes hold information about things such as a person or film. The edges define the relationships between them, such as a person acting in, directing, or producing a film.
This is helpful when building up queries for film suggestions. If a viewer has watched a film starring an actor, they can be shown recommendations of other films that actor has starred in or films directed by someone.
Hierarchical Database Example
Hierarchical databases represent data in a tree-like form. Each ‘parent’ node can have many ‘children.’ The node without a parent is considered the root node.
Organizational Chart
An organizational chart is a great example of data that can be modeled easily in a hierarchical database. The root node would be the Chief Executive Officer (CEO) who would have perhaps an ‘EmployeeID’ of 1 and a ‘Level’ value of 0 as they are the root.
The CEO could then have many direct reports, such as Chief Technical Officer (CTO), Chief Finance Officer (CFO), and Chief Operating Officer (COO). They too would have many direct reports. This tree structure would continue until you reached a level of employee with no direct reports.
Distributed Database Example
A distributed database is one where the data is related logically but stored in multiple databases across different geographical sites.
Domain Name Service
The Domain Name System (DNS) uses a distributed database. Internet users everywhere use web addresses, or URLs as they are also known, to access websites and other internet services. However, underneath the hood, these names actually map to unique IP addresses.
Name servers are used to store these mappings and there are multiple across the globe. Different name servers are owned by different companies. However, they are all accessed the same way when searching the internet. A user types the address they want to access and the rest is taken care of. The information is distributed but it is all accessed through one large database management system.
Document Database Example
A document database stores information, most commonly in JSON-like structures, as documents. It allows for related data to be stored in one place, rather than distributed across tables.
Like relational databases, document databases are able to handle general-purpose use cases which makes them suitable for many types of applications and data.
Healthcare Database Example
A document database is a great database for a healthcare organization and information such as offices, doctors, and patients.
Each patient, for example, has a single document which contains all their information such as name, address, date of birth, doctor, local healthcare office, list of previous or current illnesses, and any medications they are on.
The document model allows related data to be embedded together. By storing information together that is accessed together, data can be retrieved incredibly quickly without any expensive joins — and it is easier to shape the data in a way that suits the application.