Intro to NoSQL Databases

Slides:



Advertisements
Similar presentations
Relational Database Alternatives NoSQL. Choosing A Data Model Relational database underpin legacy applications and meet business needs However, companies.
Advertisements

Introduction to Backend James Kahng. Install Node.js.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
10/15/20151 XML. 10/15/20152 Mark-up Languages Digitalizing information Content Format SGML HTML XML RDF OWL …
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
JSON and A Comparison of Scripts. JSON: JavaScript Object Notation Based on a subset of the JavaScript Programming Language provides a standardized data.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
Some notes on NoSQL, in particular MongoDB Bettina Berendt (with thanks to Matthijs van Leeuwen for some of the slides) 8 December 2015.
AJAX. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
JSON. JSON as an XML Alternative JSON is a light-weight alternative to XML for data- interchange JSON = JavaScript Object Notation It’s really language.
MYSQL AND MYSQL WORKBENCH MIS2502 Data Analytics.
XSEDE GLUE2 Update 1. Current XSEDE Usage Using legacy TeraGrid information services Publishing compute information about clusters – Subset of XSEDE clusters.
Introduction to Mongo DB(NO SQL data Base)
The Fat-Free Alternative to XML
Creating Databases for Web applications
Neo4j: GRAPH DATABASE 27 March, 2017
PDO Database Connections
NO SQL for SQL DBA Dilip Nayak & Dan Hess.
CSE 775 – Distributed Objects Bekir Turkkan & Habib Kaya
The Fat-Free Alternative to XML
CS122B: Projects in Databases and Web Applications Winter 2017
MongoDB Er. Shiva K. Shrestha ME Computer, NCIT
Arrays: Checkboxes and Textareas
Modern Databases NoSQL and NewSQL
mysql and mysql workbench
CMPE 280 Web UI Design and Development October 17 Class Meeting
Database Systems Week 12 by Zohaib Jan.
CS1222 Using Relational Databases and SQL
Twitter & NoSQL Integration with MVC4 Web API
PHP / MySQL Introduction
NOSQL databases and Big Data Storage Systems
Intro to PHP & Variables
Databases.
What is a Database and Why Use One?
ISC440: Web Programming 2 Server-side Scripting PHP 3
1 Demand of your DB is changing Presented By: Ashwani Kumar
What is database? Types and Examples
Part of the Multilingual Web-LT Program
Built in Fairfield County: Front End Developers Meetup
CS1222 Using Relational Databases and SQL
Teaching slides Chapter 8.
Non-traditional Databases
Intro to NoSQL Databases
Lecture 1: Multi-tier Architecture Overview
Microsoft Office WORD - TABLES.
A JSON’s Journey through SQL Server
NoSQL Databases Antonino Virgillito.
Overview of big data tools
JSON Data Demo.
Intro to NoSQL Databases
JSON for the Data Mortal
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
PostgreSQL as a Document Storage for .NET applications
Lecture 3 Finishing SQL
relational thoughts on NoSql
CS1222 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
Document Structure & HTML
Introduction to World Wide Web
CS 240 – Advanced Programming Concepts
HyperText Markup Language
CMPE 280 Web UI Design and Development March 14 Class Meeting
PHP Forms and Databases.
Introduction to AJAX and JSON
CS1222 Using Relational Databases and SQL
MIS2502: Data Analytics Semi-structured Data Analytics
NoSQL databases An introduction and comparison between Mongodb and Mysql document store.
Intro to NoSQL Databases
CS1222 Using Relational Databases and SQL
Presentation transcript:

Intro to NoSQL Databases

Introduction NoSQL database by definition is "next generation" type of database mostly addressing some points: non-relational, distributed, open source and horizontally scalable. We will be focusing on the MongoDB specifically based on its popularity in past few years.

Why NoSQL? Small to medium size company, like the company I work with, often uses MongoDB as the starting point of micro services. Why? When building modern web application now, it's often that business requirement changes in between development cycle and even change in a day or two. MongoDB databases is designed to help with rapidly changing data types.

Why NoSQL (cont) MongoDB is only within a type of NoSQL database, specifically under document model database. For the class purposes, we will not address other types of databases. Do not assume that NoSQL = MongoDB. This is wrong http://nosql-database.org/

Why NoSQL (cont) Relational databases were created in the 1970s NoSQL: Not designed to cope with scale/changing environments that we see today. Processing data has changed over time. NoSQL: Able to handle new software design paradigms such as Agile development 2-week sprints vs waterfall Ever changing requirements Able to be distributed in the cloud easily Able to handle structured, semi-structured, unstructured, and polymorphic data

MongoDB Document model databases like MongoDB stores the data in documents. And these documents typically use a structure like JSON. This format is very close to how modern webapps are structured. For example, to store data that will only be used by the front-end, simply store whatever data the client side passes without any sort of schema definition from the backend. Note that the above example can prove to be risky, as you are trusting that the client will not manipulate the client database. Always try to validate data in the backend!

MongoDB (cont) Furthermore, in document storage, the notion of schema is very flexible: each document can contain different fields. This flexibility is helpful for modeling unstructured data. Makes the development easier to evolve application in the development cycle, such as adding new fields. In short, document model databases are for general purpose and useful for wide variety of applications due to the flexibility of the data modeling -- which we will see in the following lectures. You can read more on the comparison between NoSQL and Relational databases here -- https://www.mongodb.com/nosql-explained

JSON data So far, we have been learning how to represent data in more like a tabular format (like sql tables). In upcoming lessons, we will not be using tabular format anymore. Instead we will be using JSON to represent data.

JSON JSON is short for JavaScript Object Notation A way to store information in an organized, easy-to-access-manner When exchanging data between a browser and a server, the data can only be text. JSON is text, and we can convert any JavaScript object into JSON, and send JSON to the server. We can also convert any JSON received from the server into JavaScript objects. This way we can work with the data as JavaScript objects, with no complicated parsing and translations.

Why JSON? Important to have data that doesn’t need to have a strict structure JSON is able to be loaded quickly and asynchronously JSON parsers are everywhere It is not XML

JSON data JSON contain a few concepts: {} indicates an object like skills or the entire object [] indicates an list like students can contain String like name can contain numbers like gpa can nest as many levels you want and as many attributes as you want

JSON data Example: { "name": ”Randy", "gpa": 3.9, "students": [ "Alice", "Bob", "Eve" ] "skills": { "mysql": "good", "nosql": "good", "javascript": "very good" }

JSON – Detailed Breakdown Key value pairs "key" : "value” Keys are on the left side of the colon Wrapped in double quotation marks Within each object, keys need to be unique Values are found to the right of the colon Datatypes: strings, numbers, objects, arrays, Booleans, null You can have nested objects and arrays { "users": [ {"username" : "SammyShark", "location" : "Indian Ocean"}, {"username" : "JesseOctopus", "location" : "Pacific Ocean"}, {"username" : "DrewSquid", "location" : "Atlantic Ocean"}, {"username" : "JamieMantisShrimp", "location" : "Pacific Ocean"} ] }

JSON data JSON has been the most popular format of passing data from the front-end to back-end! And because of this, NoSQL database arise! NoSQL database store the data in mostly JSON format (as we will see later in the MongoDB). MySQL recently also add the support to store JSON data (see https://dev.mysql.com/doc/refman/5.7/en/json.html)