SlideShare a Scribd company logo
.NET
User
Group
Bern
Roger Rudin
bbv Software Services AG
roger.rudin@bbv.ch
Agenda
– What is NoSQL
– Understanding the Motivation behind NoSQL
– MongoDB: A Document Oriented Database
– NoSQL Use Cases
What is NoSQL?
NoSQL = Not only SQL
NoSQL Definition http://nosql-database.org/
NoSQL DEFINITION: Next Generation Databases mostly
addressing some of the points: being non-relational,
distributed, open-source and horizontal scalable. The original
intention has been modern web-scale databases. The
movement began early 2009 and is growing rapidly. Often
more characteristics apply as: schema-free, easy replication
support, simple API, eventually consistent /BASE (not ACID),
a huge data amount, and more. So the misleading
term "nosql" (the community now translates it mostly with
"not only sql") should be seen as an alias to something like
the definition above.
Who Uses NoSQL?
• Twitter uses DBFlock/MySQL and Cassandra
• Cassandra is an open source project from Facebook
• Digg, Reddit use Cassandra
• bit.ly, foursquare, sourceforge, and New York Times use
MongoDB
• Adobe, Alibaba, Ebay, use Hadoop
UNDERSTANDING THE
MOTIVATION BEHIND NOSQL
Why SQL sucks..
• O/R mapping (also known as Impedance Mismatch)
• Data-Model changes are hard and expensive
• SQL database are designed for high throughput, not
low latency
• SQL Databases do no scale out well
• Microsoft, Oracle, and IBM charge big bucks for
databases
– And then you need to hire a database admin
• Take it from the context of Google, Twitter, Facebook
and Amazon.
– Your databases are among the biggest in the world and
nobody pays you for that feature
– Wasting profit!!!
What has NoSQL done?
• Implemented the most common use cases
as a piece of software
• Designed for scalability and performance
Visual Guide To NoSQL
http://blog.nahurst.com/visual-guide-to-nosql-systems
NoSQL Data Models
• Key-Value
• Document-Oriented
• Column Oriented/Tabular
MONGODB: A DOCUMENT
ORIENTED DATABASE
NoSQL Data Model: Document
Oriented
• Data is stored as “documents”
• We are not talking about Word documents
• Comparable to Aggregates in DDD
• It means mostly schema free structured data
• Can be queried
• Is easily mapped to OO systems (Domain
Model, DDD)
• No join need to implement via programming
Network Communications
• REST/JSON
• TCP/BSON (ClientDriver)
BSON [bee · sahn], short for Binary JSON, is a binary-en-
coded serialization of JSON-like documents. Like JSON,
BSON supports the embedding of documents and arrays
within other documents and arrays. BSON also contains
extensions that allow representation of data types that
are not part of the JSON spec. For example, BSON has a
Date type and a BinData type.
Client Drivers (Apache License)
• MongoDB currently has client support for the following
programming languages:
• C
• C++
• Erlang
• Haskell
• Java
• Javascript
• .NET (C# F#, PowerShell, etc)
• Perl
• PHP
• Python
• Ruby
• Scala
Collections vs. Capped Collection
(Table in SQL)
• Collections
• blog.posts
• blog.comments
• forum.users
• etc.
• Capped collections (ring buffer)
• Logging
• Caching
• Archiving
db.createCollection("log", {capped: true, size:
<bytes>, max: <docs>});
Indexes
• Every field in the document can be indexed
• Simple Indexes:
db.cities.ensureIndex({city: 1});
• Compound indexes:
db.cities.ensureIndex({city: 1, zip: 1});
• Unique indexes:
db.cities.ensureIndex({city: 1, zip: 1},
{unique: true});
• Sort order: 1 = descending, -1 = ascending
Einführung in MongoDB
Relations
• ObjectId
db.users.insert(
{name: "Umbert", car_id: ObjectId("<GUID>")});
• DBRef
db.users.insert(
{name: "Umbert", car: new DBRef("cars“,
ObjectId("<GUID>")});
db.users.findOne(
{name: "Umbert"}).car.fetch().name;
Queries (1)
Queries (Regular Expressions)
{field: /regular.*expression/i}
// get all cities that start with “atl”
and end on “a” (e.g. atlanta)
db.cities.count({city: /atl.*a/i});
Queries (2) : LINQ
https://github.com/craiggwilson/fluent-mongo
Equals
x => x.Age == 21 will translate to {"Age": 21}
Greater Than, $gt:
x => x.Age > 18 will translate to {"Age": {$gt: 18}}
Greater Than Or Equal, $gte:
x => x.Age >= 18 will translate to {"Age": {$gte: 18}}
Less Than, $lt:
x => x.Age < 18 will translate to {"Age": {$lt: 18}}
Less Than Or Equal, $lte:
x => x.Age <= 18 will translate to {"Age": {$lte: 18}}
Not Equal, $ne:
x => x.Age != 18 will translate to {"Age": {$ne: 18}}
Atomic Operations (Optimistic
Locking)
• Update if current:
• Fetch the object.
• Modify the object locally.
• Send an update request that says "update the object
to this new value if it still matches its old value".
Atomic Operations: Sample
> t=db.inventory
> s = t.findOne({sku:'abc'})
{"_id" : "49df4d3c9664d32c73ea865a" , "sku" : "abc" , "qty" : 1}
> t.update({sku:"abc",qty:{$gt:0}}, { $inc : { qty : -1 } } ) ;
> db.$cmd.findOne({getlasterror:1})
{"err" : , "updatedExisting" : true , "n" : 1 , "ok" : 1} // it has worked
> t.update({sku:"abcz",qty:{$gt:0}}, { $inc : { qty : -1 } } ) ;
>db.$cmd.findOne({getlasterror:1})
{"err" : , "updatedExisting" : false , "n" : 0 , "ok" : 1} // did not work
Atomic Operations: multiple
items
db.products.update(
{cat: “boots”, $atomic: 1},
{$inc: {price: 10.0}},
false, //no upsert
true //update multiple
);
Replica set (1)
• Automatic failover
• Automatic recovery of servers that were
offline
• Distribution over more than one
Datacenter
• Automatic nomination of a new Master
Server in case of a failure
• Up to 7 server in one replica set
ReplicaSet
RECOVERING
Replica set (2)
PRIMARY
DOWN
PRIMARY
Mongo Sharding
• Partitioning data across multiple physical servers to
provide application scale-out
• Can distribute databases, collections or objects in a
collection
• Choose how you partition data (shardkey)
• Balancing, migrations, management all automatic
• Range based
• Can convert from single master to sharded system with
0 downtime
• Often works in conjunction with object replication
(failover)
Sharding-Cluster
Map Reduce
http://www.joelonsoftware.com/items/2006/08/01.html
• It is a two step calculation where one
step is used to simplify the data, and the
second step is used to summarize the
data
Map Reduce Sample
Map Reduce using LINQ
https://github.com/craiggwilson/fluent-mongo/wiki/Map-Reduce
• LINQ is by far an easier way to compose map-reduce functions.
// Compose a map reduce to get the sum everyone's ages.
var sum = collection.AsQueryable().Sum(x => x.Age);
// Compose a map reduce to get the age range of everyone
grouped by the first letter of their last name.
var ageRanges =
from p in collection.AsQueryable()
group p by p.LastName[0] into g
select new
{
FirstLetter = g.Key,
AverageAge = g.Average(x => x.Age),
MinAge = g.Min(x => x.Age),
MaxAge = g.Max(x => x.Age)
};
Store large Files: GridFS
• The database supports native storage of
binary data within BSON objects (limited in
size 4 – 16 MB).
• GridFS is a specification for storing large
files in MongoDB
• Comparable to Amazon S3 online storage
service when using it in combination with
replication and sharding
Performance
On MySql, SourceForge was reaching its limits of
performance at its current user load. Using some of
the easy scale-out options in MongoDB, they fully
replaced MySQL and found MongoDB could handle
the current user load easily. In fact, after some
testing, they found their site can now handle 100
times the number of users it currently supports.
It means you can charge a lot less per user of
your application and get the same revenue. Think
about it.
Performance
http://www.michaelckennedy.net/blog/2010/04/29/MongoDBVsSQLServer2008PerformanceShowdown.aspx
• It’s the inserts where the differences are most
obvious between MongoDB and SQL Server
(about 30x-50x faster than SQL Server)
Administration: MongoVUE
(Windows)
Administration: Monitoring
• MongoDB
Monitoring Service
NOSQL USE CASES
Use Cases: Well suited
• Archiving and event logging
• Document and Content Management Systems
• E-Commerce
• Gaming. High performance small read/writes,
geospatial indexes
• High volume problems
• Mobile. Specifically, the server-side
infrastructure of mobile systems
• Projects using iterative/agile development
methodologies
• Real-time stats/analytics
Use Cases: Less Well Suited
• Systems with a heavy emphasis on
complex transactions such as banking
systems and accounting (multi-object
transactions)
• Traditional Non-Realtime Data
Warehousing
• Problems requiring SQL
Questions?
roger.rudin@bbv.ch
Ad

More Related Content

Similar to Einführung in MongoDB (20)

NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and Workshop
AhmedabadJavaMeetup
 
MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...
Ram Murat Sharma
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011
bostonrb
 
MongoDB is a document database. It stores data in a type of JSON format calle...
MongoDB is a document database. It stores data in a type of JSON format calle...MongoDB is a document database. It stores data in a type of JSON format calle...
MongoDB is a document database. It stores data in a type of JSON format calle...
amintafernandos
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDB
Apaichon Punopas
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
Webinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverWebinar: What's new in the .NET Driver
Webinar: What's new in the .NET Driver
MongoDB
 
Couchbas for dummies
Couchbas for dummiesCouchbas for dummies
Couchbas for dummies
Qureshi Tehmina
 
Scala+data
Scala+dataScala+data
Scala+data
Samir Bessalah
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
S.Shayan Daneshvar
 
מיכאל
מיכאלמיכאל
מיכאל
sqlserver.co.il
 
Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database, Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database,
BRIJESH KUMAR
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
NoSQLmatters
 
AI與大數據數據處理 Spark實戰(20171216)
AI與大數據數據處理 Spark實戰(20171216)AI與大數據數據處理 Spark實戰(20171216)
AI與大數據數據處理 Spark實戰(20171216)
Paul Chao
 
Latinoware
LatinowareLatinoware
Latinoware
kchodorow
 
No sql Database
No sql DatabaseNo sql Database
No sql Database
mymail2ashok
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and Workshop
AhmedabadJavaMeetup
 
MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...
Ram Murat Sharma
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011
bostonrb
 
MongoDB is a document database. It stores data in a type of JSON format calle...
MongoDB is a document database. It stores data in a type of JSON format calle...MongoDB is a document database. It stores data in a type of JSON format calle...
MongoDB is a document database. It stores data in a type of JSON format calle...
amintafernandos
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDB
Apaichon Punopas
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
Webinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverWebinar: What's new in the .NET Driver
Webinar: What's new in the .NET Driver
MongoDB
 
Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database, Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database,
BRIJESH KUMAR
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
NoSQLmatters
 
AI與大數據數據處理 Spark實戰(20171216)
AI與大數據數據處理 Spark實戰(20171216)AI與大數據數據處理 Spark實戰(20171216)
AI與大數據數據處理 Spark實戰(20171216)
Paul Chao
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 

More from NETUserGroupBern (20)

Large Language Models, Data & APIs - Integrating Generative AI Power into you...
Large Language Models, Data & APIs - Integrating Generative AI Power into you...Large Language Models, Data & APIs - Integrating Generative AI Power into you...
Large Language Models, Data & APIs - Integrating Generative AI Power into you...
NETUserGroupBern
 
AAD und .NET
AAD und .NETAAD und .NET
AAD und .NET
NETUserGroupBern
 
SHIFT LEFT WITH DEVSECOPS
SHIFT LEFT WITH DEVSECOPSSHIFT LEFT WITH DEVSECOPS
SHIFT LEFT WITH DEVSECOPS
NETUserGroupBern
 
Securing .NET Core, ASP.NET Core applications
Securing .NET Core, ASP.NET Core applicationsSecuring .NET Core, ASP.NET Core applications
Securing .NET Core, ASP.NET Core applications
NETUserGroupBern
 
Application Security in ASP.NET Core
Application Security in ASP.NET CoreApplication Security in ASP.NET Core
Application Security in ASP.NET Core
NETUserGroupBern
 
Ruby und Rails für .NET Entwickler
Ruby und Rails für .NET EntwicklerRuby und Rails für .NET Entwickler
Ruby und Rails für .NET Entwickler
NETUserGroupBern
 
Einführung in RavenDB
Einführung in RavenDBEinführung in RavenDB
Einführung in RavenDB
NETUserGroupBern
 
What Doctors Can Teach Us on Continuous Learning
What Doctors Can Teach Us on Continuous LearningWhat Doctors Can Teach Us on Continuous Learning
What Doctors Can Teach Us on Continuous Learning
NETUserGroupBern
 
Entity Framework Core - Der Umstieg auf Core
Entity Framework Core - Der Umstieg auf CoreEntity Framework Core - Der Umstieg auf Core
Entity Framework Core - Der Umstieg auf Core
NETUserGroupBern
 
Weiches Zeugs für harte Jungs und Mädels
Weiches Zeugs für harte Jungs und MädelsWeiches Zeugs für harte Jungs und Mädels
Weiches Zeugs für harte Jungs und Mädels
NETUserGroupBern
 
Änderungen im Cardinality Estimator SQL Server 2014
Änderungen im Cardinality Estimator SQL Server 2014Änderungen im Cardinality Estimator SQL Server 2014
Änderungen im Cardinality Estimator SQL Server 2014
NETUserGroupBern
 
Rest Fundamentals
Rest FundamentalsRest Fundamentals
Rest Fundamentals
NETUserGroupBern
 
Refactoring: Mythen & Fakten
Refactoring: Mythen & FaktenRefactoring: Mythen & Fakten
Refactoring: Mythen & Fakten
NETUserGroupBern
 
AngularJs
AngularJsAngularJs
AngularJs
NETUserGroupBern
 
Pragmatische Anforderungen
Pragmatische AnforderungenPragmatische Anforderungen
Pragmatische Anforderungen
NETUserGroupBern
 
What the hell is PowerShell?
What the hell is PowerShell?What the hell is PowerShell?
What the hell is PowerShell?
NETUserGroupBern
 
Know your warm up
Know your warm upKnow your warm up
Know your warm up
NETUserGroupBern
 
BDD mit Machine.Specifications (MSpec)
BDD mit Machine.Specifications (MSpec)BDD mit Machine.Specifications (MSpec)
BDD mit Machine.Specifications (MSpec)
NETUserGroupBern
 
Versionskontrolle mit Git
Versionskontrolle mit GitVersionskontrolle mit Git
Versionskontrolle mit Git
NETUserGroupBern
 
.NETworking Workshop Design Thinking
.NETworking Workshop Design Thinking.NETworking Workshop Design Thinking
.NETworking Workshop Design Thinking
NETUserGroupBern
 
Large Language Models, Data & APIs - Integrating Generative AI Power into you...
Large Language Models, Data & APIs - Integrating Generative AI Power into you...Large Language Models, Data & APIs - Integrating Generative AI Power into you...
Large Language Models, Data & APIs - Integrating Generative AI Power into you...
NETUserGroupBern
 
Securing .NET Core, ASP.NET Core applications
Securing .NET Core, ASP.NET Core applicationsSecuring .NET Core, ASP.NET Core applications
Securing .NET Core, ASP.NET Core applications
NETUserGroupBern
 
Application Security in ASP.NET Core
Application Security in ASP.NET CoreApplication Security in ASP.NET Core
Application Security in ASP.NET Core
NETUserGroupBern
 
Ruby und Rails für .NET Entwickler
Ruby und Rails für .NET EntwicklerRuby und Rails für .NET Entwickler
Ruby und Rails für .NET Entwickler
NETUserGroupBern
 
What Doctors Can Teach Us on Continuous Learning
What Doctors Can Teach Us on Continuous LearningWhat Doctors Can Teach Us on Continuous Learning
What Doctors Can Teach Us on Continuous Learning
NETUserGroupBern
 
Entity Framework Core - Der Umstieg auf Core
Entity Framework Core - Der Umstieg auf CoreEntity Framework Core - Der Umstieg auf Core
Entity Framework Core - Der Umstieg auf Core
NETUserGroupBern
 
Weiches Zeugs für harte Jungs und Mädels
Weiches Zeugs für harte Jungs und MädelsWeiches Zeugs für harte Jungs und Mädels
Weiches Zeugs für harte Jungs und Mädels
NETUserGroupBern
 
Änderungen im Cardinality Estimator SQL Server 2014
Änderungen im Cardinality Estimator SQL Server 2014Änderungen im Cardinality Estimator SQL Server 2014
Änderungen im Cardinality Estimator SQL Server 2014
NETUserGroupBern
 
Refactoring: Mythen & Fakten
Refactoring: Mythen & FaktenRefactoring: Mythen & Fakten
Refactoring: Mythen & Fakten
NETUserGroupBern
 
Pragmatische Anforderungen
Pragmatische AnforderungenPragmatische Anforderungen
Pragmatische Anforderungen
NETUserGroupBern
 
What the hell is PowerShell?
What the hell is PowerShell?What the hell is PowerShell?
What the hell is PowerShell?
NETUserGroupBern
 
BDD mit Machine.Specifications (MSpec)
BDD mit Machine.Specifications (MSpec)BDD mit Machine.Specifications (MSpec)
BDD mit Machine.Specifications (MSpec)
NETUserGroupBern
 
.NETworking Workshop Design Thinking
.NETworking Workshop Design Thinking.NETworking Workshop Design Thinking
.NETworking Workshop Design Thinking
NETUserGroupBern
 
Ad

Recently uploaded (20)

Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Ad

Einführung in MongoDB

  • 2. Agenda – What is NoSQL – Understanding the Motivation behind NoSQL – MongoDB: A Document Oriented Database – NoSQL Use Cases
  • 3. What is NoSQL? NoSQL = Not only SQL
  • 4. NoSQL Definition http://nosql-database.org/ NoSQL DEFINITION: Next Generation Databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontal scalable. The original intention has been modern web-scale databases. The movement began early 2009 and is growing rapidly. Often more characteristics apply as: schema-free, easy replication support, simple API, eventually consistent /BASE (not ACID), a huge data amount, and more. So the misleading term "nosql" (the community now translates it mostly with "not only sql") should be seen as an alias to something like the definition above.
  • 5. Who Uses NoSQL? • Twitter uses DBFlock/MySQL and Cassandra • Cassandra is an open source project from Facebook • Digg, Reddit use Cassandra • bit.ly, foursquare, sourceforge, and New York Times use MongoDB • Adobe, Alibaba, Ebay, use Hadoop
  • 7. Why SQL sucks.. • O/R mapping (also known as Impedance Mismatch) • Data-Model changes are hard and expensive • SQL database are designed for high throughput, not low latency • SQL Databases do no scale out well • Microsoft, Oracle, and IBM charge big bucks for databases – And then you need to hire a database admin • Take it from the context of Google, Twitter, Facebook and Amazon. – Your databases are among the biggest in the world and nobody pays you for that feature – Wasting profit!!!
  • 8. What has NoSQL done? • Implemented the most common use cases as a piece of software • Designed for scalability and performance
  • 9. Visual Guide To NoSQL http://blog.nahurst.com/visual-guide-to-nosql-systems
  • 10. NoSQL Data Models • Key-Value • Document-Oriented • Column Oriented/Tabular
  • 12. NoSQL Data Model: Document Oriented • Data is stored as “documents” • We are not talking about Word documents • Comparable to Aggregates in DDD • It means mostly schema free structured data • Can be queried • Is easily mapped to OO systems (Domain Model, DDD) • No join need to implement via programming
  • 13. Network Communications • REST/JSON • TCP/BSON (ClientDriver) BSON [bee · sahn], short for Binary JSON, is a binary-en- coded serialization of JSON-like documents. Like JSON, BSON supports the embedding of documents and arrays within other documents and arrays. BSON also contains extensions that allow representation of data types that are not part of the JSON spec. For example, BSON has a Date type and a BinData type.
  • 14. Client Drivers (Apache License) • MongoDB currently has client support for the following programming languages: • C • C++ • Erlang • Haskell • Java • Javascript • .NET (C# F#, PowerShell, etc) • Perl • PHP • Python • Ruby • Scala
  • 15. Collections vs. Capped Collection (Table in SQL) • Collections • blog.posts • blog.comments • forum.users • etc. • Capped collections (ring buffer) • Logging • Caching • Archiving db.createCollection("log", {capped: true, size: <bytes>, max: <docs>});
  • 16. Indexes • Every field in the document can be indexed • Simple Indexes: db.cities.ensureIndex({city: 1}); • Compound indexes: db.cities.ensureIndex({city: 1, zip: 1}); • Unique indexes: db.cities.ensureIndex({city: 1, zip: 1}, {unique: true}); • Sort order: 1 = descending, -1 = ascending
  • 18. Relations • ObjectId db.users.insert( {name: "Umbert", car_id: ObjectId("<GUID>")}); • DBRef db.users.insert( {name: "Umbert", car: new DBRef("cars“, ObjectId("<GUID>")}); db.users.findOne( {name: "Umbert"}).car.fetch().name;
  • 20. Queries (Regular Expressions) {field: /regular.*expression/i} // get all cities that start with “atl” and end on “a” (e.g. atlanta) db.cities.count({city: /atl.*a/i});
  • 21. Queries (2) : LINQ https://github.com/craiggwilson/fluent-mongo Equals x => x.Age == 21 will translate to {"Age": 21} Greater Than, $gt: x => x.Age > 18 will translate to {"Age": {$gt: 18}} Greater Than Or Equal, $gte: x => x.Age >= 18 will translate to {"Age": {$gte: 18}} Less Than, $lt: x => x.Age < 18 will translate to {"Age": {$lt: 18}} Less Than Or Equal, $lte: x => x.Age <= 18 will translate to {"Age": {$lte: 18}} Not Equal, $ne: x => x.Age != 18 will translate to {"Age": {$ne: 18}}
  • 22. Atomic Operations (Optimistic Locking) • Update if current: • Fetch the object. • Modify the object locally. • Send an update request that says "update the object to this new value if it still matches its old value".
  • 23. Atomic Operations: Sample > t=db.inventory > s = t.findOne({sku:'abc'}) {"_id" : "49df4d3c9664d32c73ea865a" , "sku" : "abc" , "qty" : 1} > t.update({sku:"abc",qty:{$gt:0}}, { $inc : { qty : -1 } } ) ; > db.$cmd.findOne({getlasterror:1}) {"err" : , "updatedExisting" : true , "n" : 1 , "ok" : 1} // it has worked > t.update({sku:"abcz",qty:{$gt:0}}, { $inc : { qty : -1 } } ) ; >db.$cmd.findOne({getlasterror:1}) {"err" : , "updatedExisting" : false , "n" : 0 , "ok" : 1} // did not work
  • 24. Atomic Operations: multiple items db.products.update( {cat: “boots”, $atomic: 1}, {$inc: {price: 10.0}}, false, //no upsert true //update multiple );
  • 25. Replica set (1) • Automatic failover • Automatic recovery of servers that were offline • Distribution over more than one Datacenter • Automatic nomination of a new Master Server in case of a failure • Up to 7 server in one replica set
  • 27. Mongo Sharding • Partitioning data across multiple physical servers to provide application scale-out • Can distribute databases, collections or objects in a collection • Choose how you partition data (shardkey) • Balancing, migrations, management all automatic • Range based • Can convert from single master to sharded system with 0 downtime • Often works in conjunction with object replication (failover)
  • 29. Map Reduce http://www.joelonsoftware.com/items/2006/08/01.html • It is a two step calculation where one step is used to simplify the data, and the second step is used to summarize the data
  • 31. Map Reduce using LINQ https://github.com/craiggwilson/fluent-mongo/wiki/Map-Reduce • LINQ is by far an easier way to compose map-reduce functions. // Compose a map reduce to get the sum everyone's ages. var sum = collection.AsQueryable().Sum(x => x.Age); // Compose a map reduce to get the age range of everyone grouped by the first letter of their last name. var ageRanges = from p in collection.AsQueryable() group p by p.LastName[0] into g select new { FirstLetter = g.Key, AverageAge = g.Average(x => x.Age), MinAge = g.Min(x => x.Age), MaxAge = g.Max(x => x.Age) };
  • 32. Store large Files: GridFS • The database supports native storage of binary data within BSON objects (limited in size 4 – 16 MB). • GridFS is a specification for storing large files in MongoDB • Comparable to Amazon S3 online storage service when using it in combination with replication and sharding
  • 33. Performance On MySql, SourceForge was reaching its limits of performance at its current user load. Using some of the easy scale-out options in MongoDB, they fully replaced MySQL and found MongoDB could handle the current user load easily. In fact, after some testing, they found their site can now handle 100 times the number of users it currently supports. It means you can charge a lot less per user of your application and get the same revenue. Think about it.
  • 34. Performance http://www.michaelckennedy.net/blog/2010/04/29/MongoDBVsSQLServer2008PerformanceShowdown.aspx • It’s the inserts where the differences are most obvious between MongoDB and SQL Server (about 30x-50x faster than SQL Server)
  • 38. Use Cases: Well suited • Archiving and event logging • Document and Content Management Systems • E-Commerce • Gaming. High performance small read/writes, geospatial indexes • High volume problems • Mobile. Specifically, the server-side infrastructure of mobile systems • Projects using iterative/agile development methodologies • Real-time stats/analytics
  • 39. Use Cases: Less Well Suited • Systems with a heavy emphasis on complex transactions such as banking systems and accounting (multi-object transactions) • Traditional Non-Realtime Data Warehousing • Problems requiring SQL

Editor's Notes

  • #8: We are entering an age where data is live, hardware cheap and we need a new programming paradigm to access and process the data
  • #9: The new theory is based on the idea that RAM is the storage, Harddisk a backup, and you keep ten’s, hundred’s, if not thousand’s of servers in a LAN In the end results in blazing fast access times and incredible up times
  • #21: i: case insensitive m: multiline x: extended mode
  • #25: No upsert.. Soll das dokument erzeugt werden, wenn es nicht gefunden wurde.
  • #29: Shards meist aus replica sets bestehend Config servern, die die Metadaten des Clusters verwalten Mongos-Prozessen, die als router dienen
  • #31: use techday db.things.insert( { _id: 1, tags: ['dog', 'cat'] } ); db.things.insert( { _id: 2, tags: ['cat'] } ); db.things.insert( { _id: 3, tags: ['mouse', 'dog', 'cat'] } ); db.things.insert( { _id: 4, tags: [] } ); // map function m = function(){ this.tags.forEach( function(z){ emit(z, {count: 1} ); } ); }; // reduce function r = function(key, values){ var total = 0; for (var i = 0; i < values.length; i++) total += values[i].count; return {count: total}; }; res = db.things.mapReduce(m, r, {out: {inline: 1}}); res.find() res.drop()
  • #33: Wie amazon s3 für arme
  • #34: Mit MySQL hatte Sourceforge mit dem aktuellen user load die limite für die geforderte Performance erreicht. Dann haben sie MySQL mit MongoDB erstetzt und haben mit der scale out option den gleichen workload locker handlen können. Nach einigen Tests haben sie dann sogar herausgefunden, das sie jetzt 100 Mal die Menge der Benutzer handeln können. Das heisst, sie haben weniger kosten pro benutzer der applikation bei gleichem Umsatz!
  • #36: Show import from SQL Server
  • #40: Systeme mit hoher gewichtung von komplexen transactionen