Database Models


A DBMS contains routines that translate commands into the actions required by the actual data storage system.

This conceptual view of the database is called a database model.

Common database models:

  • Flat-file
  • relational
  • hierarchical
  • object-oriented

Flat File Databases

flat-file database stores data in a plain text file.

  • Each line of the text file holds one record
  • Fields are separated by delimiters like spaces or commas
  • cannot contain multiple tables

Hierarchical Databases

Hierarchical database organize data in a tree structure.

  • one parent for each record, with optional nodes forming sub-trees called segments
  • Access to the data is predictable and restricted to the paths in the trees

Relational Databases

Relational databases contain database tables that can be joined together in logical ways.

  • each record has a unique identifier, referred to as a primary key
  • unique identifier creates the relationship among tables

A field may be marked as the primary key on one table but also be found on another table. When this happens, a relationship called a foreign key is created.

Object-oriented Databases

Object-oriented (OO) databases (also referred to as object databases) store complex data and relationships between data directly without using inter-table relations.

An object database is a collection of objects, each with two components:

  • data
  • instructions

The instructions, or software programs called methods, define what to do with the data in the object.

NoSQL Databases

In key-value databases (also referred to as stores), each item in the database is stored as an attribute name (or key) together with its value.

  • Graph stores are used to store information about networks of data, such as social connections
  • Wide-column stores are optimized for queries on large data sets and store columns of data together, instead of in rows
  • Document-format databases pair each key with a complex data structure known as a document.
    • Documents can contain many different key-value pairs

NoSQL, which is short for not only SQL, is an alternative to traditional relational databases in which data is placed in tables that are carefully designed before the database is built.

  • can accommodate a wide variety of data models, including key-value, document, columnar, and graph formats
  • especially useful for working with large sets of distributed data

Cloud Databases

Cloud databases are optimized to work in a cloud environment.

  • benefits:
    • ability to increase resources to accommodate for demands on the system
    • highly available even in the case of local or regional outages
    • support SaaS (software as a service) cloud deployments

Data Lakes

data lake is a system of data stored in raw format.

  • usually a single store of all enterprise data as well as information derived from data during reporting, transactions, or other activities
  • can include structured data and unstructured data

Distributed Databases

distributed database consists of data residing on different machines.

  • E.g., an international corporation might store and maintain local employer records at local sites, yet link those records via a network to create a single, distributed database