look mom nosql
DESCRIPTION
TRANSCRIPT
Look Mom - NoSQL
Charles NurseSenior Architect, DotNetNuke Corp.
• ASP.NET MVP (since Jan 2007)• ASPInsider (since Jan 2008)• Senior Architect, DotNetNuke Corporation
• Web: www.dotnetnuke.com• Blog: www.charlesnurse.com• Email: [email protected]• Twitter: @cnurse
Who Am I
Look Mom - NoSQL
• Intro to NoSQL Databases CAP Theorem Map Reduce
• NoSQL Database Types• RavenDB• Demo
Agenda
Look Mom - NoSQL
• Driven by the demands of “Big Data” Google Facebook Amazon
• Huge amounts of data Distributed Environment Availability
• CAP Theorem
Intro to NoSQL Databases
Look Mom - NoSQL
• CAP Theorem states “It is impossible for a distributed computer system to simultaneously provide
all three of the guarantees”
• Consistency• Availability• Partition Tolerance
CAP Theorem
Look Mom - NoSQL
• Consistency All nodes in a distributed system see the same data at the same time
eCommerce Weapons Systems
• Availability All requests receive a response about whether it was successful or failed
• Partition Tolerance The system continues to operate despite arbitrary message loss or failures
of part of the system
CAP Theorem
Look Mom - NoSQL
• Relational Databases emphasise Consistency, so either Availability or Partition Tolerance will suffer
• NoSQL Databases emphasise Availability and Partition Tolerance Eventual Consistency
Google Searches do not need to show documents created in the last few seconds
Facebook News Feed – do not need to show updates from the last few seconds
CAP Theorem
Look Mom - NoSQL
• NoSQL databases support distributed systems
• Map Reduce helps aggregate data using a pair of functions Map function
Maps input data into its final form Can be executed in parallel on each system
Reduce function Operates on results of the Map functions Executed repeatedly until results are obtained
Map Reduce
Look Mom - NoSQL
Map Reduce (Example)
• Blog Documents{
"type": "post",
"name": "Raven's Map/Reduce functionality",
"blog_id": 1342,
"post_id": 29293921,
"tags": ["raven", "nosql"],
"post_content": "<p>...</p>",
"comments": [ {
"source_ip": '124.2.21.2',
"author": "martin",
"text": "..."
}]
}
• Mapfrom post in docs.posts
select new {
post.blog_id,
comments_length = comments.length
};
• Reducefrom agg in results
group agg by agg.key into g
select new {
agg.blog_id,
comments_length = g.Sum(x=>x.comments_length)
};
Look Mom - NoSQL
• Apply Map
Map Reduce (Example)
Look Mom - NoSQL
• Reduce Step 1
Map Reduce (Example)
Look Mom - NoSQL
• Reduce Step 2
Map Reduce (Example)
Look Mom - NoSQL
• Reduce Step 3
Map Reduce (Example)
Look Mom - NoSQL
• Apply Map
Map Reduce (Example)
Look Mom - NoSQL
• Reduce Step 1
Map Reduce (Example)
Look Mom - NoSQL
• Reduce Step 2
Map Reduce (Example)
Look Mom - NoSQL
• Reduce Step 3
Map Reduce (Example)
Look Mom - NoSQL
• Sorted Ordered Column-Oriented Stores
• Key/Value Stores
• Document Databases
NoSQL Database Types
Look Mom - NoSQL
• Sorted Ordered Column-Oriented Stores
• Pioneered by Google BigTable
• Hbase Apache Foundation Used by Facebook, Stumble Upon, Hulu
• HyperTable Baidu
NoSQL Database Types
Look Mom - NoSQL
• Sorted Ordered Column-Oriented Stores
• Compare with Relational Databases.
NoSQL Database Types
Look Mom - NoSQL
• Sorted Ordered Column-Oriented Stores
NoSQL Database Types
Look Mom - NoSQL
• Sorted Ordered Column-Oriented Stores
NoSQL Database Types
Look Mom - NoSQL
• Key/Value Stores
• Membase – built on MemCacheD Zynga
• Redis Craigslist
• Cassandra Facebook, Digg, Reddit, Twitter
NoSQL Database Types
Look Mom - NoSQL
• Document Databases
• MongoDB Foursquare Github
• CouchDB Apple, BBC, CERN
• RavenDB Built in .NET, with LINQ
NoSQL Database Types
Look Mom - NoSQL
• Document Database Using JSON
• Built in .NET• LINQ Support• Full-text Search
Built on Lucene
• Two versions Server Embedded
RavenDB
Look Mom - NoSQL
Demo
Look Mom - NoSQL
• Get RavenDB http://ravendb.net/
• Get MongoDB www.mongodb.org/ .NET driver
https://github.com/mongodb/mongo-csharp-driver/downloads FluentMongo – LINQ for MongoDB
https://github.com/craiggwilson/fluent-mongo NoRM
http://normproject.org/
Next Steps
Look Mom - NoSQL
• Email: [email protected]• Blog: www.charlesnurse.com • Twitter: @cnurse
Thank You
Look Mom - NoSQL