Topics. History. Architecture. MongoDB, Mongoose - RDBMS - SQL. - NoSQL

Similar documents
DATABASES SQL INFOTEK SOLUTIONS TEAM

Storage Tier. Mendel Rosenblum. CS142 Lecture Notes - Database.js

Introduction to Big Data. NoSQL Databases. Instituto Politécnico de Tomar. Ricardo Campos

Relational databases

Database Availability and Integrity in NoSQL. Fahri Firdausillah [M ]

NoSQL Databases Analysis

CSE Database Management Systems. York University. Parke Godfrey. Winter CSE-4411M Database Management Systems Godfrey p.

Jargons, Concepts, Scope and Systems. Key Value Stores, Document Stores, Extensible Record Stores. Overview of different scalable relational systems

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1

Introduction. Example Databases

MongoDB and Mysql: Which one is a better fit for me? Room 204-2:20PM-3:10PM

CIB Session 12th NoSQL Databases Structures

Migrating Oracle Databases To Cassandra

Introduction Aggregate data model Distribution Models Consistency Map-Reduce Types of NoSQL Databases

NOSQL EGCO321 DATABASE SYSTEMS KANAT POOLSAWASD DEPARTMENT OF COMPUTER ENGINEERING MAHIDOL UNIVERSITY

Big Data Technology Ecosystem. Mark Burnette Pentaho Director Sales Engineering, Hitachi Vantara

Overview of Data Management

Databases. Jörg Endrullis. VU University Amsterdam

Overview of Data Management

Introduction to NoSQL

Introduction. Who wants to study databases?

MIS Database Systems.

BIS Database Management Systems.

Database Evolution. DB NoSQL Linked Open Data. L. Vigliano

NoSQL systems. Lecture 21 (optional) Instructor: Sudeepa Roy. CompSci 516 Data Intensive Computing Systems

Introduction to NoSQL Databases

Final Exam Review 2. Kathleen Durant CS 3200 Northeastern University Lecture 23

Distributed Databases: SQL vs NoSQL

Data! CS 133: Databases. Goals for Today. So, what is a database? What is a database anyway? From the textbook:

Essential Skills - RDBMS and SQL

Distributed Non-Relational Databases. Pelle Jakovits

CGS 3066: Spring 2017 SQL Reference

MongoDB Web Architecture

Document stores using CouchDB

What is database? Types and Examples

Chapter 8: Working With Databases & Tables

Chapter 24 NOSQL Databases and Big Data Storage Systems

NoSQL Databases. Amir H. Payberah. Swedish Institute of Computer Science. April 10, 2014

Cassandra, MongoDB, and HBase. Cassandra, MongoDB, and HBase. I have chosen these three due to their recent

Making MongoDB Accessible to All. Brody Messmer Product Owner DataDirect On-Premise Drivers Progress Software

CS 445 Introduction to Database Systems

Outline. Database Management Systems (DBMS) Database Management and Organization. IT420: Database Management and Organization

Introduction. Course Overview Evolution and History of Database Management Systems Requirements of Object-Oriented Database Management Systems

Course Content MongoDB

Outline. Lecture 10: Database Connectivity -JDBC. Java Persistence. Persistence via Database

Administration Naive DBMS CMPT 454 Topics. John Edgar 2

10/18/2017. Announcements. NoSQL Motivation. NoSQL. Serverless Architecture. What is the Problem? Database Systems CSE 414

A Survey Paper on NoSQL Databases: Key-Value Data Stores and Document Stores

What is a Database? Peter Wood

CompSci 516 Database Systems

Overview. * Some History. * What is NoSQL? * Why NoSQL? * RDBMS vs NoSQL. * NoSQL Taxonomy. *TowardsNewSQL

Non-Relational Databases. Pelle Jakovits

Database Architectures

MongoDB Schema Design

Advanced Programming Techniques. Database Systems. Christopher Moretti

Database Fundamentals

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016

Realtime visitor analysis with Couchbase and Elasticsearch

DATABASE SCALE WITHOUT LIMITS ON AWS

NoSQL Databases. CPS352: Database Systems. Simon Miner Gordon College Last Revised: 4/22/15

Scaling for Humongous amounts of data with MongoDB

Goal of the presentation is to give an introduction of NoSQL databases, why they are there.

Kim Greene - Introduction

Study of NoSQL Database Along With Security Comparison

Oral Questions and Answers (DBMS LAB) Questions & Answers- DBMS

