SlideShare a Scribd company logo
Istanbul Hackers
Geekly Weekly
Mongo DB
@hserdarb
Why MongoDB?
• Easy to use nosql
• Good for web projects
• Popular 
• High performance (No joins and embedding makes reads and writes fast)
• High availability (Replicated servers with automatic master failover)
• Easy scalability (Automatic sharding)
What’s MongoDB good for?
• Account and user profiles: can store arrays of addresses with ease
• CMS: the flexible schema of MongoDB is great for heterogeneous collections of content types
• Form data: MongoDB makes it easy to evolve structure of form data over time
• Blogs / user-generated content: can keep data with complex relationships together in one object
• Messaging: vary message meta-data easily per message or message type without needing to
maintain separate collections or schemas
• System configuration: just a nice object graph of configuration values, which is very natural in
MongoDB
• Log data of any kind: structured log data is the future
• Graphs: just objects and pointers – a perfect fit
• Location based data: MongoDB understands geo-spatial coordinates and natively supports geo-
spatial indexing
http://blog.mongolab.com/2012/08/why-is-mongodb-wildly-popular/
The Modern Need From Databases
• Easy to use when project is small
• Developing schema less
• When we need scale it must be easy and cheap
• No data loss
• High Availability
RDBMS => MongoDB
RDBMS MongoDB
Table, View Collection
Row JSON Document
Index Index
Join Embeded Document
Partition Shard
Partition Key Shard Key
What is BSON?
• MongoDB uses BSON as the data storage and network transfer format
for "documents".
• Short for Binary JSON
• http://bsonspec.org/
• http://www.mongodb.org/display/DOCS/BSON
Working with Entity Objects
• Things can be really easy for you if you follow these rules for your
entities
• Has a public no-argument constructor
• Has a public get set property for each value you want to have serialized
CRUD
https://github.com/serdarb/IstanbulHackersCodeReviewSample/blob/master/AgileWall.Domain/Repo/BaseRepo.cs
Write Concern
• Acknowledged
• Write operations that use this write concern will wait for acknowledgement from the primary
server before returning.
• Unacknowledged
• Write operations that use this write concern will return as soon as the message is written to
the socket.
• Journaled
• Exceptions are raised for network issues, and server errors; the write operation waits for the
server to group commit to the journal file on disk.
• Replica Acknowledged
• Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the
write operation.
http://docs.mongodb.org/manual/core/write-concern/
http://api.mongodb.org/java/current/com/mongodb/WriteConcern.html
https://github.com/mongodb/mongo-csharp-driver/blob/master/MongoDB.Driver/WriteConcern.cs
Journaling
• Process starts with private view
• Private view writes to journal
• Journal updates shared view
• Shared view updates private view
• Shared view flushes data to disk
http://www.kchodorow.com/blog/2012/10/04/how-mongodbs-journaling-works/
Index
• BasketItems.CreateIndex(“UserId”);
A tip for better indexing
• Run mongodb with notablescan parameter and be sure your your
queries are not making full table scans...
• You get exceptions if a query needs a table scan, it gives you a chance to fix
your indexes on development time.
Map Reduce
Transaction
• MongoDB does not support transactions.
• It is good to use relational databases (oracle, sql server) for this
purpose
• If you are stuck in a situation that needs transactions with MongoDB
you must implement it by your self.
• http://docs.mongodb.org/manual/tutorial/perform-two-phase-commits/
• https://github.com/rystsov/mongodb-transaction-example
Sharding & Replication
Sharding is for scale out, replication is for high availability
Replication
• Copies of your data for data safety
• Asynchronous replication
• Master - Slave model
• Not master-master, when your data change
there are times that you only have one master…
• Statement based
• For example, insert statement send to the
replica and will run there…
• Driver is replica set aware,
• Connection to replica set
mongodb://server1,server2:27017,server2:27018
Sharding (partitioning)
• MongoDB does range based
partitioning
• Name begins with A, B-E, F-H ….
• Shardkey is important!
• Bad shard key choice can cause
too many split and merge
operations on chunks
mongod
mongod
mongod
Replicaset
mongod
mongod
mongod
Replicaset
S1 S2
mongos
mongod
mongod
mongod
Config
Server
Client
1
2
3
4
Sources
• education.10gen.com
• http://openmymind.net/mongodb.pdf
• http://www.mongodb.org/display/DOCS/Introduction
• http://www.mongodb.org/display/DOCS/Padding+Factor
• https://github.com/mongodb/mongo
• http://www.codeproject.com/Articles/273145/Using-MongoDB-with-the-Official-Csharp-Driver
• http://stackoverflow.com/questions/4067197/mongodb-and-joins
• http://www.mongodb.org/display/DOCS/Schema+Design#SchemaDesign-EmbeddingandLinking
• http://docs.mongodb.org/manual/applications/database-references/
• http://www.10gen.com/presentations?programming_lang=46
• https://speakerdeck.com/mongodb/whats-new-in-the-net-driver
• http://learnmongo.com/
• http://www.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/
• http://spp42.com/mongodbde-dogru-index-kullanimi-nasil-kontrol-edilir-i/
• http://bjclark.me/2009/08/nosql-if-only-it-was-that-easy/
• http://reactivemongo.org/

