13

As per DynamoDB's documentation it supports both key-value and document-oriented properties of NoSQL even though other NoSQL databases fall only under only one type either Key-Value or Document or Graph or Column-oriented

Also it says

Amazon DynamoDB is "built on the principles of Dynamo"[3] and is a hosted service within the AWS infrastructure. However, while Dynamo is based on leaderless replication, DynamoDB uses single-leader replication.

And Dynamo is

A set of techniques that together can form a highly available key-value structured storage system[1] or a distributed data store

So when DynamoDB is built on the principles of Dynamo which is not related to Document-oriented storage system and since it is mandatory for a developer to create a primary key and the table requires key for every item how and in what sense DynamoDB is called a Document-oriented database ?

Can a DB fall under two types of NoSQL databases in the first place ?

JKC
  • 2,498
  • 6
  • 30
  • 56

1 Answers1

19

First, it is important to realize that "Dynamo" was an earlier nosql database designed by Amazon, and its design was made public in 2007 (e.g., see https://www.allthingsdistributed.com/2007/10/amazons_dynamo.html). Other people later took this design, and other contemporary designs (like Google's BigTable) and improved on them, resulting in projects such as Cassandra (2008). Amazon's DynamoDB was only released in 2012, based on many ideas from those other systems (and especially Cassandra) and had very little in common with the original "Dynamo". So almost anything you can say about the original "Dynamo" would not be relevant when you discuss the modern DynamoDB.

Now regarding your main question:

A key-value store holds for each key a single value. Arguably, if the value can be an entire document, you can call this database a "document store". In this sense, DynamoDB is a document store. The DynamoDB API lets you conveniently store a JSON document as the value, and also read or writes part of this document directly instead of reading or writing the entire document (although, you actually pay for reading and writing the entire document).

You should note that DynamoDB, like Cassandra and BigTable (and unlike the original "Dynamo") actually gives you more than that: Each so-called "partition key" can hold not just one value (or document), but a sorted list of such values. I mentioned this interesting feature, which I don't know how to call, in my question How do you call the data model of DynamoDB and Cassandra?

Nadav Har'El
  • 11,785
  • 1
  • 24
  • 45
  • Makes sense. Thanks @Nadav – JKC May 25 '21 at 09:44
  • @JKC one thing to add here is that even though DynamodDB is technically a document store, it stores that document as a blob so you lose all data typing and need to reconcile that from the application. A true document store like MongoDB has that native support and would recommend that 10 times out of 10. – Jay Feb 16 '23 at 17:47