Overview of Database Concepts and Types

Sep 25, 2024

Understanding Databases

Introduction to Data and Database

  • Data is vital in the digital world, impacting everything from governments to companies.
  • Success of a company relies on effective data utilization.
  • Definition of Data: Any information or fact can be considered data (e.g., name, age, address, bank balance).
  • Data can take various forms: images, videos, files, plain text.
  • Examples of data in a school setting: details of teachers, students, subjects.

What is a Database?

  • A Database is an electronically stored container for data.
  • Purpose: To easily access, modify, protect, and analyze stored data.
  • Examples of applications using databases: Google, Instagram, WhatsApp, Facebook.
  • Example Project: College timesheet web application.
    • Needs a database to store and retrieve data.
    • Database software is installed on a computer, connecting to the application.

Database vs. DBMS

  • Database: just a data storage container.
  • DBMS (Database Management System): software to manage databases.
    • Allows users to store, modify, retrieve, and protect data.
    • Examples of DBMS: MySQL, PostgreSQL, MongoDB, Neo4j, Cassandra.

Evolution of Databases

  • 1960s: First type of database - flat file databases (simple files like CSV).
  • Progressed to hierarchical and network databases (parent-child relationships).
  • Replaced by Relational Databases due to ability to store complex relationships.

Types of Databases Today

  • Relational Databases: 74% of databases used today.
  • Non-Relational Databases: Gaining popularity due to increased data usage, especially from social media.
  • Companies often use a combination of both.
  • Examples: Oracle (relational), MongoDB (non-relational).

Relational Database

  • Data stored in tables that are related to one another.
    • Tables consist of columns and rows.
    • Columns have names and data types (rules for data).
    • Rows represent records.
  • Example: Office database contains employee, manager, and department information.
  • Foreign Key: used to establish relationships between different tables.
  • Data retrieval through SQL (Structured Query Language).
  • Commonly used by financial institutions (banks, insurance).
  • Examples: Oracle, MySQL, Microsoft SQL Server, PostgreSQL.

Non-Relational Database

  • Categories include:
    • Key-Value Store: Simplest non-relational database, associates keys with data blobs (e.g., images, JSON).
      • Examples: Redis, Memcache.
    • Document Database: Stores data in structured documents (JSON, XML) with unique keys.
      • Examples: MongoDB, CouchDB.
    • Graph Database: Uses nodes, edges, and properties to represent data relationships.
      • Useful for identifying patterns (e.g., fraud detection).
      • Example: Neo4j.
    • Wide-Column Database: Stores data in rows and columns but uses column families without traditional tables.
      • Example: Cassandra, Edge Space.