What is a Database?
A database is an organised store of information that apps can search, read, and update instantly.
Think of it like this
It's like a giant, perfectly organised filing cabinet - every piece of information has its own labelled slot, and you can find exactly what you need in a fraction of a second, even if there are millions of files inside.
What's happening
Summary
A database stores structured information so that apps can retrieve exactly the right data the moment they need it.
A Closer Look
Most databases store data in tables - rows and columns, much like a spreadsheet. Each row is one record (one user, one order, one product) and each column is a piece of information about it (name, email, date). When an app needs data, it sends a query - a precise question like "give me all orders placed today" - and the database finds the matching rows almost instantly, even across millions of records.
Every action an app takes with data fits into one of four categories, known as CRUD: Create (add), Read (find), Update (change), Delete (remove). When you sign up for a website, your details are Created. When you load your profile, they are Read. When you change your password, it is Updated. When you close your account, your data is Deleted.
The table-based design most databases use dates back to 1970, when an IBM researcher called Edgar F. Codd proposed what's known as the relational model - "relational" because tables can be linked to each other. A table of customers and a table of orders, for example, can be connected by a customer number, so each order points to the person who placed it without copying their details every time. Most relational databases are queried with a language called SQL (Structured Query Language), which reads surprisingly close to English: SELECT name FROM customers WHERE city = 'Leeds' asks for the name of every customer in Leeds. Behind the scenes, indexes work like the index at the back of a book, letting the database jump straight to matching rows.
Common Misconceptions
- A database is not the same as a spreadsheet - databases are built for apps to query at speed, with strict rules to keep data consistent across millions of rows.
- Data is not stored "in the cloud" by magic - it lives in a database running on a server, somewhere physical in the world.
- Deleting your account does not always immediately delete your data - many services keep it for a period for legal or backup reasons.
Frequently asked questions
Who can see the information a company stores about me?
It depends on the company, but well-run organisations use access controls so that only staff and systems that need your data can see it. In the UK and the European Union, data protection law (GDPR) also gives you the right to ask a company for a copy of the personal information it holds about you, usually called a subject access request.
What happens when a company's database is hacked?
This is called a data breach: attackers get a copy of some or all of the information, such as names, email addresses and passwords. Responsible services don't store passwords in readable form - they store a scrambled version called a hash - but weak passwords can still be cracked. If you hear of a breach, change that password and anywhere else you reused it.
Are databases only used by big companies?
Not at all. Your phone almost certainly has many small databases on it right now. A compact database called SQLite is built into both Android and iPhone, and countless apps use it to store things like messages, settings and saved items. Web browsers commonly use it too, for your history and bookmarks. Databases range from tiny files on one device to systems spread across whole data centres.
How it connects
A database sits at the heart of almost every app or website:
Try it yourself
Every time you search for something on a website, filter results, or load a page that shows your name - a database query just ran. Next time you sign up for a service, picture your details being inserted as a new row in a table somewhere on a server.