Dasturlash

Databases

inspire · · 1 мин чтения · 46 просмотров ·EN
Databases
Databases

A database is an organised collection of data together with the software that stores, retrieves and updates it. That software is called a database management system.

Relational databases

In the relational model, data is stored in tables of rows and columns, and tables are linked through keys:

  • a primary key uniquely identifies each row;
  • a foreign key references a row in another table and prevents references to records that do not exist.

Relational systems are queried with SQL, and they are the default choice when data is structured and correctness matters.

Transactions

Some operations must succeed or fail as a unit — transferring money between accounts is the standard example. Such a group is a transaction, and relational systems guarantee four properties, known by the acronym ACID: atomicity, consistency, isolation and durability.

Indexes

An index is an auxiliary structure that speeds up searching on a column, much as a book index avoids reading every page. Indexes accelerate reads but slow writes and consume storage, so they are chosen deliberately rather than added everywhere.

Non-relational systems

Not every problem fits tables. Other models are widely used:

  • document stores — flexible, JSON-like records;
  • key-value stores — extremely fast lookups, often used for caching;
  • graph databases — for data where relationships are the main subject;
  • time-series databases — for measurements and monitoring data.

Operational reality

Two rules cause most production incidents when ignored: take regular backups, and verify that they can actually be restored. An untested backup should be treated as no backup at all.

Категории
Даты
Впервые опубликовано: 13 августа 2026