CS425 Fall 2016 Boris Glavic Chapter 1: Introduction

IEMS 5722 Mobile Network Programming and Distributed Server Architecture

CMPE 131 Software Engineering. Database Introduction

Introduction to MySQL Cluster: Architecture and Use

Standard stuff. Class webpage: cs.rhodes.edu/db Textbook: get it somewhere; used is fine. Prerequisite: CS 241 Coursework:

Transactions and ACID

MongoDB An Overview. 21-Oct Socrates

Final Exam Logistics. CS 133: Databases. Goals for Today. Some References Used. Final exam take-home. Same resources as midterm

Relational databases and SQL

Database Fundamentals Chapter 1

DATABASE MANAGEMENT SYSTEMS. UNIT I Introduction to Database Systems

5/2/16. Announcements. NoSQL Motivation. The New Hipster: NoSQL. Serverless. What is the Problem? Database Systems CSE 414

NoSQL Databases MongoDB vs Cassandra. Kenny Huynh, Andre Chik, Kevin Vu

Hands-on immersion on Big Data tools

Database Systems CSE 414

Databases : Lectures 11 and 12: Beyond ACID/Relational databases Timothy G. Griffin Lent Term 2013

Distributed Systems. Characteristics of Distributed Systems. Lecture Notes 1 Basic Concepts. Operating Systems. Anand Tripathi

Distributed Systems. Characteristics of Distributed Systems. Characteristics of Distributed Systems. Goals in Distributed System Designs

Evolution of Database Systems

relational Key-value Graph Object Document

John Edgar 2

Integrating Oracle Databases with NoSQL Databases for Linux on IBM LinuxONE and z System Servers

File Processing Approaches

Chapter 1: Introduction

DATABASE TRANSACTIONS. CS121: Relational Databases Fall 2017 Lecture 25

AN introduction to nosql databases

Database Solution in Cloud Computing

CAS CS 460/660 Introduction to Database Systems. Fall

Data, Information, and Databases

NOSQL DATABASE SYSTEMS: DECISION GUIDANCE AND TRENDS. Big Data Technologies: NoSQL DBMS (Decision Guidance) - SoSe

Introduction to Data Management CSE 344

Database Systems CSE 414

Storing data in databases

CS143: Relational Model

SQL. Dean Williamson, Ph.D. Assistant Vice President Institutional Research, Effectiveness, Analysis & Accreditation Prairie View A&M University

Transcription:

Databases

Topics History - RDBMS - SQL Architecture - SQL - NoSQL MongoDB, Mongoose

Persistent Data Storage What features do we want in a persistent data storage system? We have been using text files to store our data for example in class. What is wrong with them?

Access methods? - sequential, indexed, random Sharing granularity? Data consistency? Scalability Security?

Hierarchical and Network Hierarchical: Data Models (1960s) - Upside down tree with one-to-many relationship between parent and child records - Efficient searching, data independence, security, integrity - Complex, lack of standards Network - Directed Acyclic graph - Each record can have multiple parents (one-to-many) - Main problem: complexity

Relational Databases Relational Database Management System (RDBMS) - First published by Edgar F. Codd in 1970 (Turing Award in 1981) - Jim Gray known for his work on IBM s System R, a precursor to SQL (Turing Award 1998) - Donald D. Chamberlin and Raymond F. Boyce created SEQUEL (Structured English Query Language). Later changed to SQL.

Relational Database A collection of tables with rows and columns Each row represents a record Each column represents an attribute of the records contained in the table

A recreational sports system has the following relationships: a player can be on many teams a team can have many players a team is in exactly one league a league has many leagues The relationships between the Player, Team, and League entities: Many-to-many relationship between Player and Team Many-to-one relationship between Team and League TEAM_PLAYER PLAYER_ID f TEAM_ID Primary key Foreign key PLAYER ID f NAME POSITION TEAM ID f CITY LEAGUE_ID LEAGUE ID f NAME SPORT

Why use an RDBMS? Data safety: Data is immune to program crashes. Concurrent access: Atomic access/updates. Fault tolerance: Replicated databases for instant failover on machine/disk. Data integrity: Aids to keep data meaningful. Scalability: Can handle small/large quantities of data in a uniform manner. Reporting: Easy to write SQL programs to generate arbitrary reports.

ACID Atomic - All operations in a transaction complete, or none do. Consistent - On completion of transaction, database is sound - Constraints of the database are applied and database is in a valid state Isolated - transactions don t interfere with each other Durability - results of a transaction are permanent even in the case of failures

