2015/07/21 .net meetup

Post on 17-Aug-2015

88 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Demystifying NoSQLJim Borden @borrrden

Software Engineer, Couchbase

About Me• Lead .NET Mobile Engineer @ Couchbase since

2015/01

• Based in Tokyo

• Former mobile app developer (iOS / Android /

WinRT)

• Using .NET since 2007

What is NoSQL?•An unfortunate misnomer

•Not a rejection of SQL

•An out of control twitter hashtag

What is the goal?

Horizontal scalability

Fault tolerance

Price/Performance

Flexible data modeling

CAP Theorem

A partition tolerant system either needs to sacrifice consistency or availability.

WTF does it mean?

Story from http://ksat.me/a-plain-english-introduction-to-cap-theorem/

Thanks for calling Remember, Inc.

Remember, Inc. Profile

Customers call in with things they want you to remember (WRITE)

Customers call in at a later time requesting things that they asked you to remember (READ)

The boss answers the phones for Remember, Inc. alone.

Attempt One

Problem

• Scalability: This method only works as long as there is only one person controlling all data.

Image courtesy of Boians Cho Joo Young at FreeDigitalPhotos.net

Attempt Two

Light bulb image courtesy of jannoon028 at FreeDigitalPhotos.net

The boss hires a worker

Problem

• Consistency issue: What if one call tells something to the boss and then the next asks for the same information from the worker?

Attempt ThreeThe boss and worker relay info before completing calls

Problem

• Availability issue: Cannot do both things in parallel. If worker or boss call in sick, work never gets completed.

Attempt FourIf one is sick or not available, send email update.

When they return, they write down all email notes into notebook

Problem• Partition tolerance issue: What if the email server goes down and sent emails are not received?

Email image courtesy of Stuart Miles at FreeDigitalPhotos.net

How to organize data with no schema?

Generate indices via map functions, get statistics via reduce

Build queries on top of these indices

Comparable to moving the schema to runtime

Let’s see it in action (Couchbase Server / N1QL)(With CB Server running) http://localhost:8091/index.html

http://query.pub.couchbase.com/tutorial

Learn More

http://www.couchbase.com/developers

https://forums.couchbase.com/

Learn More

http://www.meetup.com/Couchbase-Tokyo/ (English)

https://couchbasejpcommunity.doorkeeper.jp/ (日本語)

top related