Database

A database is an organized collection of data that can be stored and accessed electronically. They are designed to store large amounts of information by structuring data that optimized information retrieval and modification. The structuring can include using tables, columns, rows, objects and indexes and other mechanisms that facilitate effective data management.

The structure of a database can be file-based, relational, record-based, document-based, and key-value based among other structures. The relational databases with tables, columns and rows and the use of SQL - Structured Query Language is the most common database used for transactional use today. MongoDB is an example of NoSQL Database.

Database Types

graph TD
    DB[Database Systems] --> Rel[Relational]
    DB --> NoSQL[NoSQL]
    DB --> Special[Specialized]
    Rel --> PostgreSQL["[[PostgreSQL]]"]
    Rel --> MySQL["[[MySQL]]"]
    Rel --> SQLite["[[SQLite]]"]
    Rel --> Oracle[Oracle]
    NoSQL --> Doc["Document ([[MongoDB]])"]
    NoSQL --> KV["Key-Value ([[Redis]])"]
    NoSQL --> WC["Wide-Column ([[Cassandra]])"]
    NoSQL --> Graph["Graph ([[Neo4j]])"]
    Special --> TS["Time-Series ([[InfluxDB]])"]
    Special --> Search["Search (Elasticsearch)"]
    Special --> InMem["In-Memory (Memcached)"]

See NoSQL Databases for when to choose non-relational and History of Relational Databases for how we got here.

Structured vs Unstructured Data

AspectStructuredUnstructured
FormatTables, rows, columnsText, images, video, audio, documents
SchemaPredefined, rigidNo predefined schema
QueryingSQLRequires specialized tools (NLP, ML)
StorageRelational databases (PostgreSQL, MySQL, Oracle)NoSQL Databases (MongoDB, Cassandra), data lakes
ExamplesCustomer records, financial transactions, inventoryEmails, social media posts, sensor data, videos

Semi-structured data (JSON, XML) falls between the two — it has some organizational properties (tags, keys) but no rigid tabular schema. Document databases like MongoDB are designed for this.

Core Concepts