#nosql introduction

34
#NoSQL introduction 20-06-2013

Transcript of #nosql introduction

#NoSQL introduction

20-06-2013

Relational databases

1980 - now Transactions

ACID properties

Integration mechanism?

Weak points?

http://trnl.me/decks/01.10.12_mongodb_meetup_8/#9

http://smist08.files.wordpress.com/2012/01/nosql.png

Not using relational model

Running well on cluster

Open-source

Built for the 21st century web estates

Schemaless

Aggregate data modeling

"Aggregate is a cluster of associated objects that we treat as a unit for the purpose of data changes."

Eric Evans Domain driven design (2003)

{ "relatie": "A", "startDatum": "2013-06-20 10:00", "eindDatum": "2013-06-21 10:00", "type": { "omschrijving": "voorinspectie", "is_adhoc": false }, "opdracht": { "omschrijving": "Voorinspectie woning 20-06-2013" }, "objecten": [ { "omschrijving": "woonhuis", "bouwjaar": 2000, "objecten": [ { "omschrijving": "beneden verdieping" }, { "omschrijving": "1e verdieping" }, { "omschrijving": "2e verdieping" } ] } ]}

Aggregate oriented databases:● Key-value store● Document store● Column family store

Aggregate ignorant databases:● Graph databases

Distribution models

Sharding

Replication ( Master-slave , Peer-to-peer )

Sharding + replication

http://trnl.me/decks/01.10.12_mongodb_meetup_8/#24

MapReduce

Type : AantalMap

Voorinspectie : 1Voorinspectie : 1Eindinspectie : 1Eindinspectie : 1

=

"Calculate the amount of inspections per type"

Voorinspectie : 1Voorinspectie : 1Eindinspectie : 1Eindinspectie : 1

Voorinspectie : 2Eindinspectie : 2

Reduce

Demo's

Riak

● Key-value store● Production support by Basho● Text, images, JSON, XML

Use cases:● Session data● User preferences● Shopping cart data

MongoDB

● Document store● Production support by 10Gen● XML, JSON, BSON● Hierarchical tree data structure

Use cases:● Event logging● Blog platforms● Realtime analytics● E-commerce applications

Cassandra

● Column family store● Production support by DataStax

Use cases:● Event logging● Blogging platforms● Counters● Expiry usage

Neo4J

● Graph database● Property graph (node, edges)● ACID properties

Use cases:● Connected data● Recommendation engines

Java frameworks

● Hibernate OGM● Spring Data

NoSQL versus SQL

Pro:● Horizontal scalability● Stores any data● High write or read throughput

Cons:● Only stores data, no reporting or aggregation● Eventually consistent

Related work

● Search engines, like ElasticSearch and Solr● Blob / Object stores, like Ceph, OpenStack

Swift● Analytics, like Hadoop, Storm

Use cases @Flusso

● Common solution to store large amounts of documents and images. Known issue in several projects.

● Manage state between mobile apps and backend in aggregate store.

Summary

● Value of relational databases● Two pitfalls:

○ Scalability○ Mismatch OO and relation model

● NoSQL databases○ Different modeling○ Distribution models○ CAP instead of ACID○ 4 Types: Key-Value, Document, Column-Family,

Graph● Demo's

Questions?

Thanks!@jethrobakker

[email protected]

Sources