NoSQL​

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

http://rockalabs.com

xergioalex

SERGIO A. FLOREZ

TECH LEAD

LET'S BUILD TOGETHER

SQL (1979)

Optimize the storage cost

LET'S BUILD TOGETHER

Rows Stores (RDBMS)

* Store data aligned by rows

* Reads retrieve a complete row every time

Why NoSQL

LET'S BUILD TOGETHER

The world has Changed

Origin of #NoSQL (2009)

LET'S BUILD TOGETHER

Google and Amazon develop new systems to storage data.

* Distributed systems

* Open Source

* Non relational

NoSQL

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

Types of NoSQL Databases

* Key/Value Stores

* Column Stores

LET'S BUILD TOGETHER

* Multi-model Databases (Combine relational + non relational DBs)

* Document Stores

* Graph Stores

Types of NoSQL Databases

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

Install MongoDB

$ echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

Ubuntu

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
$ sudo apt-get update
$ sudo apt-get install -y mongodb-org

LET'S BUILD TOGETHER

MongoDB Package Components

Core Processes

* Mongod

* Mongos

* Mongo

Binary Import and Export Tools

Data Import and Export Tools

Diagnostic Tools

GridFS

LET'S BUILD TOGETHER

Shell interface && Database commands

$ mongo
$ show databases
$ use rockalabs
$ db.users.insert({ nombre: "Sergio", apellido: "Florez")
$ db.users.findOne()
$ db.users.find()
$ db.users.find().pretty()

$ db.users.createIndex({ nombre: 1 })

$ show collections

$ db.users.dropIndex({ "username": 1 })
$ db.users.getIndexes()

$ mongostats

LET'S BUILD TOGETHER

Query Plan Execution Stages

* COLLSCAN: for a collection scan
* IXSCAN: for scanning index keys
* FETCH: for retrieving documents
* SHARD_MERGE: for merging results from shards

$ db.users.find().explain()
$ db.users.find({ nombre: "Sergio" }).explain("executionStats")

LET'S BUILD TOGETHER

MongoDB UI Interfaces

Visually explore your data
Visually explore your data

LET'S BUILD TOGETHER

Packages to use:

* faker

LET'S BUILD TOGETHER

Resources​

LET'S BUILD TOGETHER

http://rockalabs.com

xergioalex

SERGIO A. FLOREZ

TECH LEAD

NoSQL y MongoDB

By Sergio Alexander Florez Galeano

NoSQL y MongoDB

Building simple app using Meteor Js.

  • 1,824