image
Database types

Database architecture consists of the below five main types: 

  • Relational 
  • Hierarchical 
  • Network 
  • Object Oriented
  • NoSQL

We will now examine each one in more detail. 

In a relational database, data that are related to one another are stored, organised, and presented as a collection of tables. All data is directly accessible, and the ordering of rows is not significant. 

 Table featuring 4 columns by six rows. Third row down contains the words: ’instance of entity’ - the whole row is shaded in yellow. Third row along feature s the word attribute and whole column is shaded in pink.

Image: Relational database

A primary key uniquely identifies each row of the table. It can be simple (consisting of one column) or compound/composite (consisting of two or more columns).​ 

A foreign key is a primary key of another table. Foreign keys provide the links between tables and must always match a valid primary key (referential integrity). 

 Two x tables. First table: four columns x four rows of data.  Patient ID column is shaded in yellow and the Doctor ID column is shaded in blue:   First row: PatientID = 1, PatientName = John Smith, PatientAge = 43, DoctorID = 101   Second row: PatientID = 2, PatientName = Peter Brown, PatientAge = 36, DoctorID = 101   Third row: PatientID = 3, PatientName = Emily Davidson, PatientAge = 54, DoctorID = 101   Fourth row: PatientID = 4, PatientName = Samantha Newton, PatientAge = 26, DoctorID = 102   Fifth row: PatientID = 5, PatientName = George Elson, PatientAge = 43, DoctorID = 102   This table is linked to a second table: three columns x 2 rows of data.  DoctorID column is shaded in Yellow:   First row: Doctor id = 101, DoctorName = Dr Holmes, DoctorOffice = 11   Second row: Doctor id = 102, DoctorName = Dr Watson, DoctorOffice = 12   A key is shown: Yellow = Primary key and Blue = Foreign key.

Image: Primary and Foreign key

A hierarchical database consists of data stored in the form of parent and child records, where each child record has exactly one parent record. There is a predefined path to data and 1 to Many, but not Many to Many relationships. 

 Site map diagram: ‘Root’ is linked down to 2 pathways P1 and P2. P1 pathway is linked down to PIC1 and PIC2. P2 pathway is linked down to P2C1 and P2C2.

Image: Hierarchical database

In a network database, we have got a specialist modification of a hierarchical structure. It handles Many to Many relationships of parent and child records in a net-like form and there is a predefined path to data. 

 Circle diagram: N1 is at the top of the circle, going to the right of the circle, a double ended arrow points to N3, a double eneded arrow points to N4, at the bottom of the circle. A double pointed arrow points up to N2 and then a final double pointed arrow points to N1, compelteing the circle.

Image: Network database

An object-oriented database uses the approach and the languages of Object-Oriented Programming (OOP). ​OOP focuses on the objects to manipulate rather than the logic to manipulate them.​ 

The main components of OOP are:​ 

  • Classes - user-defined data types that act as the blueprint for individual objects, attributes and methods.​ 
  • Objects - instances of a class. ​ 
  • Methods - functions defined for a specific class that describe the behaviours of an object. ​ 
  • Attributes - defined in the class template, represent the state of an object. ​ 

OOP’s main principles are​: 

  • Encapsulation – everything is related to a class​. 
  • Inheritance – classes can inherit other classes​.
  • Polymorphism - objects are designed to share behaviours and they can take on more than one form.​ 

Object-oriented databases work with complex data objects that are stored with all of their properties and can be retrieved when we terminate and then re-start a programme. Data and functionality are treated ‘as one’. 

 Site map diagram: Vehicle (Attirbutes, methods) links down to three areas: Truck (attributes, Methods), Bus (attributes, Methods), Car (attributes, Methods).

Image: Object-oriented database

Finally, a NoSQL database supports complex data sets and provides flexible schemas. It can handle data variety and large amounts of data as well as replicate data stores to avoid single point of failure. 

 Site map diagram: NOSQL links down to four different areas: Key-value DB, that links down to Amazon Dynamo DB. Graph DB links down to Neo4j DB, Document DB that links down to MongoDB and Column DB that linsk down to Cassandra DB.

Image: NoSQL database

NoSQL databases have got four main categories: 

  • Key value  
  • Wide Column
  • Document based
  • Graph  

Select here for more information on each one. 

How can you decide which type of NoSQL database is best for your data set?  

The below comparison table showcases some of the most popular NoSQL databases. 

 Site map diagram: ‘Root’ is linked down to 2 pathways P1 and P2. P1 pathway is linked down to PIC1 and PIC2. P2 pathway is linked down to P2C1 and P2C2.   Table of content: Sevon columns across and seven rows down.   Database = Couchbase, Type = Document-based, key value, Vendor or open source = Open source, Acid compliance = yes, Primary query language = N1QL, Top use cases = Customer service, financial services inventory and IoT, Security = includes security for authentication, encryption, auditing and authorisation.   Database = Cassandra, Type = Wide column, Vendor or open source = Open source, Acid compliance = no, Primary query language = CQL, Top use cases = Social analytics, retail and messaging, Security = Built-in security for authorisation, encryption and authentication, but security is disabled by default for ease of use within clusters.   Database = Neo4j, Type = Graph, Vendor or open source = Open source single-node version; commercial license for clustering, Acid compliance = yes, Primary query language = Cypher, Top use cases = Built-in security for authorisation, roles and encryption, Security = Buil-in security for authorisation, roles and encryption.   Database = Google Cloud Bigtable, Type = Wide column, Vendor or open source =Vendor, Acid compliance = no, Primary query language = Allows for use of many languages, Top use cases = IoT data management, financial services, retail data and time series data, Security = Secured by vendor.   Database = Redis, Type = Key value, Vendor or open source = Open source, Acid compliance = yes, Primary query language = Allows for use of many languages, Top use cases = Caching, queuing, filtering and stats, Security = Automatically starts in ‘protection mode’ and offers security suggestions.   Database = MongoDB, Type = Document based, Vendor or open source = Limited open source version; advanced features require commercial subscription, Acid compliance = yes, Primary query language = Javascript, Top use cases = IoT management, real-time analytics, app development, inventory and personalisation, Security = Built-in security for authorisation authentication and encryption.   Database = Amazon DynamoDB, Type = Key value or document-based, Vendor or open source = vendor, Acid compliance = yes, Primary query language = DQL, Top use cases = Gaming, retail, financial services, advertising and streaming media, Security = Built-in security for data and application; vendor-secured software, hardware, facilities and network.

Image: Comparison table of NoSQL databases

When you’re ready, select Next to continue.

Difficulty
Intermediate
Duration
14m
Students
599
Ratings
4.6/5
Description

This first Course gives an overview of the five main database types and the components and concepts related to Entity Relationship Diagrams.

About the Author
Students
43803
Labs
168
Courses
1745
Learning Paths
45

A world-leading tech and digital skills organization, we help many of the world’s leading companies to build their tech and digital capabilities via our range of world-class training courses, reskilling bootcamps, work-based learning programs, and apprenticeships. We also create bespoke solutions, blending elements to meet specific client needs.