More Related Content

What's hot (20)

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
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
neela madheswari
 
Mongodb tutorial at Easylearning Guru
Mongodb tutorial  at Easylearning GuruMongodb tutorial  at Easylearning Guru
Mongodb tutorial at Easylearning Guru
KCC Software Ltd. & Easylearning.guru
 
Introduction to MongoDB (from Austin Code Camp)
Introduction to MongoDB (from Austin Code Camp)Introduction to MongoDB (from Austin Code Camp)
Introduction to MongoDB (from Austin Code Camp)
Chris Edwards
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic ApproachLiving with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
Jeremy Zawodny
 
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Benefits of using MongoDB: Reduce Complexity & Adapt to ChangesBenefits of using MongoDB: Reduce Complexity & Adapt to Changes
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Alex Nguyen
 
Mongo db workshop # 02
Mongo db workshop # 02Mongo db workshop # 02
Mongo db workshop # 02
FarhatParveen10
 
Mongodb
MongodbMongodb
Mongodb
Scott Motte
 
Challenges with MongoDB
Challenges with MongoDBChallenges with MongoDB
Challenges with MongoDB
Stone Gao
 
Mongo DB
Mongo DBMongo DB
Mongo DB
Karan Kukreja
 
MongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by Examples
Hadi Ariawan
 
Mongo db
Mongo dbMongo db
Mongo db
Akshay Mathur
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
HabileLabs
 
Mango Database - Web Development
Mango Database - Web DevelopmentMango Database - Web Development
Mango Database - Web Development
mssaman
 
MongoDB by Emroz sardar.
MongoDB by Emroz sardar.MongoDB by Emroz sardar.
MongoDB by Emroz sardar.
Emroz Sardar
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
NexThoughts Technologies
 
Migrating from MySQL to MongoDB at Wordnik
Migrating from MySQL to MongoDB at WordnikMigrating from MySQL to MongoDB at Wordnik
Migrating from MySQL to MongoDB at Wordnik
Tony Tam
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
Abhijeet Vaikar
 
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
 
Introduction to MongoDB (from Austin Code Camp)
Introduction to MongoDB (from Austin Code Camp)Introduction to MongoDB (from Austin Code Camp)
Introduction to MongoDB (from Austin Code Camp)
Chris Edwards
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic ApproachLiving with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
Jeremy Zawodny
 
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Benefits of using MongoDB: Reduce Complexity & Adapt to ChangesBenefits of using MongoDB: Reduce Complexity & Adapt to Changes
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Alex Nguyen
 
Challenges with MongoDB
Challenges with MongoDBChallenges with MongoDB
Challenges with MongoDB
Stone Gao
 
MongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by Examples
Hadi Ariawan
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
HabileLabs
 
Mango Database - Web Development
Mango Database - Web DevelopmentMango Database - Web Development
Mango Database - Web Development
mssaman
 
MongoDB by Emroz sardar.
MongoDB by Emroz sardar.MongoDB by Emroz sardar.
MongoDB by Emroz sardar.
Emroz Sardar
 
Migrating from MySQL to MongoDB at Wordnik
Migrating from MySQL to MongoDB at WordnikMigrating from MySQL to MongoDB at Wordnik
Migrating from MySQL to MongoDB at Wordnik
Tony Tam
 

Viewers also liked (13)

TPC-H in MongoDB
TPC-H in MongoDBTPC-H in MongoDB
TPC-H in MongoDB
Aung Thu Rha Hein
 
Mongo sunum
Mongo sunumMongo sunum
Mongo sunum
Tarik Yilmaz
 
Setting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSetting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutes
Sudheer Kondla
 
MongoDB Shard Cluster
MongoDB Shard ClusterMongoDB Shard Cluster
MongoDB Shard Cluster
Anuchit Chalothorn
 
Back to Basics: Build Something Big With MongoDB
Back to Basics: Build Something Big With MongoDB Back to Basics: Build Something Big With MongoDB
Back to Basics: Build Something Big With MongoDB
MongoDB
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced Replication
MongoDB
 
