Skip to main content

What a Database Is in Plain Words and How It Works

MySQL / MariaDB · 13.10.2026 · 5 min read
Illustration for “What a Database Is in Plain Words and How It Works”

Database is a word that shows up in the description of almost any hosting plan, but it is not always clear what stands behind it and how a database differs from an ordinary text file. Here is a plain explanation of how a database is built, what SQL has to do with it, and when a site actually needs a dedicated DBMS.

What a database is in plain words

A database is an organized set of data stored so that it can be quickly found, changed, and linked to other data. Unlike a text file, where finding the right line turns into reading the whole content sequentially, a database stores records in tables with a strict structure and uses indexes for instant access.

For a site, the database usually stores whatever changes: article text, the list of products, user accounts, comments. The site's own code — PHP, templates, images — lives separately in the file system, while the database is responsible for the variable part of the content.

Types of databases

Web projects most often rely on a few kinds of DBMS, each suited to a different sort of task.

  • Relational databases — data is stored in linked tables with a strict schema, examples are MySQL and MariaDB.
  • Document databases — data is stored as flexible JSON-like documents without a rigid schema, an example is MongoDB.
  • Key-value stores — the simplest model of storing key-value pairs, used mostly for caching.
  • Embedded databases — work without a separate server, keep everything in one file, an example is SQLite.

Comparing a database and a plain file

The difference becomes especially clear once there is a lot of data and even more concurrent requests.

CriterionText fileDatabase
Finding a recordsequential read of the whole fileindex, instant access
Concurrent accessrisk of corruption on parallel writestransactions and locks managed by the DBMS
Links between datamust be maintained manuallyforeign keys and relations between tables
Complex queriesrequire writing a separate scriptone SQL query with conditions and sorting

How SQL works in plain words

SQL (Structured Query Language) is the language an application uses to talk to a relational database: asking for records, changing them, or removing them. The syntax reads almost like an ordinary English sentence, which is what makes SQL convenient for describing queries.

-- Get all users from Kyiv
SELECT name, email FROM users WHERE city = 'Kyiv';

-- Update an order's status
UPDATE orders SET status = 'paid' WHERE id = 42;

The first query selects rows by a condition, the second changes an already existing record. The DBMS itself keeps track of executing such queries, and a developer does not need to manually search for a line in a file and rewrite the whole thing.

What to do when a site needs a database

  1. Identify the type of data: if strict relations and reporting are needed, a relational DBMS such as MariaDB usually fits.
  2. Create the database and a separate user with rights only to it, instead of using a shared administrative account for the site.
  3. Set up regular backups of the database separately from the backups of the site's files.
  4. Check the access rights of the specific database user so the application cannot perform operations it does not need.
  5. Watch the database size grow and move it to a more powerful plan in time if performance starts falling short.

A detailed guide to setting up a specific DBMS is in the article about setting up MariaDB on a VDS, and access rights for applications are covered in the article about MySQL user privileges. If the database is already running and needs to move to another server, the article about migrating a database is useful.

Frequently asked questions

What is the difference between a database and a database server?

A database is the data itself and its structure, while a database server (DBMS) is the program that manages that data: accepting requests, executing them, and returning the result. A single DBMS server can run several separate databases at once.

Does a simple brochure site need a database?

For a static site without feedback forms and without an admin panel, a database is usually not required — plain files are enough. But even a simple CMS for editing text through a browser most often stores content in a database.

What is a SQL database and how does it work in practice?

The term "SQL database" usually means a relational database managed through the SQL language: the application sends a text query, the DBMS parses it, finds the needed rows in the tables, and returns the result to the client. This cycle repeats on every request to the site.

Was this article helpful?
← Back to Knowledge Base Ask Support