SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
NoSQL: Which way to go?
DDDMelbourne2015
HimanshuDesai,AhmedElharouny&DanielJanczak
No SQL : Which way to go?  Presented at DDDMelbourne 2015
About us
• Himanshu Desai (@H_Desai)
• Ahmed Elharouny(@Harouny)
• Daniel Janczak (@DanielJanczak)
And we all work for Readify
Page
Why NoSQL?
Scale
Pros
NoSQL technologies can offer
more scalability than relational
databases
Cons
Often lose some benefits of
relational databases e.g.
database-wide transactions
Better Formats
Pros
Avoiding ORMs
Cons
Limited BI tooling, Data
hard to share outside the
application
Work in more flexible
ways
Pros
No fixed schemas
Cons
Fixed schemas help
prevent errors
Page
Document Database Database
CollectionsCollections
Database
{
“title”: “Justin …”,
“genre”: “Pop”,
“price”: 36
}
Document 1
{
“title”: “Don’t Spe..”,
“genre”: “Techno”,
“price”: 42.99
}
Document 2
{
“numberOfSongs”: 2,
“last”: “Jan 1, 2015”
}
Document 3
Request
Application
{ }
RavenDB
What is RavenDB?
› Open source NoSQL database for .NET
› Developed by Hibernating Rhinos Ltd
› Available
› As a standalone package
› As embedded version
› On Azure and Amazon
Schema-free
Store data as Plain Old C# Object
(POCO)
Or directly as JSON
var author = new Author {
Name = "George Martin",
Books = new[] {
new Book {Title = "A Game of Thrones"},
new Book {Title = "A Clash of Kings"}
}
};
session.Store(author);
{
"Name": "George Martin",
"Books": [
{
"Title": "A Game of Thrones",
"Genre": "Fantasy"
},
{
"Title": "A Clash of Kings",
"Genre": "Fantasy
}
]
}
Scalable
› Replication
› “Keepcopiesofmydatasomewhereelse”
› Sharding
› “Splitmyhugedatabaseintosmallerparts”
› Multi-tenancy
› “Singleinstanceservesmultiplecustomers=manydatabasesper
server”
Extensible
› Useexisting bundles
› Compression
› Encryption
› Expiration
› PeriodicExport
› Quotas
› Replication
› ScriptedIndex
› SQLReplication
› Versioning
› Orwriteyour ownplugins
› Triggers
› Codecs
› Tasks
› Compilation Extensions
› AnalyzerGenerators
› Databaseconfiguration
› Customsorters
Easy to use
› .NETandJAVAclient
› LINQtoquerydata
› RESTAPI
› GEThttp://localhost:8080/docs/bobs_address
› PUThttp://localhost:8080/docs/bobs_address -d"{FirstName:'Bob',
LastName:'Smith',Address:'5ElmSt'}“
› Andsoon…
Easy to manage
› .Built-inmanagementtool–noneedtodownloadanythingextra
Optimized
› Transactional(ACID)ondocumentoperations
› InplainEnglish“yourdataissafe”
› ButonlyBASEforqueries
› “BasicallyAvailable,Softstate,EventualConsistency”
› InplainEnglish:
› youwillalwaysgettheresultsofyourqueriesasfastaspossible
› buttheresultswon’talwaysbeuptodateuntildatabasefinishes
indexing
› Ifyouwantthemuptodate,youhavetodemanditexplicitly
Eventual consistency
Good or bad ?
Newspaper Good! Very few writes, thousands of
reads, doesn’t have to be immediate
Product signup Good! All applicant information held
together
Banking system What if the credits and debits sometimes
don’t match?
Patient drug
monitoring
What if the drug doses are not updated
on time?
Our test data
public class Author {
public string Name {get; set;}
public string Surname {get; set;}
public Book[] Books {get; set;}
}
public class Book {
public string Title {get; set;}
public string Genre {get; set;}
public DateTime? PublishedOn {get; set;}
public decimal? Price {get; set;}
}
Our test data continues…
• George Martin
• A Game of Thrones, Fantasy, 6/8/1996, $12.34
• A Clash of Kings, Fantasy, 16/11/1998
• Dan Simmons
• Hyperion, Science Fiction, 1/1/1989, $34.56
• Terror, Thriller, 8/1/2007, $23.45
• John Tolkien
• Hobbit, Fantasy, 21/9/1937, $12.34
• Stephen King
• The Stand, Horror, 1/9/1978, $12.34
A quick look at code
Code samples:
https://github.com/danieljanczak/ddd-melb2015-ravendb-samples
MongoDB
A scalable, high-performance, open source, schema-free, document-
oriented database.
- mongodb.org
What is MongoDB?
MongoDB Popularity
Source: db-engins.com
MongoDBFeatures
The best features of key/values stores, document databases and relational
databases in one.
• Open source
MongoDB Features
The best features of key/values stores, document databases and relational
databases in one.
• Open source
• Cross platform
The best features of key/values stores, document databases and relational
databases in one.
MongoDB Features
• Open source
• Cross platform
• Strong indexing
The best features of key/values stores, document databases and relational
databases in one.
MongoDB Features
• Open source
• Cross platform
• Strong indexing
• Strong query language
The best features of key/values stores, document databases and relational
databases in one.
MongoDB Features
• Open source
• Cross platform
• Strong indexing
• Strong query language
• Replication
The best features of key/values stores, document databases and relational
databases in one.
MongoDB Features
• Open source
• Cross platform
• Strong indexing
• Strong query language
• Replication
• Sharding
The best features of key/values stores, document databases and relational
databases in one.
MongoDB Features
• Open source
• Cross platform
• Strong indexing
• Strong query language
• Replication
• Sharding
• Native drivers
The best features of key/values stores, document databases and relational
databases in one.
MongoDB Features
• Open source
• Cross platform
• Strong indexing
• Strong query language
• Replication
• Sharding
• Native drivers
• File storage (GridFS)
The best features of key/values stores, document databases and relational
databases in one.
MongoDB Features
• Open source
• Cross platform
• Strong indexing
• Strong query language
• Replication
• Sharding
• Native drivers
• File storage (GridFS)
• Aggregation framework + MapReduce
MongoDB Getting Started
1
DOWNLOAD
MongoDB 64 Bit for
Windows
(Link)
2
Create Data Directory
3
Start MongoDB
Demo
Code samples:
https://gist.github.com/harouny/a29e5455d9ea9d773a6e
https://gist.github.com/harouny/a00db1065fbbcfa8d79b
DocumentDB
How would you access it?
Application
Database
Collections
Stored
Procedures
Triggers UDFs
Documents
Libraries:
.NET, JavaScript,
Node.js, Python,
…
REST
Collections
Database
DocumentDB
Working with data
RESTful access methods
For Create/Read/Update/Delete
(CRUD) operations
DocumentDB SQL
A query language with SQL-
derived syntax
Example:
SELECT c.Books
FROM Authors c
WHERE c.name =
“George"
Executing logic in the DB
( Javascript)
Stored procedures
Triggers
User-defined functions
(UDFs)
- Allow extending
DocumentDB SQL
Sharding and Transaction
Collection Collection Collection
Database
JSON
JSON
JSON
JSON
JSON
JSON
JSON
JSON
Collection
JSON
JSON
JSON
The unit of
Sharding is a
collection is a
collection
Atomic transactions can span
only a single collection
collection
.NET Development
• You need following from the portal after provision a database
• Endpoint Url
• Authorization key
• Nu-get package
• Install-Package Microsoft.Azure.DocumentDB
• Use them to create DocumentClient
Demo
Page
In a nutshell
In a nutshell - ACID
• RavenDB
• Fully transactional writes on document level, even between collections
• Reads use eventual consistency
• Support for DTS
• MongoDB
• Only supports ACID transactions at the document level.
• Multi-collection (table) transactions not supported.
• Users can choose the level of consistency using (WriteConcern and ReadPreference)
• DocumentDB
• Full ACID support on the collection level
• 4 levels of consistency, Extremely rich query model.
In a nutshell - availability and tooling
• RavenDB
• On-prem (Windows), Cloud (RavenHQ) on Azure and Amazon, Embedded version / unit testing
• Built in web based Management Studio
• .NET and JAVA drivers, REST API
• Possible access through LinqPad
• MongoDB
• On-prem (Windows, Linx, Mac), Cloud (i.e MongoLab)
• MongoDB Cloud Manager (monitoring, automated management)
• Mongo Shell
• Lots of 3rd party GUIs i.e. Robomongo
• DocumentDB
• Accessed from virtually “any” system. Available in “Azure” only at this point.
• Azure Web Portal
• DocumentDB Studio
• LinqPad
• SDK available for various platform and REST based access
In a nutshell – querying and indexing
• RavenDB
• Only very basic queries supported without static indexes
• Map-reduce
• Full text search
• Eventual consistency by default
• MongoDB
• Strong indexing (_id indexed by default, custom indexes, compound, unique, text). Async indexing.
• Query from primary by default (Strong consistency)
• Query from “nearest” if needed (Eventual consistency)
• When writing you choose when to consider write operation successful.
• DocumentDB
• Very rich query model – Supports Linq to objects, Lambda expression and SQL style syntax. Supports
Stored procedure, triggers and UDFs
• Auto index by default.
• Support lazy indexing if required.
• 4 levels of consistency to choose from (Strong, Session, Bounded Stalesness,Eventual consistency
In a nutshell - performance
• RavenDB
• Writes directly to disk (safety over speed)
• Indexing in the background
• Query results are instantly available in indexes
• May need to wait for specific update
• MongoDB
• TCP/IP based communication.
• Uses BSON (lightweight, traversable, efficient).
• MMAPv1 storage engine uses OS memory mapped files.
• Wiredtiger storage engine (7,000,000 op/second 28 threads).
• Choose level of performance vs consistency.
• DocumentDB
• 3 Levels of performance offered.
• Normalised CPU, memory, Disk and network as Request Units (RU)
• TCP/HTTPS based access available
In a nutshell – gotchas!
• RavenDB
• Need to reset underlying Lucene indexes – they do crash
• Database defaults (winning numbers: 15, 50, 16384; 128, 1024)
• Static indexes
• Eventual consistency
• MongoDB
• 32-bit limitations
• Max document size 16 MB
• Modeling currency
• DocumentDB
• Max response size : 1MB
• Max request size including attachment: 512KB.
• Consistency is set at database level not at collection level.
Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr..."PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...Stefan Adam
 
Relational to Graph - Import
Relational to Graph - ImportRelational to Graph - Import
Relational to Graph - ImportNeo4j
 
Performance of graph query languages
Performance of graph query languagesPerformance of graph query languages
Performance of graph query languagesAthiq Ahamed
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónMongoDB
 
Elasticsearch quick Intro (English)
Elasticsearch quick Intro (English)Elasticsearch quick Intro (English)
Elasticsearch quick Intro (English)Federico Panini
 
Using Neo4j from Java
Using Neo4j from JavaUsing Neo4j from Java
Using Neo4j from JavaNeo4j
 
MongoDB, E-commerce and Transactions
MongoDB, E-commerce and TransactionsMongoDB, E-commerce and Transactions
MongoDB, E-commerce and TransactionsSteven Francia
 
Clamdigging: Leveraging ClamAV for Malware Analysis and Detection
Clamdigging: Leveraging ClamAV for Malware Analysis and DetectionClamdigging: Leveraging ClamAV for Malware Analysis and Detection
Clamdigging: Leveraging ClamAV for Malware Analysis and Detectionmalwareforme
 
Choosing the right NOSQL database
Choosing the right NOSQL databaseChoosing the right NOSQL database
Choosing the right NOSQL databaseTobias Lindaaker
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialSteven Francia
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageNeo4j
 
Getting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jGetting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jSuroor Wijdan
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
 
2011 05-12 nosql-progressive.net
2011 05-12 nosql-progressive.net2011 05-12 nosql-progressive.net
2011 05-12 nosql-progressive.netMårten Gustafson
 
Building Applications with a Graph Database
Building Applications with a Graph DatabaseBuilding Applications with a Graph Database
Building Applications with a Graph DatabaseTobias Lindaaker
 
Gerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol
 
Sem tech 2010_integrity_constraints
Sem tech 2010_integrity_constraintsSem tech 2010_integrity_constraints
Sem tech 2010_integrity_constraintsClark & Parsia LLC
 

Was ist angesagt? (20)

"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr..."PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
 
Relational to Graph - Import
Relational to Graph - ImportRelational to Graph - Import
Relational to Graph - Import
 
Performance of graph query languages
Performance of graph query languagesPerformance of graph query languages
Performance of graph query languages
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producción
 
Elasticsearch quick Intro (English)
Elasticsearch quick Intro (English)Elasticsearch quick Intro (English)
Elasticsearch quick Intro (English)
 
Using Neo4j from Java
Using Neo4j from JavaUsing Neo4j from Java
Using Neo4j from Java
 
MongoDB, E-commerce and Transactions
MongoDB, E-commerce and TransactionsMongoDB, E-commerce and Transactions
MongoDB, E-commerce and Transactions
 
Clamdigging: Leveraging ClamAV for Malware Analysis and Detection
Clamdigging: Leveraging ClamAV for Malware Analysis and DetectionClamdigging: Leveraging ClamAV for Malware Analysis and Detection
Clamdigging: Leveraging ClamAV for Malware Analysis and Detection
 
Mongo db operations_v2
Mongo db operations_v2Mongo db operations_v2
Mongo db operations_v2
 
Choosing the right NOSQL database
Choosing the right NOSQL databaseChoosing the right NOSQL database
Choosing the right NOSQL database
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
 
MongoDB for Genealogy
MongoDB for GenealogyMongoDB for Genealogy
MongoDB for Genealogy
 
Neo4j in Depth
Neo4j in DepthNeo4j in Depth
Neo4j in Depth
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query Language
 
Getting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jGetting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4j
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
2011 05-12 nosql-progressive.net
2011 05-12 nosql-progressive.net2011 05-12 nosql-progressive.net
2011 05-12 nosql-progressive.net
 
Building Applications with a Graph Database
Building Applications with a Graph DatabaseBuilding Applications with a Graph Database
Building Applications with a Graph Database
 
Gerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol Graph Databases
Gerry McNicol Graph Databases
 
Sem tech 2010_integrity_constraints
Sem tech 2010_integrity_constraintsSem tech 2010_integrity_constraints
Sem tech 2010_integrity_constraints
 

Andere mochten auch

Multitenancy Options on Azure
Multitenancy Options on AzureMultitenancy Options on Azure
Multitenancy Options on AzureHimanshu Desai
 
Storage Options on Windows Azure
Storage Options on Windows AzureStorage Options on Windows Azure
Storage Options on Windows AzureHimanshu Desai
 
ASP.NET Web API O to 100
ASP.NET Web API O to 100ASP.NET Web API O to 100
ASP.NET Web API O to 100Himanshu Desai
 
How to Improve agile team efficiency
How to Improve agile team efficiencyHow to Improve agile team efficiency
How to Improve agile team efficiencyHimanshu Desai
 
Web api scalability and performance
Web api scalability and performanceWeb api scalability and performance
Web api scalability and performanceHimanshu Desai
 
Cross Platform Devops with Visual Studio Team Services
Cross Platform Devops with Visual Studio Team ServicesCross Platform Devops with Visual Studio Team Services
Cross Platform Devops with Visual Studio Team ServicesHimanshu Desai
 
Visual Studio Team Services Release Management Overview
Visual Studio Team Services Release Management OverviewVisual Studio Team Services Release Management Overview
Visual Studio Team Services Release Management OverviewHimanshu Desai
 
Visual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services OverviewVisual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services OverviewHimanshu Desai
 
The Solar System
The Solar System The Solar System
The Solar System Hk Sarawgi
 
Lo6 weather v climate, atmosphere
Lo6 weather v climate, atmosphereLo6 weather v climate, atmosphere
Lo6 weather v climate, atmosphereSUNY Ulster
 
Lo7 motions and seasons
Lo7 motions and seasonsLo7 motions and seasons
Lo7 motions and seasonsSUNY Ulster
 
11 weather and climate
11   weather and climate11   weather and climate
11 weather and climateSUNY Ulster
 
YourStyle.Me 102
YourStyle.Me 102YourStyle.Me 102
YourStyle.Me 102Timothy Lie
 
Pg tp-class11-weather and climate
Pg tp-class11-weather and climatePg tp-class11-weather and climate
Pg tp-class11-weather and climateSUNY Ulster
 
Pg class32-biosphere
Pg class32-biospherePg class32-biosphere
Pg class32-biosphereSUNY Ulster
 
Assessing lib 111 2012 orig
Assessing lib 111 2012 origAssessing lib 111 2012 orig
Assessing lib 111 2012 origSUNY Ulster
 

Andere mochten auch (20)

Multitenancy Options on Azure
Multitenancy Options on AzureMultitenancy Options on Azure
Multitenancy Options on Azure
 
Storage Options on Windows Azure
Storage Options on Windows AzureStorage Options on Windows Azure
Storage Options on Windows Azure
 
ASP.NET Web API O to 100
ASP.NET Web API O to 100ASP.NET Web API O to 100
ASP.NET Web API O to 100
 
How to Improve agile team efficiency
How to Improve agile team efficiencyHow to Improve agile team efficiency
How to Improve agile team efficiency
 
Web api scalability and performance
Web api scalability and performanceWeb api scalability and performance
Web api scalability and performance
 
Cross Platform Devops with Visual Studio Team Services
Cross Platform Devops with Visual Studio Team ServicesCross Platform Devops with Visual Studio Team Services
Cross Platform Devops with Visual Studio Team Services
 
Visual Studio Team Services Release Management Overview
Visual Studio Team Services Release Management OverviewVisual Studio Team Services Release Management Overview
Visual Studio Team Services Release Management Overview
 
Visual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services OverviewVisual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services Overview
 
The Solar System
The Solar System The Solar System
The Solar System
 
Lo6 weather v climate, atmosphere
Lo6 weather v climate, atmosphereLo6 weather v climate, atmosphere
Lo6 weather v climate, atmosphere
 
Lo7 motions and seasons
Lo7 motions and seasonsLo7 motions and seasons
Lo7 motions and seasons
 
Zappos
ZapposZappos
Zappos
 
11 weather and climate
11   weather and climate11   weather and climate
11 weather and climate
 
YourStyle.Me 102
YourStyle.Me 102YourStyle.Me 102
YourStyle.Me 102
 
Pg tp-class11-weather and climate
Pg tp-class11-weather and climatePg tp-class11-weather and climate
Pg tp-class11-weather and climate
 
Cheese rolling
Cheese rollingCheese rolling
Cheese rolling
 
U-Brella
U-BrellaU-Brella
U-Brella
 
Pg class32-biosphere
Pg class32-biospherePg class32-biosphere
Pg class32-biosphere
 
Assessing lib 111 2012 orig
Assessing lib 111 2012 origAssessing lib 111 2012 orig
Assessing lib 111 2012 orig
 
Led products
Led productsLed products
Led products
 

Ähnlich wie No SQL : Which way to go? Presented at DDDMelbourne 2015

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBSean Laurent
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDBMongoDB
 
Webinar: Enterprise Data Management in the Era of MongoDB and Data Lakes
Webinar: Enterprise Data Management in the Era of MongoDB and Data LakesWebinar: Enterprise Data Management in the Era of MongoDB and Data Lakes
Webinar: Enterprise Data Management in the Era of MongoDB and Data LakesMongoDB
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDBMongoDB
 
Jumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppJumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppMongoDB
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 
MongoDB in FS
MongoDB in FSMongoDB in FS
MongoDB in FSMongoDB
 
Agility and Scalability with MongoDB
Agility and Scalability with MongoDBAgility and Scalability with MongoDB
Agility and Scalability with MongoDBMongoDB
 
Dynamo vs Mongo
Dynamo vs MongoDynamo vs Mongo
Dynamo vs MongoAmar Das
 
Compare DynamoDB vs. MongoDB
Compare DynamoDB vs. MongoDBCompare DynamoDB vs. MongoDB
Compare DynamoDB vs. MongoDBAmar Das
 
MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewAntonio Pintus
 
Case study of Rujhaan.com (A social news app )
Case study of Rujhaan.com (A social news app )Case study of Rujhaan.com (A social news app )
Case study of Rujhaan.com (A social news app )Rahul Jain
 
Sharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data LessonsSharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data LessonsGeorge Stathis
 
Introducing MongoDB into your Organization
Introducing MongoDB into your OrganizationIntroducing MongoDB into your Organization
Introducing MongoDB into your OrganizationMongoDB
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsHabilelabs
 

Ähnlich wie No SQL : Which way to go? Presented at DDDMelbourne 2015 (20)

Drop acid
Drop acidDrop acid
Drop acid
 
Mongodb lab
Mongodb labMongodb lab
Mongodb lab
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
 
Webinar: Enterprise Data Management in the Era of MongoDB and Data Lakes
Webinar: Enterprise Data Management in the Era of MongoDB and Data LakesWebinar: Enterprise Data Management in the Era of MongoDB and Data Lakes
Webinar: Enterprise Data Management in the Era of MongoDB and Data Lakes
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDB
 
Jumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppJumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB App
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
MongoDB in FS
MongoDB in FSMongoDB in FS
MongoDB in FS
 
Agility and Scalability with MongoDB
Agility and Scalability with MongoDBAgility and Scalability with MongoDB
Agility and Scalability with MongoDB
 
Dynamo vs Mongo
Dynamo vs MongoDynamo vs Mongo
Dynamo vs Mongo
 
Compare DynamoDB vs. MongoDB
Compare DynamoDB vs. MongoDBCompare DynamoDB vs. MongoDB
Compare DynamoDB vs. MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
 
Case study of Rujhaan.com (A social news app )
Case study of Rujhaan.com (A social news app )Case study of Rujhaan.com (A social news app )
Case study of Rujhaan.com (A social news app )
 
Sharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data LessonsSharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data Lessons
 
Introducing MongoDB into your Organization
Introducing MongoDB into your OrganizationIntroducing MongoDB into your Organization
Introducing MongoDB into your Organization
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
 

Kürzlich hochgeladen

Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
React 19: Revolutionizing Web Development
React 19: Revolutionizing Web DevelopmentReact 19: Revolutionizing Web Development
React 19: Revolutionizing Web DevelopmentBOSC Tech Labs
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageDista
 
New ThousandEyes Product Features and Release Highlights: March 2024
New ThousandEyes Product Features and Release Highlights: March 2024New ThousandEyes Product Features and Release Highlights: March 2024
New ThousandEyes Product Features and Release Highlights: March 2024ThousandEyes
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Vectors are the new JSON in PostgreSQL (SCaLE 21x)
Vectors are the new JSON in PostgreSQL (SCaLE 21x)Vectors are the new JSON in PostgreSQL (SCaLE 21x)
Vectors are the new JSON in PostgreSQL (SCaLE 21x)Jonathan Katz
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
How to Improve the Employee Experience? - HRMS Software
How to Improve the Employee Experience? - HRMS SoftwareHow to Improve the Employee Experience? - HRMS Software
How to Improve the Employee Experience? - HRMS SoftwareNYGGS Automation Suite
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdfMeon Technology
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 

Kürzlich hochgeladen (20)

Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
React 19: Revolutionizing Web Development
React 19: Revolutionizing Web DevelopmentReact 19: Revolutionizing Web Development
React 19: Revolutionizing Web Development
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
 
New ThousandEyes Product Features and Release Highlights: March 2024
New ThousandEyes Product Features and Release Highlights: March 2024New ThousandEyes Product Features and Release Highlights: March 2024
New ThousandEyes Product Features and Release Highlights: March 2024
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Vectors are the new JSON in PostgreSQL (SCaLE 21x)
Vectors are the new JSON in PostgreSQL (SCaLE 21x)Vectors are the new JSON in PostgreSQL (SCaLE 21x)
Vectors are the new JSON in PostgreSQL (SCaLE 21x)
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
How to Improve the Employee Experience? - HRMS Software
How to Improve the Employee Experience? - HRMS SoftwareHow to Improve the Employee Experience? - HRMS Software
How to Improve the Employee Experience? - HRMS Software
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdf
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 

No SQL : Which way to go? Presented at DDDMelbourne 2015

  • 1. NoSQL: Which way to go? DDDMelbourne2015 HimanshuDesai,AhmedElharouny&DanielJanczak
  • 3. About us • Himanshu Desai (@H_Desai) • Ahmed Elharouny(@Harouny) • Daniel Janczak (@DanielJanczak) And we all work for Readify
  • 4. Page Why NoSQL? Scale Pros NoSQL technologies can offer more scalability than relational databases Cons Often lose some benefits of relational databases e.g. database-wide transactions Better Formats Pros Avoiding ORMs Cons Limited BI tooling, Data hard to share outside the application Work in more flexible ways Pros No fixed schemas Cons Fixed schemas help prevent errors
  • 5. Page Document Database Database CollectionsCollections Database { “title”: “Justin …”, “genre”: “Pop”, “price”: 36 } Document 1 { “title”: “Don’t Spe..”, “genre”: “Techno”, “price”: 42.99 } Document 2 { “numberOfSongs”: 2, “last”: “Jan 1, 2015” } Document 3 Request Application { }
  • 7. What is RavenDB? › Open source NoSQL database for .NET › Developed by Hibernating Rhinos Ltd › Available › As a standalone package › As embedded version › On Azure and Amazon
  • 8. Schema-free Store data as Plain Old C# Object (POCO) Or directly as JSON var author = new Author { Name = "George Martin", Books = new[] { new Book {Title = "A Game of Thrones"}, new Book {Title = "A Clash of Kings"} } }; session.Store(author); { "Name": "George Martin", "Books": [ { "Title": "A Game of Thrones", "Genre": "Fantasy" }, { "Title": "A Clash of Kings", "Genre": "Fantasy } ] }
  • 9. Scalable › Replication › “Keepcopiesofmydatasomewhereelse” › Sharding › “Splitmyhugedatabaseintosmallerparts” › Multi-tenancy › “Singleinstanceservesmultiplecustomers=manydatabasesper server”
  • 10. Extensible › Useexisting bundles › Compression › Encryption › Expiration › PeriodicExport › Quotas › Replication › ScriptedIndex › SQLReplication › Versioning › Orwriteyour ownplugins › Triggers › Codecs › Tasks › Compilation Extensions › AnalyzerGenerators › Databaseconfiguration › Customsorters
  • 11. Easy to use › .NETandJAVAclient › LINQtoquerydata › RESTAPI › GEThttp://localhost:8080/docs/bobs_address › PUThttp://localhost:8080/docs/bobs_address -d"{FirstName:'Bob', LastName:'Smith',Address:'5ElmSt'}“ › Andsoon…
  • 12. Easy to manage › .Built-inmanagementtool–noneedtodownloadanythingextra
  • 13. Optimized › Transactional(ACID)ondocumentoperations › InplainEnglish“yourdataissafe” › ButonlyBASEforqueries › “BasicallyAvailable,Softstate,EventualConsistency” › InplainEnglish: › youwillalwaysgettheresultsofyourqueriesasfastaspossible › buttheresultswon’talwaysbeuptodateuntildatabasefinishes indexing › Ifyouwantthemuptodate,youhavetodemanditexplicitly
  • 14. Eventual consistency Good or bad ? Newspaper Good! Very few writes, thousands of reads, doesn’t have to be immediate Product signup Good! All applicant information held together Banking system What if the credits and debits sometimes don’t match? Patient drug monitoring What if the drug doses are not updated on time?
  • 15. Our test data public class Author { public string Name {get; set;} public string Surname {get; set;} public Book[] Books {get; set;} } public class Book { public string Title {get; set;} public string Genre {get; set;} public DateTime? PublishedOn {get; set;} public decimal? Price {get; set;} }
  • 16. Our test data continues… • George Martin • A Game of Thrones, Fantasy, 6/8/1996, $12.34 • A Clash of Kings, Fantasy, 16/11/1998 • Dan Simmons • Hyperion, Science Fiction, 1/1/1989, $34.56 • Terror, Thriller, 8/1/2007, $23.45 • John Tolkien • Hobbit, Fantasy, 21/9/1937, $12.34 • Stephen King • The Stand, Horror, 1/9/1978, $12.34
  • 17. A quick look at code Code samples: https://github.com/danieljanczak/ddd-melb2015-ravendb-samples
  • 19. A scalable, high-performance, open source, schema-free, document- oriented database. - mongodb.org What is MongoDB?
  • 21. MongoDBFeatures The best features of key/values stores, document databases and relational databases in one. • Open source
  • 22. MongoDB Features The best features of key/values stores, document databases and relational databases in one. • Open source • Cross platform
  • 23. The best features of key/values stores, document databases and relational databases in one. MongoDB Features • Open source • Cross platform • Strong indexing
  • 24. The best features of key/values stores, document databases and relational databases in one. MongoDB Features • Open source • Cross platform • Strong indexing • Strong query language
  • 25. The best features of key/values stores, document databases and relational databases in one. MongoDB Features • Open source • Cross platform • Strong indexing • Strong query language • Replication
  • 26. The best features of key/values stores, document databases and relational databases in one. MongoDB Features • Open source • Cross platform • Strong indexing • Strong query language • Replication • Sharding
  • 27. The best features of key/values stores, document databases and relational databases in one. MongoDB Features • Open source • Cross platform • Strong indexing • Strong query language • Replication • Sharding • Native drivers
  • 28. The best features of key/values stores, document databases and relational databases in one. MongoDB Features • Open source • Cross platform • Strong indexing • Strong query language • Replication • Sharding • Native drivers • File storage (GridFS)
  • 29. The best features of key/values stores, document databases and relational databases in one. MongoDB Features • Open source • Cross platform • Strong indexing • Strong query language • Replication • Sharding • Native drivers • File storage (GridFS) • Aggregation framework + MapReduce
  • 30. MongoDB Getting Started 1 DOWNLOAD MongoDB 64 Bit for Windows (Link) 2 Create Data Directory 3 Start MongoDB
  • 33. How would you access it? Application Database Collections Stored Procedures Triggers UDFs Documents Libraries: .NET, JavaScript, Node.js, Python, … REST Collections Database
  • 34. DocumentDB Working with data RESTful access methods For Create/Read/Update/Delete (CRUD) operations DocumentDB SQL A query language with SQL- derived syntax Example: SELECT c.Books FROM Authors c WHERE c.name = “George" Executing logic in the DB ( Javascript) Stored procedures Triggers User-defined functions (UDFs) - Allow extending DocumentDB SQL
  • 35. Sharding and Transaction Collection Collection Collection Database JSON JSON JSON JSON JSON JSON JSON JSON Collection JSON JSON JSON The unit of Sharding is a collection is a collection Atomic transactions can span only a single collection collection
  • 36. .NET Development • You need following from the portal after provision a database • Endpoint Url • Authorization key • Nu-get package • Install-Package Microsoft.Azure.DocumentDB • Use them to create DocumentClient
  • 37. Demo
  • 39. In a nutshell - ACID • RavenDB • Fully transactional writes on document level, even between collections • Reads use eventual consistency • Support for DTS • MongoDB • Only supports ACID transactions at the document level. • Multi-collection (table) transactions not supported. • Users can choose the level of consistency using (WriteConcern and ReadPreference) • DocumentDB • Full ACID support on the collection level • 4 levels of consistency, Extremely rich query model.
  • 40. In a nutshell - availability and tooling • RavenDB • On-prem (Windows), Cloud (RavenHQ) on Azure and Amazon, Embedded version / unit testing • Built in web based Management Studio • .NET and JAVA drivers, REST API • Possible access through LinqPad • MongoDB • On-prem (Windows, Linx, Mac), Cloud (i.e MongoLab) • MongoDB Cloud Manager (monitoring, automated management) • Mongo Shell • Lots of 3rd party GUIs i.e. Robomongo • DocumentDB • Accessed from virtually “any” system. Available in “Azure” only at this point. • Azure Web Portal • DocumentDB Studio • LinqPad • SDK available for various platform and REST based access
  • 41. In a nutshell – querying and indexing • RavenDB • Only very basic queries supported without static indexes • Map-reduce • Full text search • Eventual consistency by default • MongoDB • Strong indexing (_id indexed by default, custom indexes, compound, unique, text). Async indexing. • Query from primary by default (Strong consistency) • Query from “nearest” if needed (Eventual consistency) • When writing you choose when to consider write operation successful. • DocumentDB • Very rich query model – Supports Linq to objects, Lambda expression and SQL style syntax. Supports Stored procedure, triggers and UDFs • Auto index by default. • Support lazy indexing if required. • 4 levels of consistency to choose from (Strong, Session, Bounded Stalesness,Eventual consistency
  • 42. In a nutshell - performance • RavenDB • Writes directly to disk (safety over speed) • Indexing in the background • Query results are instantly available in indexes • May need to wait for specific update • MongoDB • TCP/IP based communication. • Uses BSON (lightweight, traversable, efficient). • MMAPv1 storage engine uses OS memory mapped files. • Wiredtiger storage engine (7,000,000 op/second 28 threads). • Choose level of performance vs consistency. • DocumentDB • 3 Levels of performance offered. • Normalised CPU, memory, Disk and network as Request Units (RU) • TCP/HTTPS based access available
  • 43. In a nutshell – gotchas! • RavenDB • Need to reset underlying Lucene indexes – they do crash • Database defaults (winning numbers: 15, 50, 16384; 128, 1024) • Static indexes • Eventual consistency • MongoDB • 32-bit limitations • Max document size 16 MB • Modeling currency • DocumentDB • Max response size : 1MB • Max request size including attachment: 512KB. • Consistency is set at database level not at collection level.