48
Jonathan Weiss Peritor GmbH NSQL Data-Storage jenseits von SQL

NoSQL - Motivation and Overview

Embed Size (px)

DESCRIPTION

Introduction to NoSQL, Redis and CouchDB presented by Jonathan Weiss at BarCampRuhr4

Citation preview

Page 1: NoSQL - Motivation and Overview

Jonathan WeissPeritor GmbH

N✮SQLData-Storage jenseits von SQL

Page 2: NoSQL - Motivation and Overview

Wer?

Ruby-Entwickler

Open-Source-Contributor (http://github.com/jweiss)

@jweiss

2

Page 3: NoSQL - Motivation and Overview

N✮SQL-Datenbanken?

3

Built for the Web

Skalierbar

Performant

Flexibles Datenschema

Page 4: NoSQL - Motivation and Overview

4

DynamoCouchDBDynomite

Tokyo Tyrant

MongoDB

Riak

Amazon SimpleDB

Redis Memcached

BigTableAmazon S3

Cassandra

Lotus Notes

Excel ;)Neo4j

Project Voldemort HBase

Page 5: NoSQL - Motivation and Overview

Der Status-Quo

Relationale Datenstrukturen

SQL

Transaktionssicherheit

Locking

5

Page 6: NoSQL - Motivation and Overview

Das Problem

6

Page 7: NoSQL - Motivation and Overview

Das Problem

7

Page 8: NoSQL - Motivation and Overview

Die Lösung

8

”Simplicity is prerequisite for reliability“— Edsger W. Dijkstra

Page 9: NoSQL - Motivation and Overview

Die Lösung

key => “value”

9

Page 10: NoSQL - Motivation and Overview

Dokumente

10

Page 11: NoSQL - Motivation and Overview

Integrität

11

Page 12: NoSQL - Motivation and Overview

Eventual Consistency

12

Page 13: NoSQL - Motivation and Overview

Append-Only

13

Page 14: NoSQL - Motivation and Overview

Append-Only

14

Update

Page 15: NoSQL - Motivation and Overview

Append-Only

15

Update

Page 16: NoSQL - Motivation and Overview

Skalierbarkeit

16

Page 17: NoSQL - Motivation and Overview

Tools

17

Page 18: NoSQL - Motivation and Overview

Tools

18

DynamoCouchDBDynomite

Tokyo Tyrant

MongoDB

Riak

Amazon SimpleDB

Redis Memcached

BigTableAmazon S3

Cassandra

Lotus Notes

Excel ;)Neo4j

Project Voldemort HBase

Page 19: NoSQL - Motivation and Overview

Tools

19

DynamoCouchDBDynomite

Tokyo Tyrant

MongoDB

Riak

Amazon SimpleDB

Redis Memcached

BigTableAmazon S3

Cassandra

Lotus Notes

Excel ;)Neo4j

Project Voldemort HBase

Page 20: NoSQL - Motivation and Overview

Redis

Simpler Key-Value-Store

Speichert Strings, Listen und Sets

Persistenz über Snapshots oder Append-Logs

20

Page 21: NoSQL - Motivation and Overview

Redis

21

Page 22: NoSQL - Motivation and Overview

Redis

set foo 4

1000

+OK

22

Request

Response

Page 23: NoSQL - Motivation and Overview

Scaling

Master-Slave mittels Snapshots

Multiple Master mittels Hash Ring

23

Page 24: NoSQL - Motivation and Overview

Einsatz-Szenarien

Persistenter Cache

Session-Store

Realtime-Data: Monitoring, Trading, ...

Simple Message Queue

Shared State

24

Page 25: NoSQL - Motivation and Overview

25

CouchDBrelax

Page 26: NoSQL - Motivation and Overview

CouchDB

Dokument-orientiert

26

Page 27: NoSQL - Motivation and Overview

27

”CouchDB is built of the Web“— Jacob Kaplan-Moss

Page 28: NoSQL - Motivation and Overview

CouchDB Document

28

{    "_id":  "BCCD12CBB",    "_rev":  "1-­‐AB764C",    "type":  "person",    "name":  "Darth  Vader",    "age":  63,    "headware":  ["Helmet",  "Sombrero"],    "dark_side":  true}

Page 29: NoSQL - Motivation and Overview

CouchDB Document

29

{    "_id":  "BCCD12CBB",    "_rev":  "1-­‐AB764C",    "type":  "person",    "name":  "Darth  Vader",    "age":  63,    "headware":  ["Helmet",  "Sombrero"],    "dark_side":  true}

Page 30: NoSQL - Motivation and Overview

CouchDB Document

30

{    "_id":  "BCCD12CBB",    "_rev":  "1-­‐AB764C",    "type":  "person",    "name":  "Darth  Vader",    "age":  63,    "headware":  ["Helmet",  "Sombrero"],    "dark_side":  true}

Page 31: NoSQL - Motivation and Overview

CouchDB - CRUD

Erstellen/Aktualisieren:

PUT /starwars/BCCD12CBB

Lesen:

GET /starwars/BCCD12CBB

Löschen:

DELETE /starwars/BCCD12CBB

31

Page 32: NoSQL - Motivation and Overview

CouchDB

Wie komme ich an meine Daten?

32

Page 33: NoSQL - Motivation and Overview

CouchDB

33

Views!

Page 34: NoSQL - Motivation and Overview

CouchDB

34

function(doc)  {    if  (doc.headware)  {        for  (var  hat  in  doc.headware)  {            emit(hat,  1);        }    }}

Page 35: NoSQL - Motivation and Overview

CouchDB

35

function(keys,  values,  rereduce)  {    return  sum(values);}

Page 36: NoSQL - Motivation and Overview

Libraries

SimplyStored: Ruby wrapper

http://github.com/peritor/simply_stored

36

ModelsAssociationsCallbacksValidationsDynamic finderS3 attachmentsParanoid delete

Page 37: NoSQL - Motivation and Overview

Libraries

37

Page 38: NoSQL - Motivation and Overview

B-Tree

38

Page 39: NoSQL - Motivation and Overview

Crash-Proof

39

Page 40: NoSQL - Motivation and Overview

Offline by default

40

Page 41: NoSQL - Motivation and Overview

Replication

41

Page 42: NoSQL - Motivation and Overview

CouchDB

POST /_replication

42

Page 43: NoSQL - Motivation and Overview

Und?

Daten sind wieder König

43

Page 44: NoSQL - Motivation and Overview

Aber!

Kein goldener Hammer

44

Page 45: NoSQL - Motivation and Overview

45

Page 46: NoSQL - Motivation and Overview

46

Page 47: NoSQL - Motivation and Overview

Peritor

47

Cloud-Management und -Deployment made easy

http://scalarium.com

Page 48: NoSQL - Motivation and Overview

© Peritor GmbH - Alle Rechte Vorbehalten

Peritor GmbHBlücherstr. 22, Hof III Aufgang 610961 Berlin

Tel.: +49 (0)30 69 20 09 84 0Fax: +49 (0)30 69 20 09 84 9

Internet: www.peritor.comE-Mail: [email protected]