A3.4.1 Other kinds of database: NoSQL, cloud, spatial and more
HL onlyCommand term: Outline1. Four other ways to store data
Relational tables are not the only approach. Press Next to see the same kind of data stored in NoSQL databases, then cloud, spatial and in-memory databases.
2. Spatial database lab: what is near me?
Click the map to set your location, then change the search radius. A spatial database answers this with a spatial index and distance functions.
3. In-memory database lab: speed and volatility
Run 1,000 lookups on the same data stored in RAM, on an SSD and on a hard disk. Then cut the power.
4. Flip-card deck
Click to flip. Say the answer before you flip.
5. Choose the database
Which approach fits each real-world system best? Streaks of 3+ score double.
6. 45-second speed round: which model?
A feature appears. Which database model is it describing?
Learning objectives
By the end of this page you should be able to:
- Outline why approaches other than relational databases are used.
- Outline NoSQL databases and the main NoSQL types.
- Outline cloud, spatial and in-memory databases.
- Identify real-world uses of each model, such as e-commerce, GIS, real-time analytics, social media and SaaS.
- Select a suitable database model for a given scenario.
Why other approaches?
Relational databases are excellent for structured data, strict rules and ACID transactions. But some systems hold huge amounts of varied data, must scale across many servers, store locations, or need answers in microseconds. Other database models are designed for these jobs (see the limitations in A3.1.1).
The four models
| Model | How data is stored | Strengths | Limitations | Real-world uses |
|---|---|---|---|---|
| NoSQL (“not only SQL”) | Not in fixed tables. Four main types: document (JSON-like documents, e.g. MongoDB), key-value (a key and its value, e.g. Redis), wide-column (rows with flexible columns, e.g. Cassandra), graph (nodes and relationships, e.g. Neo4j). | Flexible / no fixed schema; handles unstructured and semi-structured data; scales out horizontally across many servers; fast for simple lookups at huge scale. | Often weaker consistency (eventual consistency rather than full ACID); joins and complex queries are harder; data may be duplicated; less standardised query languages. | Social media platforms, e-commerce product catalogues, recommendations (graph), user profiles, big data. |
| Cloud | The database runs on a provider's servers and is used over the internet. Often a managed service (database as a service, DBaaS), e.g. Amazon RDS, Azure SQL, Google Cloud Firestore. Can be relational or NoSQL. | No hardware to buy; scales up or down on demand; pay as you go; the provider handles backups, updates, security patches and replication; accessible from anywhere. | Needs a reliable internet connection; ongoing costs; less control; data privacy and location (which country) concerns; vendor lock-in. | SaaS applications, managed services, startups, apps used in many countries, school management systems. |
| Spatial | Stores geometry: points, lines and polygons with coordinates, plus spatial indexes (e.g. an R-tree). Often an extension of a relational database, e.g. PostGIS. | Answers location questions fast: distance, nearest neighbour, “within 2 km”, “inside this area”, intersections. | Specialised and more complex; large geometric data needs a lot of storage and processing. | Geographic information systems (GIS), maps, ride-hailing and delivery apps, urban planning, environmental monitoring. |
| In-memory | Keeps the data in main memory (RAM) rather than on disk, e.g. Redis, SAP HANA, Memcached. | Extremely fast reads and writes (RAM is much faster than disk); ideal for real-time processing. | RAM is volatile: data is lost on power failure unless saved with snapshots or logs; RAM is expensive, so size is limited. | Real-time analytics, caching, session storage, gaming leaderboards, trading systems. |
The four NoSQL types in one line each
- Document: each record is a self-contained document; different documents can have different fields.
- Key-value: the simplest: look up a value by its unique key, very fast.
- Wide-column: rows grouped into column families; each row can have different columns; good for huge write volumes.
- Graph: nodes (people, products) and edges (FRIENDS_WITH, BOUGHT); good for following relationships.
These models are not exclusive: a cloud provider may host a NoSQL in-memory database, and a spatial database is usually relational. Choose the approach that fits the data and how it is used.
Use the 中文 button at the top to show or hide the Chinese terms.
| Term | 中文 | Meaning |
|---|
Choose an answer. You get instant feedback.
Score: 0 /
Write your answer first, then reveal the markscheme. These are exam-style practice questions written for this site.
1. Outline what is meant by a NoSQL database. [2]
2. State two advantages of using a cloud database for a small company. [2]
3. Outline one disadvantage of an in-memory database. [2]
4. A food delivery app must find the five nearest drivers to each customer. Explain why a spatial database is suitable. [3]
5. A social media platform stores posts that may contain text, images, polls or videos, for hundreds of millions of users. Explain why a NoSQL document database may be chosen instead of a relational database. [4]
6. Outline how each of the following could be used by an online shop: a NoSQL database, a cloud database, an in-memory database. [6]