Download - 2015/07/21 .NET Meetup
![Page 1: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/1.jpg)
Demystifying NoSQLJim Borden @borrrden
Software Engineer, Couchbase
![Page 2: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/2.jpg)
About Me• Lead .NET Mobile Engineer @ Couchbase since
2015/01
• Based in Tokyo
• Former mobile app developer (iOS / Android /
WinRT)
• Using .NET since 2007
![Page 3: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/3.jpg)
What is NoSQL?•An unfortunate misnomer
•Not a rejection of SQL
•An out of control twitter hashtag
![Page 4: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/4.jpg)
What is the goal?
Horizontal scalability
Fault tolerance
Price/Performance
Flexible data modeling
![Page 5: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/5.jpg)
CAP Theorem
A partition tolerant system either needs to sacrifice consistency or availability.
![Page 6: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/6.jpg)
WTF does it mean?
Story from http://ksat.me/a-plain-english-introduction-to-cap-theorem/
Thanks for calling Remember, Inc.
![Page 7: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/7.jpg)
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)
![Page 8: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/8.jpg)
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
![Page 9: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/9.jpg)
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?
![Page 10: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/10.jpg)
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.
![Page 11: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/11.jpg)
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
![Page 12: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/12.jpg)
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
![Page 13: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/13.jpg)
Let’s see it in action (Couchbase Server / N1QL)(With CB Server running) http://localhost:8091/index.html
http://query.pub.couchbase.com/tutorial
![Page 14: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/14.jpg)
Learn More
http://www.couchbase.com/developers
https://forums.couchbase.com/
![Page 15: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/15.jpg)
Learn More
http://www.meetup.com/Couchbase-Tokyo/ (English)
https://couchbasejpcommunity.doorkeeper.jp/ (日本語)
![Page 16: 2015/07/21 .NET Meetup](https://reader030.vdocument.in/reader030/viewer/2022032700/55d17fadbb61ebee0a8b4796/html5/thumbnails/16.jpg)