Skip to content

Latest commit

 

History

History
49 lines (43 loc) · 1.5 KB

0212.md

File metadata and controls

49 lines (43 loc) · 1.5 KB

Documenting Your Data

NoSQL Databases

  • Non table-based (relational) databases
  • Relational datbase (perhaps not SQL based) are most commonly used, but NoSQL have become more popular with the advancement of 21st century web applications and big data

Examples

  • Key-value: Database is essentially a large dictionary
  • Graph: Database is stored as a graph, where relationships between the data nodes are essential to the database schema
  • Document: Database is a collection of documents, which can contain various amounts and types of data

Document Databases

  • A single record in the document database is a document
  • Documents contain fields and values (like a dictionary)
  • You do not need to specify types for the values
  • A group of documents is put into a collection
  • Documents do not need to be stored on the same storage device
  • MongoDB is a popular document database

MongoDB Example

{
    "_id" : ObjectId("54c955492b7c8eb21818bd09"),
    "address" : {
        "street" : "2 Avenue",
        "zipcode" : "10075",
        "building" : "1480",
        "coord" : [ -73.9557413, 40.7720266 ]
    },
    "borough" : "Manhattan",
    "cuisine" : "Italian",
    "grades" : [
        {
            "date" : ISODate("2014-10-01T00:00:00Z"),
            "grade" : "A",
            "score" : 11
        },
        {
            "date" : ISODate("2014-01-16T00:00:00Z"),
            "grade" : "B",
            "score" : 17
        }
    ],
    "name" : "Vella",
    "restaurant_id" : "41704620"
}