Skip to content
Development and deployment2 min read

What is a database?

Short answer

A database is an organised collection of data managed by specialised software (a DBMS) that lets you store, search and update it quickly and safely. On websites it holds posts, accounts and orders, while images and other files stay on disk.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Main types
  2. Example: joining two tables
  3. Common concepts and problems
  4. On ArabyHost

When you publish a post in WordPress, no new file is created: a row is added to a table in the database. PHP then reads that row on every visit and builds the page from it. That’s why a site’s speed and stability depend so directly on its database.

Main types

Type How it stores data Examples Typical use
Relational (SQL) Tables, columns and relationships MySQL, MariaDB, PostgreSQL, SQLite Websites, stores, accounting systems
Document JSON-like documents MongoDB Data with a changing shape
Key-value One value per key, often in memory Redis Cache, sessions, queues
Vector Numeric representations of text pgvector and others Semantic search in AI apps

Example: joining two tables

SELECT c.name, COUNT(o.id) AS orders_count
FROM customers c
JOIN orders o ON o.customer_id = c.id
GROUP BY c.name;

This counts each customer’s orders across two tables linked by customer_id: linking tables like this is what relational databases are built for.

Common concepts and problems

  • Software vs database: MySQL is the software (the DBMS); user_shop is one database inside it.
  • Connection details: an app needs the database name, username, password and host. Any mistake there shows up in WordPress as Error establishing a database connection.
  • Slowness: usually large tables without indexes or repeated queries, not database size by itself.
  • Security: building SQL straight from user input opens the door to SQL injection. Use prepared statements.

On ArabyHost

Hosting plans include MySQL/MariaDB databases that you create in cPanel and manage in phpMyAdmin, as shown in the create a database guide. PostgreSQL and Redis aren’t offered per account. Each account has its own resource limits, so heavy queries affect your own site’s speed. Daily JetBackup backups cover your account, but still export the database before any major change.

FAQ

What's the difference between a database and hosting?

Hosting covers file storage and the web server; the database is one part of it, running as a separate service. WordPress files sit in your site folder, but posts and settings live in the database.

Does every site need a database?

No. A static HTML site doesn't. Any site with changing content, logins or orders, such as WordPress or an online store, does.

Is a backup of my files enough to restore the site?

No. Your backup must include the database too, because content and orders are stored there, not in the files.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.