Development to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersDevelopment to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB Clusters
Severalnines
 
Redis & MongoDB: Stop Big Data Indigestion Before It Starts
Redis & MongoDB: Stop Big Data Indigestion Before It StartsRedis & MongoDB: Stop Big Data Indigestion Before It Starts
Redis & MongoDB: Stop Big Data Indigestion Before It Starts
Itamar Haber
 
MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)
MongoSF
 
Why Your MongoDB Needs Redis
Why Your MongoDB Needs RedisWhy Your MongoDB Needs Redis
Why Your MongoDB Needs Redis
Itamar Haber
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101
MongoDB
 
TCP/IP Ağlarda İleri Seviye Paket Analizi – Tshark
TCP/IP Ağlarda İleri Seviye Paket Analizi – TsharkTCP/IP Ağlarda İleri Seviye Paket Analizi – Tshark
TCP/IP Ağlarda İleri Seviye Paket Analizi – Tshark
BGA Cyber Security
 
Database Sharding At Netlog
Database Sharding At NetlogDatabase Sharding At Netlog
Database Sharding At Netlog
Jurriaan Persyn
 
Setting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSetting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutes
Sudheer Kondla
 
Back to Basics: Build Something Big With MongoDB
Back to Basics: Build Something Big With MongoDB Back to Basics: Build Something Big With MongoDB
Back to Basics: Build Something Big With MongoDB
MongoDB
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced Replication
MongoDB
 
Development to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersDevelopment to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB Clusters
Severalnines
 
Redis & MongoDB: Stop Big Data Indigestion Before It Starts
Redis & MongoDB: Stop Big Data Indigestion Before It StartsRedis & MongoDB: Stop Big Data Indigestion Before It Starts
Redis & MongoDB: Stop Big Data Indigestion Before It Starts
Itamar Haber
 
MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)
MongoSF
 
Why Your MongoDB Needs Redis
Why Your MongoDB Needs RedisWhy Your MongoDB Needs Redis
Why Your MongoDB Needs Redis
Itamar Haber
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101
MongoDB
 
TCP/IP Ağlarda İleri Seviye Paket Analizi – Tshark
TCP/IP Ağlarda İleri Seviye Paket Analizi – TsharkTCP/IP Ağlarda İleri Seviye Paket Analizi – Tshark
TCP/IP Ağlarda İleri Seviye Paket Analizi – Tshark
BGA Cyber Security
 
Database Sharding At Netlog
Database Sharding At NetlogDatabase Sharding At Netlog
Database Sharding At Netlog
Jurriaan Persyn
 
Ad

Similar to MongoDB (20)

MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
Jimmy Ray
 
MongoDB : Scaling, Security & Performance
MongoDB : Scaling, Security & PerformanceMongoDB : Scaling, Security & Performance
MongoDB : Scaling, Security & Performance
Sasidhar Gogulapati
 
MongoDB Internals
MongoDB InternalsMongoDB Internals
MongoDB Internals
Siraj Memon
 
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
MongoDB
 
The Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb ClusterThe Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb Cluster
Chris Henry
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDB
MongoDB
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
Chris Westin
 
Introduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQLIntroduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQL
Mayur Patil
 
Drop acid
Drop acidDrop acid
Drop acid
Mike Feltman
 
MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
Aayush Chimaniya
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Stiliyan Kanchev
 
NoSQL and MongoDB
NoSQL and MongoDBNoSQL and MongoDB
NoSQL and MongoDB
Rajesh Menon
 
NoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOONoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOO
James Hollingworth
 
Mongo db
Mongo dbMongo db
Mongo db
Gyanendra Yadav
 
Developing and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST APIDeveloping and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST API
All Things Open
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
Spring data presentation
Spring data presentationSpring data presentation
Spring data presentation
Oleksii Usyk
 
Cassandra Community Webinar: From Mongo to Cassandra, Architectural Lessons
Cassandra Community Webinar: From Mongo to Cassandra, Architectural LessonsCassandra Community Webinar: From Mongo to Cassandra, Architectural Lessons
Cassandra Community Webinar: From Mongo to Cassandra, Architectural Lessons
DataStax
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
foliba
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
HabileLabs
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
Jimmy Ray
 
MongoDB : Scaling, Security & Performance
MongoDB : Scaling, Security & PerformanceMongoDB : Scaling, Security & Performance
MongoDB : Scaling, Security & Performance
Sasidhar Gogulapati
 
MongoDB Internals
MongoDB InternalsMongoDB Internals
MongoDB Internals
Siraj Memon
 
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
MongoDB
 
The Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb ClusterThe Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb Cluster
Chris Henry
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDB
MongoDB
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
Chris Westin
 
Introduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQLIntroduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQL
Mayur Patil
 
NoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOONoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOO
James Hollingworth
 
Developing and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST APIDeveloping and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST API
All Things Open
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
Spring data presentation
Spring data presentationSpring data presentation
Spring data presentation
Oleksii Usyk
 
Cassandra Community Webinar: From Mongo to Cassandra, Architectural Lessons
Cassandra Community Webinar: From Mongo to Cassandra, Architectural LessonsCassandra Community Webinar: From Mongo to Cassandra, Architectural Lessons
Cassandra Community Webinar: From Mongo to Cassandra, Architectural Lessons
DataStax
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
foliba
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
HabileLabs
 
Ad

More from Serdar Buyuktemiz (7)

Nosql & MongoDB
Nosql & MongoDBNosql & MongoDB
Nosql & MongoDB
Serdar Buyuktemiz
 
Front-end First Development Philosophy
Front-end First Development PhilosophyFront-end First Development Philosophy
Front-end First Development Philosophy
Serdar Buyuktemiz
 
Temel web güvenliği
Temel web güvenliğiTemel web güvenliği
Temel web güvenliği
Serdar Buyuktemiz
 
MongoDB ve C# Driver'ı
MongoDB ve C# Driver'ıMongoDB ve C# Driver'ı
MongoDB ve C# Driver'ı
Serdar Buyuktemiz
 
Seo
SeoSeo
Seo
Serdar Buyuktemiz
 
Balanced scorecard
Balanced scorecardBalanced scorecard
Balanced scorecard
Serdar Buyuktemiz
 

Recently uploaded (20)

Introducing the OSA 3200 SP and OSA 3250 ePRC
Introducing the OSA 3200 SP and OSA 3250 ePRCIntroducing the OSA 3200 SP and OSA 3250 ePRC
Introducing the OSA 3200 SP and OSA 3250 ePRC
Adtran
 
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
 
Jira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : IntroductionJira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : Introduction
Ravi Teja
 
The case for on-premises AI
The case for on-premises AIThe case for on-premises AI
The case for on-premises AI
Principled Technologies
 
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 ADr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr. Jimmy Schwarzkopf
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
European Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility TestingEuropean Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility Testing
Julia Undeutsch
 
SDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhereSDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhere
Adtran
 
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Aaryan Kansari
 
New Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDBNew Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDB
ScyllaDB
 
Let’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack CommunityLet’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack Community
SanjeetMishra29
 
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure ModesCognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Dr. Tathagat Varma
 
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
Jasper Oosterveld
 
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyesEnd-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
ThousandEyes
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
UiPath Community Zurich: Release Management and Build Pipelines
UiPath Community Zurich: Release Management and Build PipelinesUiPath Community Zurich: Release Management and Build Pipelines
UiPath Community Zurich: Release Management and Build Pipelines
UiPathCommunity
 
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
 
Co-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using ProvenanceCo-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using Provenance
Paul Groth
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Grannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI ExperiencesGrannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI Experiences
Lauren Parr
 
Introducing the OSA 3200 SP and OSA 3250 ePRC
Introducing the OSA 3200 SP and OSA 3250 ePRCIntroducing the OSA 3200 SP and OSA 3250 ePRC
Introducing the OSA 3200 SP and OSA 3250 ePRC
Adtran
 
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
 
Jira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : IntroductionJira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : Introduction
Ravi Teja
 
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 ADr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr. Jimmy Schwarzkopf
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
European Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility TestingEuropean Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility Testing
Julia Undeutsch
 
SDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhereSDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhere
Adtran
 
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Aaryan Kansari
 
New Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDBNew Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDB
ScyllaDB
 
Let’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack CommunityLet’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack Community
SanjeetMishra29
 
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure ModesCognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Dr. Tathagat Varma
 
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
Jasper Oosterveld
 
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyesEnd-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
ThousandEyes
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
UiPath Community Zurich: Release Management and Build Pipelines
UiPath Community Zurich: Release Management and Build PipelinesUiPath Community Zurich: Release Management and Build Pipelines
UiPath Community Zurich: Release Management and Build Pipelines
UiPathCommunity
 
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
 
Co-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using ProvenanceCo-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using Provenance
Paul Groth
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Grannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI ExperiencesGrannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI Experiences
Lauren Parr
 

