Understanding, Choosing & Instrumenting NOSQL

90
Understanding Choosing & INSTRUMENTING NOSQL A PRESENTATION BY @timangladE FROM YOUR FRIENDS AT @cloudant

description

Key

Transcript of Understanding, Choosing & Instrumenting NOSQL

Page 1: Understanding, Choosing & Instrumenting NOSQL

Understanding Choosing& INSTRUMENTING NOSQL

A!PRESENTATION!BY @timangladEFROM!YOUR!FRIENDS!AT @cloudant

Page 2: Understanding, Choosing & Instrumenting NOSQL

@timanglade

Page 3: Understanding, Choosing & Instrumenting NOSQL

/taɪn/A database engine so tiny,its name had to be shortened

Tin

Page 4: Understanding, Choosing & Instrumenting NOSQL
Page 5: Understanding, Choosing & Instrumenting NOSQL
Page 6: Understanding, Choosing & Instrumenting NOSQL

NOSQLTAPES.com@NOSQLTAPES

Page 7: Understanding, Choosing & Instrumenting NOSQL
Page 8: Understanding, Choosing & Instrumenting NOSQL

You havea scaling problem

Page 9: Understanding, Choosing & Instrumenting NOSQL

So you decide togive NOSQL a try

Page 10: Understanding, Choosing & Instrumenting NOSQL

Now you HAveTWO Problems

Page 11: Understanding, Choosing & Instrumenting NOSQL

That’s the realityof NOSQL TODAY

So why bother? Oh, Don’t worry, I’m going to tell you…

Page 12: Understanding, Choosing & Instrumenting NOSQL

Why & HOWdo I NOSQL?

Page 13: Understanding, Choosing & Instrumenting NOSQL

Understanding Choosing& INSTRUMENTING NOSQL

Page 14: Understanding, Choosing & Instrumenting NOSQL

! UNDERSTANDING Your problem & NOSQL

Page 15: Understanding, Choosing & Instrumenting NOSQL

NOSQL is aboutTwo things

1. Performance 2. Distribution

N.B. To varying degrees in each NOSQL project…

Page 16: Understanding, Choosing & Instrumenting NOSQL

Performance?

Page 17: Understanding, Choosing & Instrumenting NOSQL

PerformancePerformance/$

Page 18: Understanding, Choosing & Instrumenting NOSQL

LOOK AT YOURRDBMS FIRST…

Page 19: Understanding, Choosing & Instrumenting NOSQL

A-B-C

Tip #1Cost: close to $0…

Page 20: Understanding, Choosing & Instrumenting NOSQL

A Always

B Be

C CACHING

Page 21: Understanding, Choosing & Instrumenting NOSQL

AlwaysBe

CACHING

Page 22: Understanding, Choosing & Instrumenting NOSQL

Always

Page 23: Understanding, Choosing & Instrumenting NOSQL

BE

Page 24: Understanding, Choosing & Instrumenting NOSQL

CACHING

Page 25: Understanding, Choosing & Instrumenting NOSQL

If you don’tI’ve NO SYMPATHYFOR YOU, PALAlso, always be rewatching GlenGarry Glen Ross.Great Movie. Fantastic Cast.

Page 26: Understanding, Choosing & Instrumenting NOSQL

INDEXFor God’s SAKE, INDEX

Tip #2Still For close to $0…

Page 27: Understanding, Choosing & Instrumenting NOSQL

If You know sqlYou can nosql

Tip #3Did you go to school? Then yes, Still close to zero

Page 28: Understanding, Choosing & Instrumenting NOSQL

Hirea DatabaseConsultant

Tip #4For a Fistful of dollars…

Page 29: Understanding, Choosing & Instrumenting NOSQL

Buy a bigger box

Tip #5For a few dollars more…

Page 30: Understanding, Choosing & Instrumenting NOSQL

5.1 TB 1.2 MIOPS 100 K Dollars

Page 31: Understanding, Choosing & Instrumenting NOSQL

