Types of databases as approaches to storing data
Outline the different types of databases as approaches to storing data
In this lesson
- Outlining how NoSQL, cloud, spatial and in-memory databases store data, and how each differs from a traditional relational database
- Choosing a suitable database model for a real-world scenario and justifying the choice
- Outlining the main advantages and limitations of each model
LearnBeyond relational tables
Relational databases store data in related tables with a fixed schema and are queried with SQL. They suit most business data, but some systems need something different.
LearnNoSQL databases
NoSQL (“not only SQL”) covers databases that do not use fixed relational tables. The most common kind is the document database.
LabTables or documents?
An online shop sells very different products. Add a new kind of product, and open a product page, in each storage model.
Add the headphones and open a product page, in both models.
| ProductID | Type | Name | Price | Author | Pages | Size | Colour | RAM_GB | CPU | Screen_in |
|---|---|---|---|---|---|---|---|---|---|---|
| P1 | Book | The Quiet Coast | 14.99 | L. Moreau | 312 | NULL | NULL | NULL | NULL | NULL |
| P2 | T-shirt | Logo tee | 19.5 | NULL | NULL | M | Navy | NULL | NULL | NULL |
| P3 | Laptop | Air 13 | 899 | NULL | NULL | NULL | NULL | 16 | M-4 | 13.3 |
REVIEW(ReviewID, ProductID, Customer, Stars): 3 rows, linked by the foreign key ProductID.
Simplified: real relational designs might use a table per product type instead, which needs a new table for each new type. Add the headphones and open a product page in both models to complete this activity.
LearnCloud databases
LearnSpatial databases
LearnIn-memory databases
SummaryWhere each model is used
| Model | Typical real-world uses |
|---|---|
| NoSQL | E-commerce product catalogues, social media posts and feeds, content management |
| Cloud | Software as a service (SaaS) applications, managed database services for organisations without their own servers |
| Spatial | Geographic information systems (GIS), delivery and navigation apps, planning and environmental mapping |
| In-memory | Real-time analytics (e.g. fraud checks on card payments), caching web sessions, online gaming, processing sensor data |
CheckWhich model fits best?
Choose the most suitable database model for each system.
- A news site's comment threads, where each comment can have replies, reactions and attachments of different kinds
- A small company with no servers and no IT staff that needs a database for its booking app
- A council map showing which homes lie inside flood-risk zones
- A stock exchange matching buy and sell orders within microseconds
CheckQuick check
Which statement about in-memory databases is correct?
ExamWorked exam answer
An online clothing shop sells items with very different attributes (sizes, materials, care instructions, bundles). Outline one reason why it might store its product catalogue in a document (NoSQL) database.
[2]ReviewMistakes examiners see
“NoSQL databases cannot be queried.” They have their own query languages, and many support SQL-like queries; the name means “not only SQL”.
Treating “cloud” as a data model. A cloud database can be relational or NoSQL; “cloud” describes where it is hosted and who manages it.
When choosing a model, name the feature of the scenario that decides it (varied data, location, speed, no IT staff) and the property of the model that meets it.
Exam practiceExam-style questions
4 questions · 10 marks. Answer each one first, then mark it yourself against the markscheme. Your answers are saved in this browser only.
A city runs a bike-sharing scheme. Riders use an app to find and unlock bikes parked around the city. The app shows each rider's profile and trip history, a live map of available bikes, and a leaderboard of the riders with the most kilometres this week, updated after every trip.
Outline why a spatial database is suitable for showing riders the available bikes nearest to them.
The leaderboard is kept in an in-memory database. Outline one advantage and one disadvantage of this choice.
The city has no database administrators. Outline why it might use a cloud database provided as a managed service.
Rider profiles are stored in a document database, with each rider's trips embedded in that rider's document. Outline one disadvantage of this design for the scheme's managers.
0 of 4 questions marked. Mark every question to see your total.
Exam-style questions written for Praxis IB in the format of the 2027 specimen papers. They are not IB past-paper questions.