20
NoSQL and NewSQL Zhongke Chen May 28, 2012 Sunday, June 3, 12

Nosql and newsql

Embed Size (px)

DESCRIPTION

Introduction to NoSQL and NewSQL

Citation preview

Page 1: Nosql and newsql

NoSQL and NewSQLZhongke ChenMay 28, 2012

Sunday, June 3, 12

Page 2: Nosql and newsql

Agenda

What’s NoSQL

Typical NoSQL Models

What’s NewSQL

Popular NoSQL and NewSQL DBMSes

Discussion

Sunday, June 3, 12

Page 3: Nosql and newsql

Problems with SQL

Scale out

Performance & Size

Sunday, June 3, 12

Page 4: Nosql and newsql

What’s NoSQLNoSQL is a term used to designate databases which differ from classic relational databases in some way.

It does not use SQL as its query language (no relational model, no JOIN)

It may not give full ACID guarantees

Sunday, June 3, 12

Page 5: Nosql and newsql

ProsIt may have a distributed, fault-tolerant architecture

significant gains in performance for certain data models

It deals with huge quantities of data

Schema-less Design

Sunday, June 3, 12

Page 6: Nosql and newsql

CAP TheoremSunday, June 3, 12

Page 7: Nosql and newsql

NoSQL Models

Key-Value

Column Family

Document

Graph

Sunday, June 3, 12

Page 8: Nosql and newsql

NoSQL Models: Key-Value

key -> value

Examples: memcached, redis, Berkeley DB, Dynamo

Sunday, June 3, 12

Page 9: Nosql and newsql

NoSQL Model:Column Family

Row key, Column key -> Value

Examples: BigTable, Cassandra, HBase

Sunday, June 3, 12

Page 10: Nosql and newsql

NoSQL Model:Document

Key -> Document (JSON, XML)

Examples: MongoDB, CouchDB

Sunday, June 3, 12

Page 11: Nosql and newsql

NoSQL Model:Graph

Examples: Neo4j, OrientDB

Sunday, June 3, 12

Page 12: Nosql and newsql

What’s NewSQL

NewSQL preserves SQL and offer high performance and scalability, while preserving the traditional ACID notion for transactions.

Examples: VoltDB, NimbusDB, Clustrix, Drizzle

Sunday, June 3, 12

Page 13: Nosql and newsql

RedisKey-Value

In-Memory Cache

Rich Data Types and Operations

Optional Persistence

Master-Slave Replication

Transaction

Use cases:

weibo.com

dianping.com

Sunday, June 3, 12

Page 14: Nosql and newsql

MongoDBJSON like (BSON) Document Store

Auto Sharding

Global Lock, Only one node writable

Replica Sets Replication

Eventual Consistency

Mongo Query Language (Friendly to SQL users)

Use cases:

dianping.com

盛大

Cloud Foundry

Sunday, June 3, 12

Page 15: Nosql and newsql

CouchDBJSON Document Store

Written in Erlang

Master-Master Replication

MVCC

Eventual Consistency

Compaction

Offline

HTTP/REST API

View (query tool)

Use cases:

Ubuntu One

Meebo

Some Facebook Apps

Sunday, June 3, 12

Page 16: Nosql and newsql

CassandraColumn family model

Decentralized

Tunable Consistency

Use cases:

Facebook

Twitter

Netflix

Sunday, June 3, 12

Page 18: Nosql and newsql

VoltDBSpeak SQL

Stored Procedures

Partitioning Table and Replication Table

Lock free design

In-Memory

Snapshots and command logging

K-safety

Linear Scalability

Use cases:

http://voltdb.com/customers

Sunday, June 3, 12

Page 19: Nosql and newsql

How To ChooseMongoDB: If you need dynamic queries. If you prefer to define indexes, not map/reduce functions. If you need good performance on a big DB. If you wanted CouchDB, but your data changes too much, filling up disks.

CouchDB: For accumulating, occasionally changing data, on which pre-defined queries are to be run. Places where versioning is important.

Redis: For rapidly changing data with a foreseeable database size (should fit mostly in memory).

Neo4J: For graph-style, rich or complex, interconnected data. Neo4j is quite different from the others in this sense.

Cassandra: When you write more than you read (logging). If every component of the system must be in Java. ("No one gets fired for choosing Apache's stuff.")

VoltDB: If you want to speak SQL and use JOIN

Sunday, June 3, 12

Page 20: Nosql and newsql

Q&A

The End!

Thank you!

Sunday, June 3, 12