A3.4.1 · Alternative databases and data warehouses
Kinds of database
By the end you can
Outline NoSQL families (document, key-value, wide-column, graph), cloud, spatial and in-memory databases.
Relational databases are not the only way to store data. They are brilliant for structured, consistent data, but struggle when the data is huge, varies from record to record, or is mostly about relationships. Other database models were invented for those jobs, and you need to know what each is for.
NoSQL databases#
(“not only SQL”) databases do not use fixed, linked tables. They have flexible schemas and are designed to scale out across many servers, so they suit big, varied, fast-changing data such as web applications and real-time analytics. There are four main families.
- Document databases store each record as a self-contained document, usually JSON, holding fields and values (and even nested data) together. No joins are needed to read one, and each document can have different fields. Good for content management and product catalogues; the risk is repeated data and inconsistency. Example: MongoDB.
- Key-value databases store a value under a key, like a giant dictionary. Very fast to read and write, used for caching and session data, but you can only look things up by key. Example: Redis.
- Wide-column databases store data in tables with rows and flexible columns: different rows can have different columns. They handle huge, sparse data sets and spread easily across servers but are complex to design. Example: Cassandra.
- Graph databases store nodes (people, places, things) and edges (the relationships between them). They are excellent for complex connections such as social networks and recommendation engines, but need a specialised query language.
{
"_id": "c12345",
"name": "Ana Lopez",
"email": "ana@example.com",
"address": { "street": "12 River Lane", "city": "Madrid" },
"services": ["transport", "tourism"]
}Cloud, spatial and in-memory#
- Cloud databases run on a cloud platform. They can be relational or NoSQL. They scale up and down on demand, can be spread over data centres across the world for faster access, and are billed by use. You can run one yourself on a rented virtual machine (full control, more work) or use a fully managed service where the provider handles backups, patching and scaling.
- Spatial databases are built to store and query geographic data: points, lines and polygons (a shop, a road, a country border). They power maps and geographic information systems (GIS), and add questions such as “which of these points are within 5 km of here?”.
- In-memory databases keep all their data in RAM instead of on disk. Reads and writes are extremely fast, so they suit real-time work such as gaming, sensor data and trading. The limits are the cost and size of RAM, and the need to protect the data from a power failure.
A school’s student records: structured, with strict rules, and many reports.
A blog platform where every post has different fields.
A website caching a shopping basket against a session ID.
Recommending films because friends of friends liked them.
A delivery firm working out which depots are within 10 km of an address.
A trading system that needs answers in microseconds.
Billions of sensor readings, each device reporting different measurements.
0 of 7 matched
Check yourself
Kinds of database
Quick questions, made fresh every time and marked here. Do a few until they feel easy.
Exam practice
Paper 1-style questions
4 questions · 14 marks
Write your answer as you would in the exam, then show the mark points and tick each one your answer made. These are our own questions in the style of the exam, not past-paper questions.
1.Outline what a NoSQL database is and why an organisation might choose one instead of a relational database.
[4]Outline: A brief account: the main points, without much detail.
2.Identify the type of database best suited to: (a) a social network’s “friends of friends” suggestions, (b) caching a user’s login session, (c) a product catalogue where products have very different attributes, (d) mapping the routes and boundaries of a city.
[4]Identify: Pick out the answer from the options or the context.
3.Describe the benefits of a cloud database for a company with customers around the world.
[3]Describe: A detailed account: say what happens, step by step if it is a process.
4.Explain why an in-memory database suits real-time applications, and one limitation.
[3]Explain: Give reasons: say what happens AND why, or how one thing causes another.
Past papers
Old exam questions on this topic
From HL Paper 1, May 2014 to November 2025. These papers were set on the previous syllabus, so the wording may differ from today's exam, but the topic is the same. Find the questions and markschemes in your school's past-paper pack.
| Paper | Question | Marks | About |
|---|---|---|---|
| May 2025 TZ2 | 4(a) | 2 | Paper 2 Option A: kinds of database (same in TZ3) |
| November 2017 | 4(b) | 2 | Paper 2 Option A: kinds of database |
In a nutshell
- The relational database is one model. NoSQL databases store data without fixed linked tables, scale out well and handle varied data.
- Four NoSQL families: document (JSON-like documents), key-value (a key and a value), wide-column (rows with different columns) and graph (nodes and edges).
- Cloud databases run on cloud platforms: they scale on demand and are managed by the provider. Spatial databases store points, lines and polygons for maps. In-memory databases keep data in RAM for speed.
- Choose by the data and the job: structured and transactional means relational; varied, huge or relationship-heavy data may suit NoSQL.
