Tech●●●●●Difficulty 4 of 5

Why did Amazon and Google build databases without tables?

Amazon wanted shoppers to keep filling their carts even while data centers were being flattened by tornados, and that goal rewrote the database rulebook.

▶ Start the story

Amazon and Google built databases without tables because they were willing to give up some of the strict guarantees of table-based databases to get something else. Both companies needed systems that could spread across thousands of cheap servers and keep working while parts of them broke.

Amazon's story is about shopping carts. In its Dynamo paper, Amazon explained that customers should be able to view and add items to their cart even if disks are failing, network routes are flapping or data centers are being destroyed by tornados. So Dynamo is a , little more than a giant lookup table, designed to stay available, and to get that availability it sacrifices consistency under certain failure scenarios.

Google's Bigtable, begun in 2004, was built to scale to of data across thousands of . It maps a row key, a column key and a timestamp to a value, and it is not a relational database. Google's copy of the web, for instance, can be stored with each page's reversed URL as the row key.

The designs inspired imitators, and in 2009 a developer at Last.fm called an event about open-source distributed, non-relational databases "NoSQL". Many such systems favor speed and availability over strict consistency, using , where all copies agree once updates stop arriving. They traded tables and the full guarantees of ACID for scale and uptime.

Two kinds of database

Relational (ACID)

  • Data in tables of rows and columns
  • Strict guarantees, fixed
  • Built around consistency

NoSQL (Dynamo, Bigtable)

  • Key-value, wide columns, documents or graphs
  • No fixed , scales out easily
  • Often favors availability and speed
How NoSQL took shape
  1. 1998

    Carlo Strozzi names a SQL-less relational database NoSQL

  2. 2004

    Bigtable development begins

  3. 2007

    Amazon presents the Dynamo paper

  4. 2009

    Last.fm developer revives the term NoSQL

Quiz me

0/3

  1. 1.Why did Amazon build Dynamo as a highly available key-value store?
  2. 2.What does Bigtable store, in place of rows and columns of a relational table?
  3. 3.What does eventual consistency promise?

Recap

NoSQL trades some of the strict guarantees of tables and ACID for the ability to scale out and stay available.

💡 A trick to remember it · A giant shelf with labels beats a perfect filing cabinet when the shop spans many rooms and some rooms burn down.

Surprising fact · Amazon's Dynamo was designed so shopping carts keep working even if data centers are destroyed.

Sources (6)

No source, no claim. Every fact in this lesson (16 claims) cites at least one of these.

  1. [1]Amazon's Dynamo (Werner Vogels, with the paper text) · All Things Distributed
  2. [2]Dynamo (storage system) · Wikipedia
  3. [3]Bigtable: A Distributed Storage System for Structured Data · Google Research
  4. [4]Bigtable · Wikipedia
  5. [5]NoSQL · Wikipedia
  6. [6]Eventual consistency · Wikipedia
More lessons in 💻 Tech (3) See all tech lessons →

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson ↗