A word about“the Cloud”

Tip #6Say, That’s a really nice shirt you’re wearing thereI’m sure we could come to an arrangement…

Page 32: Understanding, Choosing & Instrumenting NOSQL

You have a scaling problem,So you decide togive the Cloud a try

Page 33: Understanding, Choosing & Instrumenting NOSQL

Now you HAveX ProblemsWhere X is arbitrarily large

Page 34: Understanding, Choosing & Instrumenting NOSQL

The greatest sandboxever made

The BEST Bootcampever designed

Page 35: Understanding, Choosing & Instrumenting NOSQL

BTWTHESE TIPS APPLYTO NOSQL TOO…

Page 36: Understanding, Choosing & Instrumenting NOSQL

Did all that?don’t have the $$$?

Page 37: Understanding, Choosing & Instrumenting NOSQL

Welcome TO NOSQL

Page 38: Understanding, Choosing & Instrumenting NOSQL

NOSQL lets youUSE skillsINSTEAD of $$$But do you have the skills? Can you get them?

Page 39: Understanding, Choosing & Instrumenting NOSQL

Distribution

Page 40: Understanding, Choosing & Instrumenting NOSQL

What if you Can’tBUY a BOX ANY BIGGER?

Page 41: Understanding, Choosing & Instrumenting NOSQL

NETWORK PARTITIONSHAPPEN

Page 42: Understanding, Choosing & Instrumenting NOSQL

BROWNoutsHAPPEN

Page 43: Understanding, Choosing & Instrumenting NOSQL

Distribution is a(mostly) efficient wayTO ADD moreCAPACITY & AvailabilityTo youR DB

Page 44: Understanding, Choosing & Instrumenting NOSQL

A Word aboutMASTER-SLAVEREPLICATION

Page 45: Understanding, Choosing & Instrumenting NOSQL

A WORD ABOUTTHE CAP THEOREM

Page 46: Understanding, Choosing & Instrumenting NOSQL

! CHOOSING A NOSQL DATABASE

Page 47: Understanding, Choosing & Instrumenting NOSQL

How do I chose?

Page 48: Understanding, Choosing & Instrumenting NOSQL

Same 2 parametersDistribution+ “Performance”

Page 49: Understanding, Choosing & Instrumenting NOSQL

What doesPerformanceMean?

Page 50: Understanding, Choosing & Instrumenting NOSQL

Performance! Data / Query Model! Disk Structure

Page 51: Understanding, Choosing & Instrumenting NOSQL

the Moon Methodology™

1. Distribution 2. Data / Query Model 3. Disk Structure

Page 52: Understanding, Choosing & Instrumenting NOSQL

DistributionDynamo-StyleMaster-slaveMASTER-MASTER

Page 53: Understanding, Choosing & Instrumenting NOSQL

Data / Query ModelMap/ReduceEverywhere?

Page 54: Understanding, Choosing & Instrumenting NOSQL

Disk StructuresThe Devil is in the(implementation)Details

Page 55: Understanding, Choosing & Instrumenting NOSQL

Now let’s lookat major NOSQL DBsthrough this lens…

Page 56: Understanding, Choosing & Instrumenting NOSQL

CouchdbMaster-masterDoc + Persistent M/RAppend-only B+ Tree

Page 57: Understanding, Choosing & Instrumenting NOSQL

SMALL SCALEQUERIES don’t CHANGEHTTP IS A MUST

Ideal SCENARIO

Page 58: Understanding, Choosing & Instrumenting NOSQL

CouchBase 2.0Master-slaveK/V + Persistent M/RAppend-only B+ Tree

Page 59: Understanding, Choosing & Instrumenting NOSQL

?

IDEAL SCENARIO

Page 60: Understanding, Choosing & Instrumenting NOSQL

BigCouchDynamoDoc + Persistent M/RAppend-only B+ Tree

Page 61: Understanding, Choosing & Instrumenting NOSQL

