Busy Developer's Guide to NoSQL

ted@tedneward.com | Blog: http://blogs.tedneward.com | Twitter: tedneward | Github: tedneward | LinkedIn: tedneward

Objectives

What are we here to talk about today?

Introduction to Databases

From zero to...

Introduction to Databases

What is a Database?

Introduction to Databases

What is a Database?

Introduction to Databases

What is a Database?

Introduction to Databases

What is a Database Management System (DBMS)?

Introduction to Databases

Examples

Introduction to Databases

What comprises a DBMS?

Introduction to Databases

What comprises a DBMS?

Introduction to Databases

Database System Architecture

Introduction to Databases

Database System Architecture (Take 2)

Introduction to Databases

Distributed System Layer

Introduction to Databases

Query Engine

Introduction to Databases

Execution Engine

Introduction to Databases

Storage Engine

Introduction to Databases

Some interesting notes

Introduction to Databases

What is a database?

Introduction to Databases

Terms/Glossary

Data models

The 'shape' of data

Data models

Definition

Data models

What is a data model?

Data models

Different "shapes" of data

Data models

Different "shapes"

Data models

Different "shapes"

Data models

Database vs Language "shapes"

Data Models: Relational

What does that mean?

Data Models: Relational

Relational Model

CAP Theorem

What was wrong with the RDBMS, anyway?

CAP Theorem

Pre-Web

CAP Theorem

Pre-Web

CAP Theorem

The Web

CAP Theorem

Load/scale and contention

CAP Theorem

The Result: Bad

CAP Theorem

The Solution (sort of)

CAP Theorem

Practical

CAP Theorem

CAP begat PACELC

Data Models: Document-Oriented Data

What does that mean?

Data Models: Document-Oriented Data

What is a Document-Oriented Data Model?

Data Models: Document-Oriented Data

What is a document?

Data Models: Document-Oriented Data

Advantages

Data Models: Document-Oriented Data

Disadvantages

Data Models: Document-Oriented Data

Canonical Doc-Oriented examples

Data Models: Columnar Data

What does that mean?

Data Models: Columnar Data

What is an columnar data model?

Data Models: Columnar Data

"Duplicated data?!?"

Data Models: Columnar Data

Creating/storing/updating

Data Models: Columnar Data

Queries

Data Models: Columnar Data

Advantages

Data Models: Columnar Data

Disadvantages

Data Models: Graph-Oriented Data

What does that mean?

Data Models: Graph-Oriented Data

What is a graph-oriented data model?

Data Models: Graph-Oriented Data

Advantages

Data Models: Graph-Oriented Data

Disadvantages

Data Models: Graph-Oriented Data

Examples

Data Models: Object-Oriented Data

What does that mean?

Data Models: Object-Oriented Data

What is an object-oriented data model?

Data Models: Object-Oriented Data

Creating, storing objects

Data Models: Object-Oriented Data

Querying objects

Data Models: Object-Oriented Data

Advantages

Data Models: Object-Oriented Data

Disadvantages

Data Models: Object-Oriented Data

Examples

Data Models: Key/Value

... and distributed hashtables

Data Models: Key/Value

What is it?

Data Models: Key/Value

Advantages

Data Models: Key/Value

Disadvantages

Data Models: Key/Value

Examples

Data Models: Multimodel

When you can't choose just one

Data Models: Multimodel

What is it?

Data Models: Multimodel

Shhhh....

Practice

In theory, there's no difference|between theory and practice|In practice, however.... --(various)

Practice

Databases

SQLite

What it is, what it isn't

Overview

A small-footprint full-featured RDBMS

SQLite: Getting Started

Getting it, getting in

SQLite: Getting Started

SQLite may already be installed

SQLite: Getting Started

Installing: macOS

SQLite: Getting Started

Installing: Linux

SQLite: Getting Started

Installing: Windows

SQLite: Getting Started

Test Again

SQLite: Getting Started

SQLite GUIs

Neo4J

Graph-oriented

Neo4J

Neo4J: graph-oriented

Getting Started w/Neo4J

From 0 to HelloWorld

Getting Started w/Neo4J

Installing Neo4J

Getting Started w/Neo4J

Starting up

Getting Started w/Neo4J

Browser Editor (aka Editor)

Getting Started w/Neo4J

Initial databases

Couchbase Overview

NoSQL meets SQL

Couchbase Overview

Couchbase Server

Getting Started with Couchbase

From zero to queries

Getting Started with Couchbase

Installation

Getting Started with Couchbase

Docker download/run

docker run -t --name db -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 couchbase/server:enterprise-7.2.0

Getting Started with Couchbase

Impatient?

Getting Started with Couchbase

SQL++ queries

Getting Started with Couchbase

Query syntax

SELECT name FROM `gamesim-sample`;

Returns 586 elements in a JSON array

SELECT jsonType FROM 'gamesim-sample';

Returns 586 elements, all of which are either "player", "item", or "monster"

MongoDB

Document-oriented

MongoDB

What is it?

Getting Started with MongoDB

0 to HelloWorld in ...

Getting Started with MongoDB

Installing

Getting Started with MongoDB

Local installation configuration

Getting Started with MongoDB

Configuration file example

storage:
   dbPath: ./data
security:
   authorization: disabled

Getting Started with MongoDB

Cloud

Getting Started with MongoDB

Client

Installing

Connect to a running server with the mongo client -- client uses JavaScript and JSON

Current Mongosh Log ID:	644f441765e9cf735506f318
Connecting to:		mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.8.1
Using MongoDB:		6.0.5
Using Mongosh:		1.8.1

For mongosh info see: https://docs.mongodb.com/mongodb-shell/

test> show databases
admin   40.00 KiB
config  84.00 KiB
local   40.00 KiB
test> 

Getting Started with MongoDB

Drivers

Wrapping up

What have you learned?

Summary

This is obviously a high-level view

Credentials

Who is this guy?