MongoDB

  • 2. Why MongoDB? • Easy to use nosql • Good for web projects • Popular  • High performance (No joins and embedding makes reads and writes fast) • High availability (Replicated servers with automatic master failover) • Easy scalability (Automatic sharding)
  • 3. What’s MongoDB good for? • Account and user profiles: can store arrays of addresses with ease • CMS: the flexible schema of MongoDB is great for heterogeneous collections of content types • Form data: MongoDB makes it easy to evolve structure of form data over time • Blogs / user-generated content: can keep data with complex relationships together in one object • Messaging: vary message meta-data easily per message or message type without needing to maintain separate collections or schemas • System configuration: just a nice object graph of configuration values, which is very natural in MongoDB • Log data of any kind: structured log data is the future • Graphs: just objects and pointers – a perfect fit • Location based data: MongoDB understands geo-spatial coordinates and natively supports geo- spatial indexing http://blog.mongolab.com/2012/08/why-is-mongodb-wildly-popular/
  • 4. The Modern Need From Databases • Easy to use when project is small • Developing schema less • When we need scale it must be easy and cheap • No data loss • High Availability
  • 5. RDBMS => MongoDB RDBMS MongoDB Table, View Collection Row JSON Document Index Index Join Embeded Document Partition Shard Partition Key Shard Key
  • 6. What is BSON? • MongoDB uses BSON as the data storage and network transfer format for "documents". • Short for Binary JSON • http://bsonspec.org/ • http://www.mongodb.org/display/DOCS/BSON
  • 7. Working with Entity Objects • Things can be really easy for you if you follow these rules for your entities • Has a public no-argument constructor • Has a public get set property for each value you want to have serialized
  • 9. Write Concern • Acknowledged • Write operations that use this write concern will wait for acknowledgement from the primary server before returning. • Unacknowledged • Write operations that use this write concern will return as soon as the message is written to the socket. • Journaled • Exceptions are raised for network issues, and server errors; the write operation waits for the server to group commit to the journal file on disk. • Replica Acknowledged • Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation. http://docs.mongodb.org/manual/core/write-concern/ http://api.mongodb.org/java/current/com/mongodb/WriteConcern.html https://github.com/mongodb/mongo-csharp-driver/blob/master/MongoDB.Driver/WriteConcern.cs
  • 10. Journaling • Process starts with private view • Private view writes to journal • Journal updates shared view • Shared view updates private view • Shared view flushes data to disk http://www.kchodorow.com/blog/2012/10/04/how-mongodbs-journaling-works/
  • 12. A tip for better indexing • Run mongodb with notablescan parameter and be sure your your queries are not making full table scans... • You get exceptions if a query needs a table scan, it gives you a chance to fix your indexes on development time.
  • 14. Transaction • MongoDB does not support transactions. • It is good to use relational databases (oracle, sql server) for this purpose • If you are stuck in a situation that needs transactions with MongoDB you must implement it by your self. • http://docs.mongodb.org/manual/tutorial/perform-two-phase-commits/ • https://github.com/rystsov/mongodb-transaction-example
  • 15. Sharding & Replication Sharding is for scale out, replication is for high availability
  • 16. Replication • Copies of your data for data safety • Asynchronous replication • Master - Slave model • Not master-master, when your data change there are times that you only have one master… • Statement based • For example, insert statement send to the replica and will run there… • Driver is replica set aware, • Connection to replica set mongodb://server1,server2:27017,server2:27018
  • 17. Sharding (partitioning) • MongoDB does range based partitioning • Name begins with A, B-E, F-H …. • Shardkey is important! • Bad shard key choice can cause too many split and merge operations on chunks mongod mongod mongod Replicaset mongod mongod mongod Replicaset S1 S2 mongos mongod mongod mongod Config Server Client 1 2 3 4
  • 18. Sources • education.10gen.com • http://openmymind.net/mongodb.pdf • http://www.mongodb.org/display/DOCS/Introduction • http://www.mongodb.org/display/DOCS/Padding+Factor • https://github.com/mongodb/mongo • http://www.codeproject.com/Articles/273145/Using-MongoDB-with-the-Official-Csharp-Driver • http://stackoverflow.com/questions/4067197/mongodb-and-joins • http://www.mongodb.org/display/DOCS/Schema+Design#SchemaDesign-EmbeddingandLinking • http://docs.mongodb.org/manual/applications/database-references/ • http://www.10gen.com/presentations?programming_lang=46 • https://speakerdeck.com/mongodb/whats-new-in-the-net-driver • http://learnmongo.com/ • http://www.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/ • http://spp42.com/mongodbde-dogru-index-kullanimi-nasil-kontrol-edilir-i/ • http://bjclark.me/2009/08/nosql-if-only-it-was-that-easy/ • http://reactivemongo.org/