# NoSQL

### Objectives :

* Understand what does NoSQL mean
* Understand the different kind of databases hidden behind this word

## Connection - 10'

* In pair list every Pros and Cons you have encountered with relational database
* List every relational database you have already used
* Group the answers

## Concepts - 20'

### Relational databases

* Persist data
* Concurrency control
* Manage transactions in an ACID way

### ACID

![](/files/-MRsVOKv4VVy9VD8mwOJ)

* Atomicity
  * "all or nothing"
  * One part fails => the entire transaction fails
* Consistency
  * Bring the database from one valid state to another
  * All defined rules, including constraints, cascades, triggers, and any combination are respected
* Isolation
  * Concurrent execution
    * Would be obtained if transactions were executed sequentially
* Durability
  * Transaction committed : it will remain

### Cons of relational databases

* Impedance mismatch
  * Relational data structures vs In-memory data structures
* Performance
* Distribution
* Cost

### NoSQL

![](/files/-MRsW0tO6L3-zetIjU0w)

### Different kind of NoSQL Databases

![](/files/-MRsW75xGBqkiacPMQlL)

### Why use NoSQL ?

* To improve programmer productivity : better matches an application needs&#x20;
* To improve data access performance&#x20;
  * Through some combination of handling larger data volumes, reducing latency&#x20;
* Large volumes of rapidly changing structured, semi-structured, and unstructured data
* Geographically distributed scale-out architecture&#x20;
  * Instead of expensive, monolithic architecture

## Concrete Practice - 20'

Let's play with a GraphDB call Neo4j for the next minutes :

* Connect to the [platform](https://sandbox.neo4j.com/)
* Play with the Cypher queries
* Play with the Graph Visualization

![](/files/-MRsXu6hH4Y2YYI816NK)

## Conclusion - 10'

{% hint style="success" %}
***NoSQL does not mean “Death of SQL”***
{% endhint %}

We can now create polyglot persistence :

* Uses different data storage technologies to handle varying data storage needs
* Can be applied : Anywhere in an organization/in a single application

Use the tool that fits the best your needs.

![](/files/-MRsYGMOP7oIzNpVLUdv)

### Remember the past

Think about the past few years, in which development you have made this kind of database would have been useful ?

* Why ?

### Resources

#### Key Value Stores

* Aerospike
* Apache Cassandra
* Berkeley DB
* Couchbase Server
* Redis
* Riak

#### Document DB

* CouchDB
* Elasticsearch
* MongoDB

#### Graph DB

* Neo4j
* OrientDB
* FlockDB

#### Wide Columns Family Stores

* Cassandra
* HBase


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yoan-thirion.gitbook.io/knowledge-base/software-architecture/nosql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