Same as COUCHDB,BIGGER SCALE

IDEAL SCENARIO

Page 62: Understanding, Choosing & Instrumenting NOSQL

CassandraDynamoColumn FamiliesLog + SSTable

Page 63: Understanding, Choosing & Instrumenting NOSQL

fast writes +Don’t mind hacking

ideal scenario

Page 64: Understanding, Choosing & Instrumenting NOSQL

RiakMulti-DC DynamoK/V + M/R + 2aryLog-Struct. Hash Table(& others)

Page 65: Understanding, Choosing & Instrumenting NOSQL

Knowledgeable team,really large scale

ideal scenario

Page 66: Understanding, Choosing & Instrumenting NOSQL

MongoDBMaster-slaveDocS + M/R + 2aryLog + B-Tree

Page 67: Understanding, Choosing & Instrumenting NOSQL

Prototyping

ideal scenario

Page 68: Understanding, Choosing & Instrumenting NOSQL

RedisMaster-slave (?)ManyLOG + Many (?)

Page 69: Understanding, Choosing & Instrumenting NOSQL

APPLICATION “GLUE”

ideal scenario

Page 70: Understanding, Choosing & Instrumenting NOSQL

please don’t sniffyour REDIS

A plea for mercy

Page 71: Understanding, Choosing & Instrumenting NOSQL

NEO4JMaster-slave (~)OO + RESTCustom Graph Struct.

Page 72: Understanding, Choosing & Instrumenting NOSQL

LOTS OF SELF-JOINS

ideal scenario

Page 73: Understanding, Choosing & Instrumenting NOSQL

! INSTRUMENTING YOUR STACK

Page 74: Understanding, Choosing & Instrumenting NOSQL

You WILL FAIL

Oh yes, Yes you will…

Page 75: Understanding, Choosing & Instrumenting NOSQL

Any advancedDistributed SystemWill behaveLIKE a BLACK BOX

Page 76: Understanding, Choosing & Instrumenting NOSQL

TESTING IS FINE butMEASURING IS MOREUSEFULIn this context

Page 77: Understanding, Choosing & Instrumenting NOSQL

PercentileRESPONSE TIMES

Some stuff to keep an eye on

Page 78: Understanding, Choosing & Instrumenting NOSQL

ERROR RATES

Some stuff to keep an eye on

Page 79: Understanding, Choosing & Instrumenting NOSQL

Memory usage& stack depth

Some stuff to keep an eye on

Page 80: Understanding, Choosing & Instrumenting NOSQL

CPU usage& Number of Processes

Some stuff to keep an eye on

Page 81: Understanding, Choosing & Instrumenting NOSQL

DISK USAGE& IOPS

Some stuff to keep an eye on

Page 82: Understanding, Choosing & Instrumenting NOSQL

Hawk the graphsOVER LONG PERIODS

Page 83: Understanding, Choosing & Instrumenting NOSQL

Instrumentation& METROLOGYare still DARK ARTS

Page 84: Understanding, Choosing & Instrumenting NOSQL

Next Steps

Page 85: Understanding, Choosing & Instrumenting NOSQL

Coda Hale’smetrics EVERYWHEREpivotallabs.com/talks/139-metrics-metrics-everywhere

Page 86: Understanding, Choosing & Instrumenting NOSQL

Find a monitoringsystem that worksFOR YOU

Page 87: Understanding, Choosing & Instrumenting NOSQL

THe NOSQL Handbooknosqlhandbook.com

Page 88: Understanding, Choosing & Instrumenting NOSQL

Recap!!1.! NOSQL IS HARD!2.! KNOW YOUR RDBMS, KNOW YOUR PROBLEM!3.! PICK A DB By DISTRIBUTION, Query & Disk Models!4.! Instrument the heck out of it!5.! Rinse!6.! REPEAT

Page 89: Understanding, Choosing & Instrumenting NOSQL

GoEXPERIMENTDeployMEASUREIMPROVEHAVE FUN