Most RDBMs are accessed/managed using SQL, a special purpose programming language. Data definition, manipulation, and controls. Insert, query, update, delete. Schema creation and modification.

Examples SQLite MySQL PostgreSQL Access Microsoft SQL Server

Structured Query Language Standard for accessing relational database - Very cool theory behind it: relational algebra Queries - Lots of ways to extract information - You specify what you want - The database system figures out how to get it efficiently - Refer to data by contents, not just name

SQL Example Commands CREATE TABLE Users ( id INT AUTO_INCREMENT, first_name VARCHAR(30), last_name VARCHAR(30), location VARCHAR(30)); INSERT INTO Users ( first_name, last_name, location) VALUES ( Emma, Swan, Storybrook ); DELETE FROM Users WHERE last_name= Swan ; UPDATE Users SET location = New York WHERE id = 2; SELECT * FROM Users; SELECT * FROM Users WHERE id = 2;

Keys and Indexes Consider a model fetch: SELECT * FROM Users WHERE id = 2; Database could implement this by: Scan the Users table and return all rows with id = 2 Have built an index that maps id numbers to table rows. Index: Selected columns of a database optimized for searching Uses keys to tell database that building an index would be a good idea

Keys Primary key: Organize data around accesses. - Uniquely identifies a row in the table. Secondary key: Other columns that are have unique values Foreign key: The primary key defined in another table.

Schemas Schemas define the structure of the database - tables, columns indexes Schema needs to be defined before you can add data Not a great match with agile development approaches, because each new feature may require a schema change. - Database migrations allow incremental changes NoSQL databases are built to allow the insertion of data without a predefined schema.

Object Relational Mapping Writing lots of raw SQL queries isn t much fun Still need to map data from the database to objects in the application 2nd generation frameworks (Rails, Django) handled mapping of objects to SQL db Rails Active Record - Objects map to database records - One class for each table in the database (Models) - Objects of the class correspond to rows in the table - Attributes of an object correspond to columns from the row Handle all the schema creation and SQL commands behind the object interface

NoSQL NoSQL databases do not use the relational model or SQL - Flexible schema - Quicker/cheaper to set up - Scalability - No declarative query language -> more programming - Relaxed consistency -> higher performance and availability - Relaxed consistency -> fewer guarantees

Document types apply a key to a document with a complex data structure Documents can contain many different key-value pairs, or key-array pairs, or even nested documents Use standard data format, e.g. JSON, XML Can be organized by collection, tag, etc.

Graph Databases Graph types store information about networks (nodes with connections), such as social connection and road maps - Connections are NOT ad hoc; this means performance improvements - Semantic queries Examples: neo4j, MarkLogic, OpenCog

Key-value Databases Key-value types are simplest NoSQL databases. Every item in the database is stored as an attribute name ( key ) together with its value Examples: cassandra, Couchbase

NoSQL Using SQL databases provided reliable storage for early web applications Led to NoSQL databases that matched web application object model MongoDB - Most prominent - Data model: Stores collections containing documents - Dynamic schemas -rather than predefined structure - Has expressive query language - Can use indexes for fast lookups - Tries to handle scalability, reliability, etc. - Caching: mostly in RAM

NoSQL vs Relational Relational databases usually scale vertically: a single system server hosts the entire database. - If eventual consistency is okay then more aggressive replication (and scaling) is possible NoSQL databases usually support auto-sharding: natively and automatically storing data across an arbitrary number of servers.

NoSQL vs Relational NoSQL databases also support automatic replication: high availability and disaster recovery without involving separate applications to manage these tasks. Many NoSQL database technologies have excellent integrated caching capabilities, keeping frequently-used data in system memory and removing the need for a separate caching layer.

CRUD Create, Read, Update, Delete Simpler access model than SQL

MongoDB MongoDB is an open-source, NoSQL database that uses a JSON-like (BSON) document-oriented model. Data is stored in collections (rather than tables). - Uses dynamic schemas rather than a predefined structure. Fields can be added/removed at will. - Works with many programming languages. - Caching: Most recent kept in RAM. - No transactions, but allows atomic operations.

MongoDB Document { name: 'Kate Monster, ssn: '123-456-7890', addresses : [ { street: '123 Sesame St', city: 'Anytown', cc: 'USA' }, { street: '123 Avenue Q', city: 'New York', cc: 'USA' } ] }

Next MongoDB and Mongoose examples Web application architectures.