+ All Categories
Home > Documents > Introduction to NoSQL - 67311.cmuis.net · Introduction to NoSQL ... Types of NoSQL databases •...

Introduction to NoSQL - 67311.cmuis.net · Introduction to NoSQL ... Types of NoSQL databases •...

Date post: 27-May-2020
Category:
Upload: others
View: 40 times
Download: 0 times
Share this document with a friend
17
Introduction to NoSQL Professor Larry Heimann Information Systems Carnegie Mellon University
Transcript

Introduction to NoSQL

Professor Larry HeimannInformation SystemsCarnegie Mellon University

Announcements

• Project phase 1

• Labs

• Thanksgiving week

Value of the relational model

Does every project need the advantages of the relational model?

Types of NoSQL databases

• Document databases pair each key with a complex data structure known as a document. Documents can contain many different key-value pairs, or key-array pairs, or even nested documents. MongoDB and CouchDB are two popular document databases.

• Graph stores are used to store information about networks, such as social connections. Graph stores include Neo4J and HyperGraphDB.

• Key-value stores are the simplest NoSQL databases. Every single item in the database is stored as an attribute name (or "key"), together with its value. Examples of key-value stores are Redis, Riak and Voldemort.

• Wide-column stores such as Cassandra and HBase are optimized for queries over large datasets, and store columns of data together, instead of rows.

A critique

ACID vs

BASE

A project with both SQL and NoSQL databases

• 19 tables in the main database

• 44 relationships between tables

• ~3 tables per query

• Results: • 300+ Seconds Loading 1000 Messages

• 31 Queries to Load Home Page

• ~2.43s Response Time

• .78-.88 Database Load

• 8 Minute Unit Tests (“create the universe” for a single test)

{ "_id":"50b3f12fa3bbccf2b4000440", "ancestry":null, "ancestry_depth":0, "created_at":"2012-11-26T22:46:07Z", "flags":["notjunk", "seen"], "full_html_part":null, "full_text_part":null, "html_part":"...", "labels":[...], "mailbox_id":"50b3f0d9a3bbcc6091000005", “message_id”:”[email protected]", "participants":[...], "raw":"...", "timestamp":"2012-11-26T22:41:21+00:00", "uid":7694, "updated_at":"2012-11-27T00:40:57Z" }

Why MongoDB? • JSON (BSON)

• Fast Dumps

• No Serialization

• Iterative

• No Migrations

• Document Orientated

• Natural Fit

• 6 collections

• 4 relationships between collections

• 1 collection per query

• Results: • ~8 Seconds Loading 1000 Messages (~40 Seconds w/ Attachments)

• 2 Queries to Load Home Page

• ~0.81s Response Time

• .13-.17 Database Load

• 11 Second Unit Tests

MongoDB Terminology

• Database

• Collection • like tables in RDBMS • key difference: no schema

• Documents • like records in RDBMS • { key: value} format


Recommended