Strozzi's NoSQL keeps relational tables as plain text files and queries them with Unix pipes: it refused the SQL language, not relations. When Johan Oskarsson, then at Last.fm, reused the word for his 2009 meetup on open-source, distributed, non-relational databases, it named the opposite choice — Strozzi's own page remarks that the movement should rather have been called "NoREL". (Background: Strozzi's site and the NoSQL entry of Wikipedia.)
CAP, BASE and the NoSQL landscape
After this lesson you will say what a replica answers when the network breaks, define BASE in the slides' words and know where those words slip, tell the four NoSQL families apart by one line each, and fill the exam's one-point "which DB technology" table with motivations that earn the point.
A concert hall sells its tickets through a database kept in two copies, one on a server in Milan and one in Dublin, so that every fan gets a fast answer. One evening the cable between the two cities is cut. A second later a fan in Milan buys the last ticket: the Milan copy now says 0 tickets left. A second after that, a fan in Dublin opens the concert page — and the Dublin copy cannot reach Milan.
Dublin can think of three answers: "0 tickets left", "1 ticket left", or "sorry, try again later". One of them is out of its reach. Which one? And of the other two, which would you want when the Dublin fan presses Buy, and which when the same page only shows how many fans are going?
The slide that states the theorem behind this puzzle (p. 195) says a distributed system can have any two of three guarantees. The next slide takes it back. By the end of the lesson you will know why, and you will answer both questions in the slides' own words.
Three guarantees and a cut cable
The exam guideline lists "The CAP theorem" and "ACID vs. BASE" among the theory topics of NoSQL and data models, and this part of the deck is where both live. Page 195, "CAP Theorem (Brewer's Theorem)", states it: "It is impossible for a distributed computer system to simultaneously provide all three of the following guarantees":
Consistency — "all nodes see the same data at the same time".
Availability — "Node failures do not prevent other survivors from continuing to operate (a guarantee that every request receives a response about whether it succeeded or failed)".
Partition tolerance — "the system continues to operate despite arbitrary partitioning due to network failures (e.g., message loss)".
Read them on the hook (Fig. 1). A partition is the cut cable: the network splits the nodes into groups that cannot exchange messages. Consistency would mean Dublin answering "0 left", the same data Milan has. Availability means Dublin gives a real answer, a number of tickets, and not an error. Partition tolerance means the system keeps operating although every message across the cut is lost.
Dublin's copy says 1, and nothing has reached it since the cut. The slides state the theorem without proof; the classic argument — Seth Gilbert and Nancy Lynch proved Brewer's conjecture in 2002 — fits on the same two copies (background, not slide text).
Take the smallest distributed system: two copies, Milan and Dublin, both holding \(v_0\), "1 ticket left". With more nodes the argument is the same: split them into two groups that cannot talk to each other.
Cut the cable: every message between the two is now lost — the "arbitrary partitioning due to network failures (e.g., message loss)" of the definition. Partition tolerance asks the system to keep operating anyway.
A client asks Milan to write \(v_1\), "0 left". Refusing with an error would already give up availability, so Milan accepts — and the write exists in Milan only: no message can carry it to Dublin.
A client then asks Dublin for the value. To stay available, Dublin must answer, without asking Milan.
Dublin has heard nothing since the cut, so it can only return \(v_0\), while consistency demanded \(v_1\). While a partition lasts, C or A must give way; choosing which is the only freedom left.
So the answer out of Dublin's reach is "0 left": it is the truth, but no message can bring it there. What remains is a choice between the other two — and that is where the last line of p. 195 goes too far.
"The C of CAP is the C of ACID." No. ACID's consistency (lesson 3) means that a transaction keeps the integrity constraints: a property of one database. CAP's consistency means that every copy shows the same data: a property of replicas. A single-site database has the first and never faces the second.
Consistency or availability, decided per operation
Page 196, "So, what can be done?", corrects the slide before it. A distributed system needs a network, and "Failures can, and will, occur to a networked system", so partition tolerance must be accommodated. Then "the only option left is choosing between Consistency and Availability": "CA doesn't make any sense", except for a database on a single site — one machine has no cable to cut. (The slide adds 2-phase commit and cache validation protocols: they keep copies in step only while every node can be reached.) The choice is "Not necessarily in a mutually exclusive manner, but possibly by partial accommodation of both → trade-off analysis important". Then the two lines to learn word for word:
CP — "A partitioned node returns a correct value, if in a consistent state; a timeout error or an error, otherwise".
AP — "A partitioned node returns the most recent version of the data, which could be stale."
CP keeps the data right and gives up the answer; AP keeps answering and gives up being sure. Neither produces the current value on the far side of the cut. Try both in the widget — and the mixed setting the next slides recommend.
Two seesaws (pp. 197–198, Fig. 2) say what the widget showed. The first balances consistency against availability: the choice during a partition. The second swaps availability for performance. Read it as the trade-off of an ordinary day, with no partition at all: to answer consistently a replica must first hear from the others — the round trip of task 4 — so consistency is paid in waiting time. Beside it the slide writes three sentences to know by heart: "It's a trade-off!", "It's a continuous space!", "It's not at DBMS level, It's at operation level!".
p. 197: consistency against availability
p. 198: consistency against performance
"Continuous": between "wait for every copy" and "answer from the nearest one" lie settings such as "wait for two copies out of three", which lesson 22 meets as Cassandra's consistency levels. "Operation level" is task 3: one database serves the sale CP and the page AP. (Background: in 2012 Daniel Abadi gave this pair of trade-offs a name, PACELC — if Partition, then Availability or Consistency; Else, Latency or Consistency.)
Why can't Dublin simply wait until the cable is repaired?
Because waiting forever is not an answer. Availability asks for a response to every request; a node that waits a bounded time and then gives up is the CP behaviour of p. 196 — "a timeout error". A partition can last seconds or hours, and nobody inside the system knows which.
Page 199 is the picture everybody remembers, the "Visual Guide to CAP Theorem" (Fig. 3): a triangle with "Pick Two" in the middle and databases lined up along its sides.
Read it as a map from 2010 (it comes from a blog post by Nathan Hurst — background), with two caveats the course itself supplies. It classifies whole products, while p. 198 has just said the choice is made per operation: MongoDB and Cassandra let each request say how many copies must agree (lessons 16 and 22). And its CA side is no third option for a distributed system: p. 196 grants CA only to a single site, where there is nothing to partition. Yet that side also lists Aster Data, Greenplum and Vertica, databases that run on clusters — when their network splits, they too must give up C or A.
If you revise from the course notes: their page 10 swaps the two lines. It prints the CP behaviour (a correct value, or a timeout or an error) under "AP", with "typical use case: banking applications", and the AP behaviour (the most recent, possibly stale version) under "CP". The slides are right (p. 196), and banking belongs with CP.
BASE: stale is fine, if you say when
Look again at the AP answer of the widget: "1 left, 4,999 going, as of 21:00". It is out of date, and it is not a lie. Page 202, "ACID vs. BASE", makes this a design principle: "It's ok to use stale data (Accounting systems do this all the time. It's called "closing out the books.") ; it's ok to give approximate answers". The condition: "Use resource versioning -> say what the data really is about – no more, no less." Not "x is 5", but "The value of x is 5, at time T and date D". A balance sheet closed on 31 December is still true in March — about 31 December.
The name is a chemistry pun: p. 200 shows three beakers, acid, base and salt, under "Recall the CAP theorem!", and p. 202 shifts "the PH from 0-6 (acidic) to 8-14 (basic)". Page 201 answers the obvious fear, "ACID properties may not hold -> no properties at all then???": these systems focus on "availability of data even in the presence of multiple failures" and "spread data across many storage systems with a high degree of replication" — the many copies that make immediate consistency expensive. Hence the question of p. 202, "Can some compromise be made between C and A?", instead of giving up either one completely.
BASE — "Basically Available, Soft-State, Eventually Consistent" (p. 203):
- Basic Availability: "fulfill request, even in partial consistency."
- Soft State: "abandon the consistency requirements of the ACID model pretty much completely" (but see the red pen below).
- Eventual Consistency: "at some point in the future, data will converge to a consistent state; delayed consistency, as opposed to immediate consistency of the ACID properties."
The last letter carries the deepest remark of the section. Eventual consistency is "purely a liveness guarantee (reads eventually return the requested value); but does not make safety guarantees, i.e., an eventually consistent system can return any value before it converges". A liveness property promises that something good eventually happens; a safety property, that nothing bad ever happens. Fig. 4 shows the difference on three replicas.
Eventual consistency promises convergence, not correctness on the way: if the writes stop, every copy ends up equal; before that, any value may come back.
Page 204 sends the bill. There is "No general answer to whether your application needs an ACID versus BASE consistency model", but "Given BASE's loose consistency, developers need to be more knowledgeable and rigorous about consistent data if they choose a BASE store", and "Planning around BASE limitations can sometimes be a major disadvantage when compared to the simplicity of ACID transactions." In an ACID database the DBMS keeps the data correct (lesson 3); in a BASE store the application must — the oversold ticket becomes your code's problem. Hence: "A fully ACID database is the perfect fit for use cases where data reliability and consistency are essential."
| ACID | BASE | |
|---|---|---|
| The letters | Atomicity, Consistency, Isolation, Durability | Basically Available, Soft state, Eventually consistent |
| When the data is consistent | immediately, at the end of every transaction | "at some point in the future": delayed consistency |
| What a read may return | the committed value | a stale value — better if versioned; "any value before it converges" |
| Who keeps the data correct | the DBMS: integrity checking, concurrency control, recovery | the developer, "more knowledgeable and rigorous about consistent data" |
| Best fit | "use cases where data reliability and consistency are essential" | data spread over many replicas, where stale or approximate answers are acceptable |
Which is why relational did not give way. Page 205, "Why didn't we change Relational?", answers "Consolidated", "Integration platform", "Granting ACID properties!" (lesson 3); the second item returns in section 5.
NoSQL: a name older than the movement
Page 207 compresses the argument so far into one "Good Quote!", signed Cedric Beust: "Google, Amazon, Facebook, and DARPA all recognized that when you scale systems large enough, you can never put enough iron in one place to get the job done (and you wouldn't want to, to prevent a single point of failure). Once you accept that you have a distributed system, you need to give up consistency or availability, which the fundamental transactionality of traditional RDBMSs cannot abide." Scale forces distribution (lesson 3), distribution forces the CAP choice, and the choice calls for new databases.
They are older than their name (Fig. 5). Pages 208–209 run from "MultiValue databases at TRW in 1965" to "The term NoSQL was reintroduced in early 2009"; p. 210, "The #NOSQL story", adds "A meetup — Johan Oskarsson in SF, CA, June 2009" and "A hashtag: #nosql". The slide prints in bold the date that surprises: "Carlo Strozzi used the term NoSQL in 1998 to name his lightweight, open-source relational database that did not expose the standard SQL interface."
Who built them? Page 214, "NoSQL originators": Google (BigTable, LevelDB), LinkedIn (Voldemort), Facebook (Cassandra), Twitter (Hadoop/Hbase, FlockDB, Cassandra), Netflix (SimpleDB, Hadoop/HBase, Cassandra), CERN (CouchDB). Not database vendors: web companies and a laboratory whose own data outgrew "iron in one place". Some built the stores (BigTable, Cassandra, Voldemort, FlockDB); others were their early, visible users. Page 215, "Transactional properties?!", draws the line between the two worlds:
- structured query language for traditional relational databases: "unique keys, single valued, no update/insertion/deletion anomalies" — the normal forms of lesson 9
- "Well structured data"
- "ACID properties should hold"
- "triggered by the storage needs of Web 2.0 companies such as Facebook, Google and Amazon.com"
- "Not necessarily well structured – e.g., pictures, documents, web page description, video clips, etc."
- "Lately of increasing importance due to big data"
- "BASE properties may be enough"
Not only SQL is the reading to keep: SQL stays where its guarantees are needed, and the new stores are added beside it.
Four families, one line each
The deck sorts the newcomers twice. Page 211, "Kinds of NoSQL", first makes a two-way cut: "Key/Value or 'the big hash table' (remember caching?)" — Amazon S3 (Dynamo), Voldemort, Scalaris, MemcacheDB, Azure Table Storage, Redis, Riak — against "Schema-less": "Cassandra (column-based)", "CouchDB (document-based)", "Neo4J (graph-based)", "HBase (column-based)" — an odd cut, since key-value stores are schema-less too. Pages 212–213, "Different Types of NoSQL", then give the four families the exam works with, each with the line that tells it apart. Learn the lines: they are the motivations of the one-point table.
| Family (slide title) | The slide's line | Products on the slide | Lessons |
|---|---|---|---|
| Key-Value Store | "A key that refers to a payload (actual content / data)" | MemcacheDB, Azure Table Storage, Redis | 17–19 |
| Column Store | "Column data is saved together, as opposed to row data"; "Super useful for data analytics" (see the red pens) | Hadoop, Cassandra, Hypertable | 20–22 |
| Document / XML / Object Store | "Key (and possibly other indexes) point at a serialized object"; "DB can operate against values in document" | MongoDB, CouchDB, RavenDB | 13–16 |
| Graph Store | "Nodes are stored independently, and the relationship between nodes (edges) are stored with data" | Neo4j | 10–12 |
The four lines differ in what the database can see (Fig. 6). A key-value store sees keys only: the payload is opaque, so the one question it answers fast is "what is under this key?" — which is why p. 211 says "remember caching?". A document store sees inside the payload: it can index and filter on fields, it "can operate against values in document". A graph store sees the relationships themselves, stored next to the nodes, so a query walks from node to node instead of joining tables. And the column store keeps rows found by a key, each row with its own set of columns — which is not quite what p. 212 says.
The exam adds a fifth family that these slides do not list. The guideline deck names, among the features to know, "Search-based (ElasticSearch)", and the 2026/27 rules list Elasticsearch among the practical topics. Its line: an inverted index from words to documents, with relevance scoring — find by words and rank the hits (lessons 24–26).
One more slide explains how a company ends up using several families at once. Page 216, "Integration: from data to services" (Fig. 7), shows two applications, Billing and Inventory. In the "SQL world" they meet in one Integration Database — p. 205's "Integration platform" — so its schema is a contract nobody may break, and one model must serve them all. In the "NO-SQL world" each owns an Application Database and they talk through a web service: each database now belongs to one application and can be schema-less, a graph or a key-value store, whichever fits that application's data.
SQL world: the database is the meeting point
NoSQL world: services are the meeting point
The one-point table: which database for which part
Five of the nine past papers open with the same exercise: "Exercise 1 - Unstructured data models (1 PT)", "Which DB technology would be the best to store the entities/rel. of the ER diagram? [you may not need all the rows of the table]", with a three-column table, ENTITIES / REL. | DB TYPE | MOTIVATION, and three empty rows. The exam guideline describes the skill in its own words: "which data model families should be used for each part of the data". The family lines of section 5 are the toolkit; here is a recipe:
- Read the shape of the data. A web of many-to-many relationships points to a graph. An entity read together with its 1:N children, or an ISA whose children carry different attributes, points to a document. Free text searched by words points to a search engine. A value reached only through its key — a cache, a set, a counter with a TTL — points to key-value. A large, continuously growing volume of records, written fast and read by key, points to a column store.
- Read the shape of the questions: counting along paths, filtering inside an aggregate, ranking by words, fetching by key.
- Group the entities and relationships into two or three parts, one family each.
- Motivate each row with data shape, question shape and the family's line from pp. 212–213.
The paper gives itself away. Its later exercises name the entities each technology gets: in the exam of 13 June 2025, Neo4j works on Audience, Concert, Artistic Director and Location, MongoDB on Orchestra, Maestro, Musician and Instrument, Redis on Instrument, Elasticsearch on Track. Read the whole paper before filling the table. An entity may appear in two exercises — that is two access paths to the same data, not a contradiction.
The column store fills no row of the solved table below, but two 2025 papers say when the examiners reach for one: "Suppose you expect to record large-scale, continuously increasing number of sales of products in the market, and therefore you decide to store it in a columnar database" (exam of 12 Sept 2025, exercise 1; the exam of 30 May 2025 says the same of "a large number of purchases of puzzles"). A volume that keeps growing, read by key: that is the column store's motivation.
Now rehearse on a real paper: the exam of 13 June 2025, "tracking concert attendances and performances", exercise 1. Its ER diagram has Person, with the total and exclusive sub-entities Audience, Artistic Director, Maestro and Musician, and Concert, Location, Track, Orchestra and Instrument, joined by Attend, Organize, Located, At, Perform, Direct, Compose and Play. The widget takes it one fragment at a time, drawn in the paper's notation.
Check yourself: the model table for the exam of 13 June 2025
| ENTITIES / REL. | DB TYPE | MOTIVATION |
|---|---|---|
| Audience, Concert, Artistic Director, Location; Attend, Organize, Located | Graph DB (Neo4j) | Attend is many-to-many (a member attends 1..N concerts, a concert has 0..N attendees) and the queries count along paths: concerts per director with more than 1000 attendances, locations per member. The relationships are stored with the data, so each hop is followed without a join. |
| Orchestra, Maestro, Musician, Instrument; Direct, Compose, Play | Document DB (MongoDB) | An orchestra is an aggregate read as one unit: its maestro (Direct is 1:1) and its members — at least 10, each in at most 2 orchestras — nested in it with the instruments they play (Since as a field). The DB can operate against values in the document: members named "Lorenzo" who play the piano. |
| Track | Search-based DB (Elasticsearch) | Tracks are found by words in their fields — composer "Bach", music type classical — and ranked ("prioritizing" the longer ones): an inverted index with relevance scoring. |
Under the table, one sentence for what is left: the Person attributes are copied into each sub-entity where it is stored; At and Perform can be edges from the concerts and orchestras to track nodes that carry only the title; and the set of instrument names checked by exercise 4 is a key-value extra.
Back to the concert hall of the hook. "0 tickets left" was out of Dublin's reach: the truth was on the other side of the cut. The other two answers are the two corners: "1 left, as of 21:00" is AP, "try again later" is CP. For Buy you want CP — an error is better than a seat sold twice, as the widget's oversold counter showed. For the count of fans going, AP is fine, and honest when it carries its time. One system, two choices, made per operation: "It's not at DBMS level, It's at operation level!". And "pick two of three" was never the menu — the cut cable had already chosen P.
Exam-style questions
Theory questions in the forms the theory part uses — true/false, multiple choice and short open answers, where a wrong tick may cost points — and one practical exercise in the wording of the past papers.
True or false: according to the CAP theorem, a distributed database can choose to be CA — consistent and available — by not tolerating network partitions.
Show model answer
False. In a distributed system a network is inevitable and failures will occur, so partition tolerance must be accommodated; when a partition happens the only choice left is between consistency and availability. CA makes sense only for a single-site database, which is not distributed.
The trap is p. 195's "any two of these guarantees". The examiner checks that you know p. 196 takes it back. Wrong answers may carry a penalty (the rule is announced just before the exam): tick only what you can justify.
During a network partition, a node of a CP system:
Show model answer
The second option. A CP system keeps consistency and gives up availability: a partitioned node returns a correct value if it is in a consistent state, a timeout error or an error otherwise.
Learn the two lines of p. 196 exactly; the course notes (printed p. 10) swap them, which is the most likely way to get this question wrong.
State the CAP theorem and its three guarantees. Explain why, in practice, a distributed system chooses between consistency and availability, and why that choice can be made per operation. Give an example.
Show model answer
The CAP theorem (Brewer) states that a distributed system cannot provide at the same time Consistency (all nodes see the same data at the same time), Availability (node failures do not stop the survivors; every request receives a response about whether it succeeded or failed) and Partition tolerance (the system keeps operating despite arbitrary partitioning due to network failures, such as message loss). In a distributed system the network is inevitable and failures will occur, so partition tolerance must be accommodated: during a partition a node that cannot reach the others either refuses — CP: a correct value if it is in a consistent state, a timeout or an error otherwise — or answers with the most recent version it has, which could be stale — AP. CA is meaningful only for a single-site database. The trade-off is a continuous space and is decided at operation level, not for the whole DBMS; even without partitions, consistency costs latency. Example: a ticketing system serves the purchase of a seat CP (better an error than a seat sold twice) and the page showing how many fans are going AP (a slightly stale, timestamped count is acceptable).
Three things to earn: the three definitions, the argument that P cannot be declined (hence C or A), and the operation-level trade-off with an example. "Pick any two" alone, without p. 196, is the answer the slides themselves correct.
What does BASE stand for? Explain each property, why eventual consistency is "purely a liveness guarantee", and when an ACID database is the better choice.
Show model answer
BASE stands for Basically Available, Soft state, Eventually consistent. Basically available: the system fulfils requests even in partial consistency, answering when some replicas are not up to date. Soft state: the state may change over time without new input while the replicas converge (the slide words it as abandoning the consistency requirements of the ACID model "pretty much completely"). Eventually consistent: at some point in the future the data will converge to a consistent state — delayed rather than immediate consistency. This is purely a liveness guarantee, because it only promises that something good eventually happens (reads return the converged value), and no safety guarantee, because before converging the system can return any value. The rationale is that stale data is acceptable when it is versioned ("the value of x is 5, at time T and date D"), as accounting does when it closes out the books. The price is that developers must be more knowledgeable and rigorous about consistent data, so a fully ACID database is the better fit where data reliability and consistency are essential, such as payments.
Give both readings of soft state — the slide's sentence and the precise meaning. The liveness/safety pair is the part most answers miss, and "who pays" (the developer, p. 204) is the comparison with ACID the examiner looks for.
Which statements about NoSQL agree with the lecture? Select all that apply.
Show model answer
The first three. The term NoSQL was first used by Carlo Strozzi in 1998 for a relational database without SQL and reintroduced in 2009; it is read "Not only SQL".
A select-all question where wrong ticks may cost points: the two false options are the classic traps, the 1998 origin of the word and the "not only".
Exam of 6 Sept 2024, exercise 1. Consider the following ER diagram of a restaurant. Person (Personal_ID, Name, Surname, Birth Date, Phone Number) has the sub-entities Owner (Owner Since, E-mail), Customer (E-mail), Waiter (Hiring Date) and Chef (Hiring Date); Head Chef (Head Chef Since) is a Chef. Restaurant (Restaurant_ID, Name, Maximum Number of Guests, Address, Phone Number); Table (Table_ID, Table Number, Max Seats); Dish (Dish_ID, Name, Price, Recipe, Description); Ingredient (Ingredient_ID, Name, Allergies (Yes/No)). Many-to-many relationships (1:N on both sides): Book between Customer and Table, with Number of People and Booking Date; Serve between Waiter and Table; Order between Table and Dish; Cook between Chef and Dish; Use between Dish and Ingredient. One-to-many: Has, Table (1:1) – Restaurant (1:N); Owns, Restaurant (1:1) – Owner (1:N); Manage, Chef (1:1) – Head Chef (1:N). N.B. There is only one Head Chef per Restaurant. Tables are served by more Waiters overall, but only one at a time. Dishes are cooked by more Chefs overall, but only one at a time.
Which DB technology would be the best to store the entities/rel. of the ER diagram? [you may not need all the rows of the table] (1 PT) — ENTITIES / REL. | DB TYPE | MOTIVATION
Show model answer
| ENTITIES / REL. | DB TYPE | MOTIVATION |
|---|---|---|
| Customer, Table, Waiter, Dish; Book, Serve, Order | Graph DB (Neo4j) | Many-to-many links (bookings, service, orders) traversed and counted, e.g. different dishes served at each table, customers served by each waiter; edges are stored with the data, and Book's attributes become edge properties. |
| Chef, Head Chef, Dish, Ingredient; Cook, Use, Manage | Document DB (MongoDB) | A chef is an aggregate read as one unit: the dishes they cook, each with its ingredients, nested inside (a dish cooked by several chefs is copied into each, acceptable because every query starts from the chef); Head Chef is a Chef with one more field (schema-less); the DB operates on nested values, e.g. chefs who cooked a dish named "Octopus with Potatoes". |
| Dish (Name, Description, Recipe) | Search-based DB (Elasticsearch) | Full-text conditions with ranking (description and name containing "salmon", recipes with "stir" or "boil" first): an inverted index with relevance scoring. |
Restaurant, Owner, Has and Owns are small and can be nodes and edges of the graph.
The grouping follows the paper's own later exercises: Neo4j on Customer, Table, Waiter and Dish; MongoDB on Head Chef, Chef, Dish and Ingredient; Elasticsearch on Dish (exercise 5 also puts Chef in a Cassandra table, a fourth access path the three rows need not list). Dish in two rows is expected — a node in the graph, a text document in the index. The paper writes cardinalities as 1:N, the 2025 papers as (1,N): the same pair. The examiner looks for a family per part and a motivation that names the shape of the data and of the queries.
Check yourself
The cable is cut and the ticket counter is served CP. A fan in Dublin presses Buy. What happens, and why?
During a partition, which of these operations could you serve AP — from the local copy, possibly stale? Select all that apply.
The test for AP: is a stale but timestamped answer still a true statement that nobody acts on irreversibly?
Page 196 accepts "CA" only for a single-site database. Why does CA make sense there?
An eventually consistent store: you write x = 5 and at once read x on another replica. What is guaranteed?
A key-value store and a document store both keep the JSON of user 7 under the key user:7. By the definitions of pp. 212–213, what can only the document store do?
For a sensor log written at a very high rate and always read by sensor and time, you choose a column store. Which motivation should you write in the exam table?
Why did the move "from data to services" (p. 216) make it acceptable for a database to drop the shared schema?
Key take-aways
- CAP as printed (p. 195): no distributed system provides Consistency, Availability and Partition tolerance together, "any two … but not all three". As meant (p. 196): partitions will happen, so during a partition you choose C or A; "CA doesn't make any sense" except on a single site.
- CP: a partitioned node returns a correct value if in a consistent state, a timeout or an error otherwise. AP: it returns the most recent version of the data, which could be stale — honest when versioned, "x is 5, at time T and date D".
- The trade-off is a continuous space decided per operation (p. 198), and it is felt without partitions too, as latency: consistency against performance. The 2010 triangle (p. 199) classifies whole products and is a historical map.
- BASE is Basically Available, Soft state, Eventually consistent. Eventual consistency is a liveness guarantee without safety, soft state means data that keeps changing while replicas converge, and BASE moves the consistency work to the developer; ACID fits where reliability is essential (p. 204).
- The word NoSQL first named a relational database without SQL (Strozzi, 1998) and came back in 2009 (the #nosql meetup); it is read "Not only SQL". The systems were built by Google, Amazon, Facebook and others for their own scale.
- Four families, one line each: key → payload (key-value), the DB operates on values inside (document), edges stored with the data (graph), and the column store — which p. 212 describes as column-oriented and fills with Hadoop, while Cassandra and HBase are wide-column stores. The exam adds search-based (Elasticsearch).
- Integration moved from a shared database to services, so each application can choose its family; the one-point table asks you to do exactly that, part by part, with a motivation built from data shape, question shape and the family's line.
What to watch and read
-
7 Database Paradigms
Fireship
The fastest tour of the families: one product per paradigm and the "what shape of data, what shape of query" line for each — the exact skill of the one-point table.
-
An Illustrated Proof of the CAP Theorem
Michael Whittaker
The derivation of section 1 in a handful of pictures: two servers, a partition, a write on one side, a read on the other. Read it next to the stepper.
-
CAP Twelve Years Later: How the "Rules" Have Changed
Eric Brewer, 2012
The author of the conjecture on why "2 of 3" misleads and how the choice is made many times, at fine granularity — the "operation level" of p. 198, explained at length.
-
Please stop calling databases CP or AP
Martin Kleppmann, 2015
Why the triangle of p. 199 is a simplification: what C and A mean in the theorem, and why a database such as MongoDB fits neither corner cleanly. By the author of the course textbook.
-
Polyglot Persistence
Martin Fowler, 2011
One company, several stores, each chosen for one kind of data — the step after p. 216, and the idea behind every row of the exam's "which DB technology" table.