Skip to main content

πŸ—„οΈ Welcome to Databases

What is a database?​

A database is an organized system for efficiently storing, managing, and retrieving information.
It allows you to save structured data that can be queried, updated, or deleted according to the needs of an application.

A database is not just a giant spreadsheet. It uses specialized models, languages, and structures to handle data robustly and securely.

❓ Why use a database?​

  • Allows handling large volumes of information
  • Facilitates concurrent data access
  • Ensures integrity, consistency, and security
  • Essential in modern applications (web, mobile, enterprise)

Types of databases​

  • Relational (SQL): use tables and relationships (PostgreSQL, MySQL, SQLite, MariaDB)
  • Non-relational (NoSQL): more flexible inherently (MongoDB, Redis, Cassandra, etc.)
  • Distributed: data distributed across multiple servers (CockroachDB, Cassandra)
  • In-memory: optimized for speed (Redis, Memcached)

πŸ” SQL vs NoSQL​

FeatureSQL (Relational)NoSQL (Non-relational)
StructureTablesDocuments, Key-Value, etc.
Query languageSQLVaries (Mongo Query, etc.)
ScalabilityVerticalHorizontal
ConsistencyHigh (ACID)Eventual (BASE)

NoSQL does not replace SQL. Each type is better suited depending on the use case: structure, scalability, relationship complexity, etc.

Common database use cases​

  • Storing users, products, events, logs
  • Managing relationships between data (users and their orders)
  • Querying filtered or grouped information
  • Data persistence between sessions