What is a database? Explained with a filing cabinet and its index
A database is an organised store of information that software keeps tidy, searchable and safe for many users at once. Explained as an office filing cabinet with a perfect card index.
- Author
Umair Mateen- Published
- Reading time
- 5 min
- Category
- Engineering
In one sentence: A database is an organised store of information, managed by software that lets many people and apps find, add and change records quickly, safely and at the same time.
The everyday picture
Picture the records room of a busy office. Every customer has a folder, and every folder sits in a filing cabinet. All the folders in one drawer follow the same layout: name on the first line, phone on the second, address on the third.
Next to the cabinet is a card index. Look up a name on a card, and it tells you exactly which drawer and slot to open. You never search every folder.
A records clerk runs the room. Staff hand the clerk a request slip, and the clerk checks who is asking, finds the folder and hands back the answer. Staff never rummage in the drawers themselves. A database is this whole records room, kept inside a computer.
Your app hands the database software a question. It checks the index, goes straight to the right drawer, and hands back only the record you asked for.
How it works, step by step
- Tables (drawers of folders): most databases keep information in tables. Each row is one record, like one customer's folder. Each column is one field, like "phone", and holds one kind of data.
- The database management system, or DBMS (the clerk): this is the software that stores, finds and changes the data. Your app talks to it, never to the raw files.
- A query in SQL (the request slip): most databases understand SQL, a language for asking questions such as "show me order 1042" or "add this new customer".
- An index (the card index): without one, the system may read the whole table to find a match. With an index, it jumps straight to the right rows, like the index at the back of a book.
- The answer (the folder handed back): the DBMS returns just the rows you asked for. It also controls who may read or change each table, and many people can use it at once.
Try it · Put it in order
Put the clerk's steps in order
Tap the steps in the order they happen.
Where the picture stops
- A real cabinet keeps folders in a fixed order. A database table makes no promise about row order; you ask for the sort order you want each time.
- Every new card index costs work. Each time a record is added or changed, the database must also update its indexes, so more indexes can slow writing down. Builders add indexes only where they help.
- Not every database uses tables. Some, often called NoSQL databases, store data in other shapes, such as documents or key-value pairs, which suit different jobs.
Why it matters for your business
- One source of truth: everyone works from the same records, instead of copies of a spreadsheet that drift apart.
- Speed: with good indexes, finding one customer among a very large number of records can still feel instant.
- Control: you can decide who may read, change or only view each kind of data, which helps protect customer information.
- Safety: database software handles backups and recovery, so a mistake or failure need not mean lost records. Backups still need testing.
Try it · Side by side
Shared spreadsheet or database?
Tap what matters to you (pick one or more) and see which option fits.
Shared spreadsheet
- Open a file and start typing.
- Sort, filter and chart in a few clicks.
- Edits can clash or overwrite each other.
- Usually whole-file access.
- Gets slow and hard to manage.
Database
- Needs tables designed and software set up.
- Needs a query or a reporting tool.
- Built for many users and apps at the same time.
- Rules per table, such as read-only.
- Indexes keep lookups fast.
Pick what matters to you and the better fit lights up.
An example
Imagine a 15-person furniture shop that tracks orders in a shared spreadsheet. Two people edit it at once and overwrite each other. Someone deletes a column by accident. The shop moves its orders into a small database behind its order app. Each order becomes a row in an orders table, linked to a row in a customers table. Sales staff can add orders, but only the manager can delete them. When a customer phones, staff type the order number and the index finds it straight away.
Frequently asked questions
Is a spreadsheet a database?
Not really. A spreadsheet is built mainly for one person working on a grid. A database is built for many users and apps at once, much larger amounts of data, and fine-grained control over who can do what.
What is SQL?
SQL (structured query language) is the language most relational databases use to read, add, change and delete data. Your app writes SQL; the database runs it and sends back the result.
What is the difference between a database and a DBMS?
The database is the stored information itself. The DBMS is the software that manages it, like the clerk who runs the records room. People often use "database" for both.
What is a relational database?
A database that keeps data in tables of rows and columns, and links tables together, for example each order to the customer who placed it. Well-known examples include PostgreSQL and Oracle Database.
Related explainers
- Frontend vs backend, explained with a restaurant
- What is an API? Explained with a waiter in a restaurant
- What are backups? Explained with a spare key at a friend's house
- What is a vector database? Explained with a library shelved by topic
The DevDrift designs the data behind the web and mobile platforms it builds: see how.
Sources
Could you explain this to a colleague now?
Mark it and posts that mention it will show a tick. Saved in this browser only.