Top Banner
Applied NoSQL in .NET by Michael Kennedy | DevelopMentor | @mkennedy | michaelckennedy.net from DEVELOPMENTOR - ONLINE, COLLABORATIVE, LEARNING PLATFORM. Warning: US English ahead, sorry my UK friends!
31

Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Jul 08, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Applied NoSQL in .NETby Michael Kennedy | DevelopMentor | @mkennedy | michaelckennedy.net

from DEVELOPMENTOR - ONLINE, COLLABORATIVE, LEARNING PLATFORM.

Warning: US English ahead, sorry my UK friends!

Page 2: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Learn more at http://story.learninglineapp.com

What's Your Experience with NoSQL?

Page 3: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

What is NoSQL?

NoSQL is about re-evaluating the constraints and scalability of data storage systems in the light of the way modern web applications generate and consume data.

Page 4: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

What is NoSQL?

NoSQL is about re-evaluating the constraints and scalability of data storage systems in the light of the way modern web applications generate and consume data.

Page 5: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Why NoSQL?

Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer.

Starting from an RDBMS is virtually an axiom of software development.

When was the last time you consciously evaluated alternatives to an RDBMS?

Page 6: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

You can keep your ‘object / relational impedance mismatch’, thank you very much!

Why NoSQL?

Page 7: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Combining the best features of document databases, key-values stores, and RDBMS.

http://www.mongodb.org/

MongoDB: A Powerful NoSQL Database

Page 8: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

MongoDB: Just an example in a vast NoSQL landscape

Page 9: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Do you work for a "boring" company? Are you located somewhere outside of Silicon Valley?

Maybe you can never sell this crazy idea at your company or team...

Is NoSQL just for start-ups and other edgy companies?

Page 10: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

All these companies (some "boring") use MongoDB:

http://www.mongodb.org/about/production-deployments/

Is NoSQL just for start-ups and other edgy companies?

Page 11: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

http://www.mongodb.org/about/production-deployments/

Is NoSQL just for start-ups and other edgy companies?

CERN

Page 12: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

http://www.mongodb.org/about/production-deployments/

Is NoSQL just for start-ups and other edgy companies?

No.

Page 13: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Getting started

Page 14: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

What kind of weird query language might one use here?

Programming NoSQL

Page 15: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Find several provider libraries on NuGet, including the Official 10Gen C# driver.

Programming NoSQL

Page 16: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Programming NoSQL: An MVC example

Page 17: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

I Want My Management Tools

Page 18: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

http://www.mongovue.com/

I Want My Management Tools

Page 19: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

I've heard "NoSQL" is fast. Is that, like, 50% faster?Dropping ACID with MongoDB on USTREAM

Scaling-Out is Easier With NoSQL

Page 20: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Modeling a complex data set: RDBMS version

www.LearningLineApp.com

LearningLine has a complex schema. Small subset:

- Users - start and complete tasks - start and complete activities - favorite and vote on both

- Tasks - contain activities - contain tags - can be voted and favorited

- Activities - contain type (video, exercise) - can be voted and favorited

etc.

Page 21: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom
Page 22: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Modeling a complex data set with documents: the classes

Still a fair number of classes, but only a few are actual DB entities.

Page 23: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Modeling a complex data set with documents: the database entities

Page 24: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Modeling a complex data set: finding data

How would you find an activity in this brave new world?

Page 25: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Modeling a complex data set: finding data

How would you find an activity in this brave new world?

Page 26: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Serious considerations when using MongoDB

http://blog.serverdensity.com/does-everyone-hate-mongodb/

Page 27: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Serious considerations when using MongoDB

Do not forget these:

1. Replica Sets: Always run MongoDB in at least 2 instances connected as either replicate sets or master / slave configurations.

2. Safe mode: MongoDB can run in a faster, unchecked mode. Make sure you use safe mode (on in my examples) unless you want it off for a reason.

3. Use 64-bit: On 32-bit machines, MongoDB limits the DB size to 2 GB. Just use 64-bit.

4. Lots of RAM: Give MongoDB lots of RAM. It expects to operate that way.

Page 28: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

When NOT to use MongoDB

1. You must have a transaction span multiple, top-level entities. Maybe RavenDB is better here, or even SQL Server.

2. You are on a team with either too much inexperience with NoSQL or large resistance to NoSQL.

Page 29: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Just some of the features we've explored in NoSQL:

* Your database is a choice you make for each project* NoSQL => Non-relational, less transactional* Document databases are on the rise within NoSQL* Strongly supports horizontal scale-out* LINQ works great

Conclusion

Page 30: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Take a NoSQL course on LearningLine

Free for DevWeek attendees: http://bit.ly/ll-kennedy

Take this class for free with this code http://bit.ly/ll-kennedy

Page 31: Applied NoSQL in · Why NoSQL? Axiom: A proposition whose truth is so evident that no reasoning or demonstration can make it plainer. Starting from an RDBMS is virtually an axiom

Thanks for coming!

Free for DevWeek attendees: http://bit.ly/ll-kennedy

STAY IN TOUCH

Blog: blog.michaelckennedy.net

Twitter: @mkennedy

Google+: http://bit.ly/kennedy-plus