Learn
A3.4.1 | DATABASE APPROACHES (HL ONLY)
01 | START WITH THE QUESTION THE DATA MUST ANSWER
An online shop stores orders, searches a varied product catalogue, finds the nearest collection point and updates a fast-moving leaderboard. These tasks do not all ask the database to do the same kind of work.
Relational tables remain useful, but they are not the only approach. This HL section introduces NoSQL, cloud, spatial and in-memory databases and connects their characteristics to real applications.
To outline, give the main features and a relevant example. You should be able to explain briefly how data is organised or accessed, why the approach fits a task and one practical limitation.
Begin with the requirements: the shape of the data, the questions asked, acceptable response time, consistency needs, recovery requirements and how the system will be operated. A fashionable label is not a complete design decision.
02 | THESE FOUR LABELS CAN OVERLAP
| Label | Main question it addresses | Important distinction |
|---|---|---|
| NoSQL | How is data modelled and accessed outside the conventional relational-table approach? | A family of models, not one universal product. |
| Cloud | Where and how is the database hosted and operated? | Can be relational or non-relational. |
| Spatial | Does the system represent and query locations or shapes? | Can extend a relational database. |
| In-memory | Is the working dataset primarily held in RAM for access? | Can include persistence and different data models. |
These are not four mutually exclusive boxes. A cloud-hosted spatial relational database is possible, as is a managed in-memory key-value store. One label describes hosting, another data representation or specialised capabilities, another the main working storage.
When outlining a system, name the relevant dimensions rather than forcing it into only one. For example: “A managed cloud relational database with spatial support stores delivery locations and handles proximity queries.”
03 | RELATIONAL DATABASES ARE A USEFUL REFERENCE POINT
A relational design stores related facts in tables, with keys identifying records and linking them. SQL can join and summarise those facts, and constraints and transactions can support integrity.
This is useful for structured orders, payments, bookings and many other tasks. Alternative approaches do not make relational databases obsolete or incapable of scaling. The right choice depends on workload and implementation.
As we compare approaches, ask what changes: the data model, the available query operations, the hosting responsibility or the location of the working data. Keep those differences separate.
04 | NOSQL IS A FAMILY OF NON-RELATIONAL APPROACHES
NoSQL is commonly used for non-relational database models, often expanded as “not only SQL”. Common families include document, key-value, graph and wide-column stores. They do not all organise or query data in the same way.
Some emphasise flexible records, some direct key lookup and some relationships or large distributed workloads. A claim that fits one family does not automatically describe every NoSQL system.
NoSQL does not mean “no structure”, “no rules” or “no transactions”. Validation, indexing, query languages, transaction support and consistency guarantees depend on the particular system and configuration.
Nor is NoSQL simply a synonym for cloud or big data. A NoSQL database can run locally, and cloud systems can use SQL relational databases.
05 | DOCUMENT DATABASES FOR VARIED RECORDS
{
"productId": "P101",
"name": "Robot kit",
"price": 49.50,
"specifications": {
"controller": "microcontroller",
"motorCount": 2
},
"tags": ["robotics", "beginner"]
}
{
"productId": "P102",
"name": "Safety glasses",
"price": 8.00,
"specifications": {
"lensType": "clear",
"adjustable": true
}
}
A document database stores records as structured documents, often represented using JSON-like fields, nested objects and arrays. These two products share core facts but have different specification fields.
This can suit an e-commerce catalogue where different product categories have different attributes. Related details can be stored together for the access patterns the application needs.
Flexible structure still needs a design. Agree field meanings, types, required identifiers and validation rules; otherwise one record may use motorCount while another uses an incompatible field. Embedding related data can also create duplication that must be maintained. The shown documents are illustrative data, not a command for a particular DBMS.
06 | KEY-VALUE DATABASES FOR DIRECT LOOKUPS
| Unique key | Illustrative value |
|---|---|
| basket:U42 | A structured list of product IDs and quantities |
| session:S918 | A record linking a session identifier to session state |
| score:team17 | 1450 |
A key-value database associates a unique key with a value. The application can retrieve the value directly when it knows the key, rather than joining tables to assemble it. Systems differ in whether values are opaque data or rich structures with specialised operations.
This can fit shopping baskets, session state or cached results. Expiration features can remove temporary entries where supported. A plain dictionary-like model makes lookup easy to understand.
The trade-off is query flexibility: “find every basket containing a particular product” may need additional indexing or another design. Fast key access does not guarantee every kind of search is efficient. Session storage still requires suitable authentication and access controls.
07 | GRAPH AND WIDE-COLUMN APPROACHES
| Family | Main representation | Example task | Caution |
|---|---|---|---|
| Graph | Nodes and relationships, often with properties. | Explore followers, recommendations or connections in a social platform. | Graph modelling and traversal patterns still require design. |
| Wide-column | Rows organised around keys and column families; supported layouts vary. | Large event or activity histories accessed by suitable partition keys. | Efficient access often depends on choosing keys around expected queries. |
In a graph, a user can be a node and FOLLOWS a relationship to another user. Asking who is connected through several steps is a relationship-traversal task, different from fetching one basket by its key.
A wide-column store is not simply “a spreadsheet with many columns”. Its storage and distribution model is product-specific, often designed for particular high-volume access patterns.
For A3.4.1, these families help you outline what NoSQL can mean. You do not need to memorise a vendor’s command syntax to identify a suitable model and limitation.
08 | CLOUD DATABASES DESCRIBE DEPLOYMENT
A cloud database runs on cloud infrastructure and is accessed through an appropriate network route. It may be a self-managed DBMS on rented virtual machines or a managed database service.
A cloud service can offer relational tables, documents, key-value storage or other models. “Cloud” does not tell you whether the records use SQL, whether the working data is in memory or whether spatial functions are available.
An online shop might use a managed relational service for orders while hosting a document catalogue through another cloud service. Both are cloud databases, but their models and workload roles differ.
A network-accessible school server is not automatically a cloud database. Cloud hosting concerns the infrastructure and service model, not merely the fact that several computers can connect.
09 | MANAGED SERVICES AND SHARED RESPONSIBILITY
A managed database service can take over selected infrastructure tasks such as provisioning, patching, backups, monitoring or failover, depending on the offering and configuration. This can reduce the organisation’s operational workload.
The application owner still chooses appropriate data structures, user permissions, queries, retention and recovery requirements. An available backup feature is not the same as a tested restore process.
A managed service is not the same as SaaS. SaaS delivers a complete software application to its users; a managed database can be one component used to build that application. A learning platform, for example, may be SaaS while its developers use a managed database underneath.
Benefits include operational support and provisioning flexibility. Limitations can include recurring cost, network dependence, service restrictions, migration difficulty and responsibility for correct configuration. Do not assume cloud hosting automatically makes a system secure, unlimited or cheaper.
10 | SCALING AND AVAILABILITY NEED A DESIGN
A growing platform may need more capacity. Vertical scaling adds resources to a server; horizontal scaling distributes work across more machines where the database and workload support it. Cloud services can make provisioning easier, but application bottlenecks remain.
Replication can support availability or read capacity, while partitioning divides data across storage or processing units. Both introduce design choices involving consistency, routing, failures and cost.
An internet outage, a poor network route or a service failure can still affect access. Region choices and recovery arrangements should follow the organisation’s needs. A service’s existence in the cloud does not by itself guarantee uninterrupted access.
Outline the benefit with its condition: “A managed service can reduce server administration, provided its supported features, costs and recovery arrangements meet the application’s requirements.”
11 | SPATIAL DATABASES UNDERSTAND LOCATION AND SHAPE
A spatial database stores and queries spatial objects using appropriate types, indexes and operations. Geographic examples include a shop as a point, a road as a line and a delivery zone as a polygon.
It can answer questions such as “Which collection points are within 500 metres?”, “Does this address fall inside the delivery zone?” or “Which routes intersect the closure area?”. Storing a location label as ordinary text does not provide these capabilities by itself.
Spatial support can be part of a relational system. PostgreSQL with PostGIS is one example of combining relational tables with spatial types and operations. Spatial therefore does not necessarily mean NoSQL.
A GIS, or geographic information system, is a wider system for managing, analysing and presenting geographic information. A spatial database can supply its storage and query capabilities; the database is not merely the visible map.
12 | COORDINATES, DISTANCE AND UNITS MATTER
| Spatial object | School example | Possible query |
|---|---|---|
| Point | A building entrance | Which entrance is nearest? |
| Line | A footpath | Which paths cross a restricted area? |
| Polygon | A campus boundary | Is this location inside the campus? |
Coordinates need a coordinate reference system so positions and units are interpreted correctly. Latitude and longitude are angular coordinates; a difference of one degree is not simply one metre.
Distance and containment operations need suitable spatial semantics. Straight-line distance can differ from road or walking distance, and “nearest” depends on the measure used. Spatial indexes can reduce candidate searches, but the system must still apply the appropriate spatial test.
The following activity uses a fictional flat metre grid, not real latitude/longitude. It demonstrates a radius query so you can distinguish a spatial operation from a text lookup.
13 | TRY A SPATIAL RADIUS QUERY
The central meeting point is (500 m, 500 m). Choose a radius and find buildings whose straight-line distance from it is at most that radius. Points on the radius are included. The circle and table use the same calculation.
This is a fixed-data mathematical demonstration in the page, not a connection to a spatial DBMS or a routing service.
14 | IN-MEMORY DATABASES PRIORITISE RAM ACCESS
An in-memory database holds its main working dataset primarily in RAM. Accessing suitably structured memory-resident data can avoid much of the storage I/O required for disk-oriented access paths and support low-latency operations.
Examples include fast session state, live leaderboards and selected real-time analytics workloads. Some in-memory systems provide rich structures and atomic operations suited to these tasks.
Every DBMS uses some memory. A conventional database having a buffer cache is not automatically the same design as an in-memory database whose primary working representation is RAM-resident.
RAM capacity and cost limit how much working data can be held. Query design, network latency, concurrency, persistence and workload still affect response time, so “in-memory” does not guarantee instantaneous execution.
15 | IN-MEMORY DOES NOT NECESSARILY MEAN NO PERSISTENCE
RAM is volatile: its contents do not survive loss of power on their own. If an in-memory system is the authoritative store, it needs a suitable persistence and recovery design for the required durability.
Some systems use snapshots, logs or other durable storage mechanisms as well as replication. Redis, for example, offers configurable persistence mechanisms. What survives a failure depends on those settings and the failure being considered.
A cache holds a reusable copy of data that may exist elsewhere. Losing a reconstructible cache can be less serious than losing the only record of completed orders. An in-memory database can serve as a cache, but the terms are not interchangeable.
Replication is not a universal substitute for backups: a mistaken deletion may propagate. State the role of the data and acceptable loss before choosing the recovery policy.
16 | REAL-TIME ANALYTICS AND SOCIAL PLATFORMS
A live event dashboard may need rapid updates and fast summaries over recent data. Memory-resident processing can help suitable workloads, but durable event capture, ingestion delay and the calculation design also determine whether the displayed result is useful.
A social platform may use a graph for connections, document-like storage for varied posts and a key-value store for temporary state. That does not mean every social platform must use all those models.
The choice should follow the access pattern: retrieve a known post, traverse relationships, count events in a time window or locate nearby content. “Many users” alone does not identify the best model.
These systems may also be cloud-hosted and managed. Keep the model, deployment and performance decisions distinct when outlining their design.
17 | ONE E-COMMERCE SYSTEM CAN COMBINE APPROACHES
| Subsystem | Possible approach | Why it may fit | Design concern |
|---|---|---|---|
| Orders and payments | Transactional relational model, possibly managed in the cloud. | Structured relationships and integrity rules. | Correct transactions, permissions and recovery. |
| Varied product catalogue | Document model. | Different product attributes can be represented together. | Validation and duplicated facts. |
| Collection-point search | Spatial-capable database. | Distance and delivery-zone questions. | Coordinate system and distance semantics. |
| Temporary baskets or fast counters | Suitable in-memory/key-value service. | Direct access and low-latency operations. | Persistence role, expiration and consistency. |
Using several models is sometimes called polyglot persistence. It can fit different tasks, but adds operational complexity and the need to keep cross-system facts consistent.
For a small application, one well-chosen database may be simpler and sufficient. Do not assume a larger collection of database products automatically creates a better design.
18 | CHOOSE FROM REQUIREMENTS, NOT SLOGANS
| Requirement | Useful approach to consider | Question to ask |
|---|---|---|
| Variable catalogue attributes | Document NoSQL | How are fields validated and related facts maintained? |
| Known-key temporary state | Key-value, potentially in-memory | What happens on expiration or failure? |
| Nearest-location and zone queries | Spatial support | Which coordinate system and distance measure apply? |
| Reduced infrastructure administration | Managed cloud service | Which tasks are managed and which remain ours? |
| Fast repeated operations on a memory-sized dataset | In-memory approach | What are the capacity, durability and latency requirements? |
| Strong cross-record business rules | An appropriate transactional design | Which operations need atomicity and concurrency protection? |
Many systems can meet a requirement in more than one way. A good outline states the defining feature and applies it to the task without claiming that a model is always faster or another model cannot solve it.
19 | CHECK THE APPROACH AND THE LIMITATION
Choose the best outline for each scenario. Your first checked response counts; restart for another attempt.
20 | WRITE A SHORT, ACCURATE OUTLINE
Use defining feature → application → limitation. For example: “A spatial database supports location and shape types with spatial operations. A delivery service can query which collection points lie within a radius, provided the coordinates and distance units are interpreted correctly.”
For NoSQL, identify a family rather than treating every system as identical. For cloud, describe hosting and management rather than assuming a particular data model. For in-memory, link RAM-resident working data to latency while stating the persistence and capacity considerations.
Finally, recognise overlap: a service can be cloud-hosted, use a non-relational model and keep its working data in memory at the same time. The next lesson turns to data warehouses and their reporting objectives.
Further reading: NoSQL families, spatial database concepts and in-memory persistence options.