nosql in the cloud

36
19. und 20. Oktober 2010 in Nürnberg www.prioconference.de NOSQL Datenspeicherung in der Cloud Sergey Shishkin sergey.shishkin@mt-ag.com http://shishkin.org @sshishkin

Upload: sergey-shishkin

Post on 16-Jun-2015

802 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: NOSQL in the Cloud

19. und 20. Oktober 2010 in Nürnberg www.prioconference.de

NOSQL Datenspeicherung in der Cloud

Sergey Shishkin [email protected] http://shishkin.org @sshishkin

Page 2: NOSQL in the Cloud
Page 3: NOSQL in the Cloud

Setting Expectations

• Motivators for cloud solutions

• Distributed database issues

• NOSQL solutions

• Code examples

• It’s not a deep dive session

Page 4: NOSQL in the Cloud
Page 5: NOSQL in the Cloud

Typical Motivators

• Low cost start-up

• Grow fast

• Peak loads

• Security

• Maintenance costs

Page 6: NOSQL in the Cloud
Page 7: NOSQL in the Cloud

Commodity Infrastructure

• Infrastructure-, Platform as a Service

• Raise the level of abstraction – Computational power

instead of CPU, GHz and L2 Cache

– Persistent storage instead of SATA, RAID and SCSI

– Communication channels instead of Ethernet, DHCP and TCP

• Everything will be in the cloud

Page 8: NOSQL in the Cloud
Page 9: NOSQL in the Cloud

Who can benefit from Cloud?

• Web 2.0 start-ups

• Social media

Page 10: NOSQL in the Cloud

Source: http://www.appdata.com/leaderboard/apps

Page 11: NOSQL in the Cloud

Casual Online Games

• Huge opportunity for start-ups

• Low cost, low risk

• Grow fast

Page 12: NOSQL in the Cloud
Page 13: NOSQL in the Cloud

60 Million Active Monthly Users

• Don’t know how FarmVille actually works

• But their scalability requirements are huge

Page 14: NOSQL in the Cloud
Page 15: NOSQL in the Cloud

Classical Web-farm Scale

Page 16: NOSQL in the Cloud
Page 17: NOSQL in the Cloud

Data persistence is a bottleneck

• ACID Transactions

• Locks are expensive

• RDBMS power of choice

– Optimized for massive writes

– Or for ad-hoc structured queries

– What a surprise!

• How does RDBMS scale?

Page 18: NOSQL in the Cloud
Page 19: NOSQL in the Cloud

Vertical Scale

• Costs grow exponentially

Page 20: NOSQL in the Cloud
Page 21: NOSQL in the Cloud

Horizontal Scale

• Master-Slave Replication

– Still bad for massive writes

• Master-Master Replication

– Resolving conflicts is hard in a normalized model

• Sharding/Partitioning

– Give up unique constraints, foreign keys, joins

Page 22: NOSQL in the Cloud
Page 23: NOSQL in the Cloud

What was the point of all that again?

Pretty much nothing left over of RDBMS.

Page 24: NOSQL in the Cloud

Consistency All clients always have the same view of the data

Availability Each client can always read and write

Partition Tolerance The system works well despite physical network partitions

Brewer’s CAP-Theorem

Page 25: NOSQL in the Cloud

Meet CAP Theorem

• You can choose only two!

Page 26: NOSQL in the Cloud

Visual Guide to NOSQL

SimpleDB AzureTS CouchDB RDBMS

Consistency All clients always have the same view of the data

Availability Each client can always read and write

Partition Tolerance The system works well despite physical network partitions MongoDB

Page 27: NOSQL in the Cloud

Key-Value Store Collection: BlogPosts

key: 1 ew0KICAgIHRpdGxlOiCTQ291Y2hEQpQsDQogICAgY29udGVudDogk4WUDQp9DQo=

key: 2 ew0KICAgIHRpdGxlOiCTTW9uZ29EQpQsDQogICAgY29udGVudDogk4WUDQp9DQo=

Page 28: NOSQL in the Cloud
Page 29: NOSQL in the Cloud

Document Store Collection: BlogPosts

key: 1 { title: “CouchDB”, content: “…” links: [“…”, “…”] }

key: 2 { title: “MongoDB”, content: “…” }

Page 30: NOSQL in the Cloud

Domain: BlogPosts

Item: 1

Column: Title

Value: “SimpleDB”

Column: Content

Value: “…”

Colulmn: Links

Value: amazonwebservices.com

Value: amazon.com

Item: 2

...

Column Store

Page 31: NOSQL in the Cloud
Page 32: NOSQL in the Cloud

Data Storage Ecosystem

• NOSQL = Not Only SQL

• RDBMS still has its strengths

– Unique constraints

– But they don’t scale horizontally

• You don’t need a hammer when you have the right tools ;)

Page 33: NOSQL in the Cloud

Düsseldorf 2010

25. November 2010, Ratingen http://cloudcamp.org/dusseldorf

Page 34: NOSQL in the Cloud

Beratung Projekte Schulungen

Application Lifecycle Design Entwicklung

Architektur SOA Cloud Computing

BalckeBalcke-Dürr-Allee 9, 40882 Ratingen www.mt-ag.com [email protected]

Page 36: NOSQL in the Cloud

Images

• http://www.flickr.com/photos/brianauer/2599299352/ (swimmingpool)

• http://www.flickr.com/photos/orangeacid/227642583/ (cloud)

• http://www.flickr.com/photos/runningclouds/3220810175/ (city in clouds)

• http://isparade.jp (twitter parade)

• http://www.flickr.com/photos/seeminglee/4090890825/ (farmville)

• http://www.flickr.com/photos/icatus/2992269179/ (bottleneck)

• http://www.flickr.com/photos/theplanetdotcom/4879421740/ (data center)

• http://www.flickr.com/photos/redbullfanclub/3788029453/ (f1)

• http://www.flickr.com/photos/stevendepolo/4536694260/ (broken glass)

• http://www.flickr.com/photos/starstreak007/3232853321/ (toy car)

• http://browsertoolkit.com/fault-tolerance.png

• http://www.flickr.com/photos/ebarney/3348965007/ (tools)