SlideShare a Scribd company logo
Use Performance Insights To
Enhance MongoDB
Performance
Manosh Malai
CTO, Mydbops LLP
12Th November 2022
Mydbops 13th OpenSource Database Meetup
Interested in Open Source technologies
Interested in MongoDB, DevOps & DevOpSec Practices
Tech Speaker/Blogger
CTO, Mydbops LLP
Manosh Malai
About Me
Consulting
Services
Managed
Services
Focuses on MySQL, MongoDB and PostgreSQL
Mydbops Services
500 + Clients In 5+ Yrs. of Operations
Our Clients
MongoDB Performance Best Practices
MongoDB Performance Analysis Tool and Strategy
Introduction
Agenda
INTRODUCTION
Database Performance
Database Performance can be defined as the optimization of resource
use to increase throughput and minimize contention, enabling the
largest possible workload to be processed.
PERFORMANCE BEST PRACTICES
{
1. SCHEMA DESIGN
2. INDEXING
3. LINUX TUNING
{
Modelling Approach RDBMS
Develop Application and
Queries
Define/Re-Define Data
Model
Production
Denormalize/Poor
Performance
R
D
B
M
S
Design normalized Data Model/Schema
Develop Application
Data model dictates how to write queries for
application operation
Application evolve and data became denormalized
Re-structured the Data Model and normalized
This cause poor performance and required downtime
Modelling Approach MongoDB
Develop Application and
Queries
Define Data Model
Production
New Requirement
M
o
n
g
o
D
B
MQL
Develop the Application
Define the Data Model
Application evolve
Improve the Data Model
Application Evolve and improve data model will happen
recursively without any downtime and complication
Design is part of each phase of the application lifetime
Strategy of Modelling
Goal 1 Goal 2
Goal 3 Goal 4
Deep Knowledge about
Application behaviour
Predict C, U, R, D
Operation perform
on Database and
priorities
Based on Prediction,
map the relationship
between entities and
C, U, R, D
Finalize the Data model,
which suite to the
application
RDBMS MongoDB
Eid FName LName Email Mobile JobName
101 Manosh Malai
abc@myd
bops.com
xxxxxxxxxx xxx
102 Kabilesh P.R
def@mydb
ops.com
xxxxxxxxxx xxx
id Eid Skill
1 101 Linux
2 101 MongoDB
id Eid
CertNam
e
CertNO
1 101 RHCSS xxx
2 101 AWS xxx
3 101 MongoDB xxx
{
Eid: "101",
FName: "Manosh",
LName: "Malai",
Email: "abc@mydbops.com",
Mobile: xxxxxxxxxx,
JobName: "xxx",
Skills: ["Linux", "MongoDB"],
Certifications: [
{
CertName: "RHCSS",
CertNo: "xxx"
},
{
CertName: "AWS",
CertNo: "xxx"
},
{
CertName: "MongoDB",
CertNo: "xxx"
}
]
}
Data Model Type
Embedded Model Link/Reference/Normalized Model
Emp_Collection:
{
Eid: "101",
FName: "Manosh",
LName: "Malai",
Email: "abc@mydbops.com",
Mobile: xxxxxxxxxx,
JobName: "xxx",
Skills: ["Linux", "MongoDB"],
Certifications: [
{ CertName: "RHCSS", CertNo: "xxx" },
{ CertName: "AWS", CertNo: "xxx" },
{ CertName: "MongoDB", CertNo: "xxx" }
]
}
Emp_Collection:
{
Eid: "101",
FName: "Manosh",
LName: "Malai",
Email: "abc@mydbops.com",
Mobile: xxxxxxxxxx,
JobName: "xxx",
Skills: ["Linux", "MongoDB"]
}
Emp_Certification_Collection:
{
CertName: "RHCSS",
CertNo: "xxx",
Eid: "101",
}
Choose Embedded VS Reference
How frequently does the embedded data get
accessed?
Does the embedded information change/update
often?
Is the data queried using the embedded
information?
Design Pattern
▪ Understand your application’s query patterns, Design your data model, Select the appropriate
indexes.
▪ MongoDB has a flexible schema does not mean you can ignore schema design.
▪ Prioritize embedding, unless there is an unavoidable reason.
▪ Don't be afraid of application-level joins: If the index is built correctly and the returned results
are limited by projection conditions, then application-level joins will not be much more
expensive than joins in relational databases.
Key Consideration(RECAP TOO)
▪ Array should not grow without bound
▪ When the array size growing outbound, index performance on the array will fall down
▪ Avoid lookup if they can avoided
▪ Avoid huge number of collection
▪ Avoid default _id Field: 12 bytes is too large and some computational cost
▪ Optimization for keys: Every Document had schema, so every document store keyname in document
and it consume more space.
Key Consideration(RECAP TOO)
In the Database world, index plays a vital role in a performance, that not an exception with MongoDB
Indexing
Single Field Indexes
Compound Indexes
Multikey Indexes
Text Indexes
Wildcard Indexes
2dsphere Indexes
2d Indexes
geoHaystack Indexes
Hashed Indexes
Index Type Index Properties
TTL Indexes
Unique Indexes
Partial Indexes
Case Insensitive Indexes
Hidden Indexes
Sparse Indexes
▪ Follow ESR Rule in Compound Indexes
▪ Use Covered Queries as much possible
▪ How Prefix Compression improves query performance and Disk usage
Indexing Strategies
and so on.
Follow ESR Rule in Compound Indexes
EQUAL SORT
RANGE
In Single Field Index, the document can either be ascending or descending sort regardless of the physical
ordering of the index key
ESR is no strict rule. Its just a guideline, help to produce better query performance
If we put equality key first, we will limit the amount of data we looking
Avoid blocking/In-memory sorting
Fail to follow ESR guidelines in index creation drives us to unwanted totalKeysExamined, totalDocsExamined
traversal, and put stress on memory and CPU resource. finally, executionTimeMillis of the query too more than
the advised value.
ESR db.emp.find({role: "mongodb-dba", exp: {$gt: 5}}).sort({location: 1})
mongodb-dba
mysql-dba
ROLE:
LOCATION: Bangalore Bangalore
1
Hyderabad
3
Chennai
2
EXP: 10
7
5
5
BLOCKING SORT
Chennai
2
Bangalore
1
Hyderabad
3
RESULT
ROOT db.emp.createIndex({role:1, exp:1, location:1})
E
R
S
Doc Examined
ESR db.emp.find({role: "mongodb-dba", exp: {$gt: 5}}).sort({location: 1})
mongodb-dba
mysql-dba
ROLE:
6
LOCATION:
Chennai
2
Hyderabad
3
EXP: 5
7 5
10
ROOT db.emp.createIndex({role:1, location:1, exp:1})
Bangalore
1
E
S
R
Bangalore
Key Consideration
Index creation in foreground will do collection level locking.
Index creation in the background helps to overcome the locking bottleneck but decrease the efficiency of index
traversal.
In MongoDB 4.2 version index creation system was reconstructed. This new indexing method help to
overcome the above-specified incompetence or inefficiency.
Starting in MongoDB 4.4, the index builds on a replica set or sharded cluster build simultaneously across all
data-bearing replica set members.
Cont...
Recommend the developer to write the covered query. This kind of query will be entirely satisfied with an index.
So zero documents need to be inspected to satisfy the query, and this makes the query run lot faster. All the
projection keys need to be indexed.
Use Index to sort the result and avoid blocking sort.
Remove Duplicate and unused index, it also improve the disk throughput and memory optimization.
Operator name mislead between Equality and Range, use index bound to make sure operator your using is
Range or Equality
$ne and $nin(range)
$regex range
$in Alone: Equality Match
$in range with sort
B-Tree & Prefix Compression: Query performance & Disk usage
In B-Tree indexes, Low Cardinality value actually harm performance
In Low Cardinality value preference to use Partial Index
prefix Index compression- Repeated prefix value is not written
WITHOUT PREFIX COMPRESSION
MongoDB-DBA,Bangalore,10
MongoDB-DBA,Chennai,5
MySQL-DBA,Bangalore,7
MongoDB-DBA,Hyderabad,5
MongoDB-DBA,Bangalore,10
,Chennai,5
,Hyderabad,5
MySQL-DBA,Bangalore,7
Without Prefix Comp
With Prefix Comp
Linux Tuning
Swappiness sysctl -w vm.swappiness=1
Dirty Ratio
sysctl -w vm.dirty_ratio = 15
sysctl -w vm.dirty_background_ratio = 5
zone_reclaim_mode sysctl -w vm.zone_reclaim_mode=0
Linux Tuning
# Edit the file
/etc/systemd/system/multi-user.target.wants/mongod.service
ExecStart=/usr/bin/mongod --config /etc/mongod.conf
To
ExecStart=/usr/bin/numactl --interleave=all /usr/bin/mongod --config /etc/mongod.conf
systemctl daemon-reload
systemctl stop mongod
systemctl start mongod
NUMA
Linux Tuning
# Verifying
$ cat /sys/block/xvda/queue/scheduler
noop [deadline] cfq
# Adjusting the value dynamically
$ echo "noop" > /sys/block/xvda/queue/scheduler
$ vim /etc/sysconfig/grub
GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto console=ttyS0,115200 elevator=noop"
$ grub2-mkconfig -o /boot/grub2/grub.cfg
IO Scheduler
Linux Tuning
$ echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
$ echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
$ vim /etc/sysconfig/grub
GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto console=ttyS0,115200 elevator=noop
transparent_hugepage=never"
$ grub2-mkconfig -o /boot/grub2/grub.cfg
Transparent Huge Pages
Linux Tuning
$ vi /etc/systemd/system/multi-user.target.wants/mongod.service
# (file size)
LimitFSIZE=infinity
# (cpu time) LimitCPU=infinity
# (virtual memory size)
LimitAS=infinity
# (locked-in-memory size)
LimitMEMLOCK=infinity
# (open files)
LimitNOFILE=64000
# (processes/threads)
LimitNPROC=64000
ulimit Settings
Linux Tuning
vim /etc/security/limits.conf
mongo hard cpu unlimited
mongo soft cpu unlimited
mongo hard memlock unlimited
mongo soft memlock unlimited
mongo hard nofile 64000
mongo soft nofile 64000
mongo hard nproc 192276
mongo soft nproc 192276
mongo hard fsize unlimited
mongo soft fsize unlimited
mongo hard as unlimited
mongo soft as unlimited
ulimit Settings
Linux Tuning
$ vi /etc/sysctl.conf
net.core.somaxconn = 4096
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_keepalive_probes = 6
Network Stack
MONGODB PERFORMANCE ANALYSIS TOOL
MongoDB Explain
queryPlanner
executionStats
allPlansExecution
db.<collection name>.find({}).explain()
Important Parameter
queryPlanner.winningPlan.inputStage.stage
executionStats.nReturned
executionStats.totalKeysExamined
executionStats.totalDocsExamined
mydbExplainPlan
Stage1: queryInfo
_________________
plannerVersion: 1
namespace: "test.app_logs"
indexFilterSet: false
Stage2: explainPlan
___________________
1 IXSCAN ( index: "name_1" ms: 0 returned: 437 keys: 437 )
2 FETCH ( ms: 0 returned: 437 docs: 437 )
3 SORT_KEY_GENERATOR ( ms: 0 returned: 0 )
4 SORT ( ms: 20 returned: 437 )
Totals: ms: 21 keysExamined: 437 docsExamined: 437
Stage3: winningPlan
___________________
{
"stage" : "SORT",
"sortPattern" : {
"requestMethod" : 1
},
"inputStage" : {
"stage" : "SORT_KEY_GENERATOR",
"inputStage" : {
"stage" : "FETCH",
"inputStage" : {
"stage" : "IXSCAN",
"keyPattern" : {
"name" : 1
},
"indexName" : "name_1",
"isMultiKey" : false,
"isUnique" : false,
"isSparse" : false,
"isPartial" : false,
"indexVersion" : 1,
"direction" : "forward",
"indexBounds" : {
"name" : [
"["Rajnish Kumar", "Rajnish Kumar"]"
]
}
}
}
}
}
mydbExplainPlan
"inputStage" : {
"stage" : "FETCH",
"nReturned" : 437,
"executionTimeMillisEstimate" : 0,
"works" : 438,
"advanced" : 437,
"needTime" : 0,
"needYield" : 0,
"saveState" : 6,
"restoreState" : 6,
"isEOF" : 1,
"invalidates" : 0,
"docsExamined" : 437,
"alreadyHasObj" : 0,
"inputStage" : {
"stage" : "IXSCAN",
"nReturned" : 437,
"executionTimeMillisEstimate" : 0,
"works" : 438,
"advanced" : 437,
"needTime" : 0,
"needYield" : 0,
"saveState" : 6,
"restoreState" : 6,
"isEOF" : 1,
"invalidates" : 0,
"keyPattern" : {
"name" : 1
},
"indexName" : "name_1",
"isMultiKey" : false,
"isUnique" : false,
"isSparse" : false,
"isPartial" : false,
"indexVersion" : 1,
"direction" : "forward",
"indexBounds" : {
"name" : [
"["Rajnish Kumar", "Rajnish Kumar"]"
]
},
"keysExamined" : 437,
"dupsTested" : 0,
"dupsDropped" : 0,
"seenInvalidated" : 0
}
}
}
}
}
Stage4: executionStats
______________________
{
"executionSuccess" : true,
"nReturned" : 437,
"executionTimeMillis" : 21,
"totalKeysExamined" : 437,
"totalDocsExamined" : 437,
"executionStages" : {
"stage" : "SORT",
"nReturned" : 437,
"executionTimeMillisEstimate" : 20,
"works" : 877,
"advanced" : 437,
"needTime" : 439,
"needYield" : 0,
"saveState" : 6,
"restoreState" : 6,
"isEOF" : 1,
"invalidates" : 0,
"sortPattern" : {
"requestMethod" : 1
},
"memUsage" : 513569,
"memLimit" : 33554432,
"inputStage" : {
"stage" : "SORT_KEY_GENERATOR",
"nReturned" : 0,
"executionTimeMillisEstimate" : 0,
"works" : 439,
"advanced" : 0,
"needTime" : 1,
"needYield" : 0,
"saveState" : 6,
"restoreState" : 6,
"isEOF" : 1,
"invalidates" : 0,
Stage5: rejectedPlans
_____________________
Info: 'No Rejected Plans'
planCache
db.runCommand(
{
planCacheSetFilter: <collection>,
query: <query>,
sort: <sort>,
projection: <projection>,
collation: { <collation> },
indexes: [ <index1>, <index2>, ...],
comment: <any>
}
planCacheSetFilter planCacheClearFilter
db.runCommand(
{
planCacheCleearFilter: <collection>,
query: <query>,
sort: <sort>,
projection: <projection>,
collation: { <collation> },
indexes: [ <index1>, <index2>, ...],
comment: <any>
}
planCacheListFilter
db.runCommand(
{
planCacheListFilters: <collection>
}
)
MongoDB Mtools
mtools is a collection of helper scripts to parse, filter, and visualize MongoDB log files. For every DBA this is a
Swiss army knives tools.
mlogfilter
mloginfo
mlaunch
mlogfilter
mlogfilter mongod.log --slow --json | mongoimport -d test -c mycoll
mlogfilter mongod.log --namespace admin.$cmd --slow 1000
mlogfilter mongod.log --operation <query, insert, update, delete, command, getmore>
mlogfilter mongod.log --pattern '{"_id": 1, "host": 1, "ns": 1}'
mlogfilter mongod.log --from FROM [FROM ...], --to TO [TO ...]
mlogfilter mongod.log --from Aug --to Sep
mloginfo
mloginfo mongod.log --queries
mloginfo mongod.log --restarts
mloginfo mongod.log --connections
mloginfo mongod.log --rsstate
mydbloganalyzer
namespace queryHash operation planSummary count min max mean
mydbops.test_agency_calendar_items 23f7c966a91c577b08484df5d2966921 find IXSCAN 2 257 311 284
mydbops.test_institutional_customdatas 36a1a0a95644bbb338aad9d60fd1d664 update -None- 1 11088 11088 11088
mydbops.test_institutional_calendar_items ad09e16227eca0c09bc5a5a4a5366879 count IXSCAN 1 338 338 338
mydbops.test_institutional_calendar_items 75b56caee221c631de8e6bdcdd6ea861 getMore IXSCAN 1 589 589 589
mydbops.test_agency_leads b6aafc97910c571e16e08d7d0a5d0552 aggregate -None- 1 338 338 338
mydbops.test_agency_deviceevents 9c81413804374a82269516f71824a02e insert -None- 1 297 297 297
queryHash:ad09e16227eca0c09bc5a5a4a5366879 2022-08-31T17:52:05.670+0000 I COMMAND [conn55991305]
command mydbops.test command: count { count: "sbil_institutional_calendar_items", query: { state: { $in: [ "COMPLETED",
"OPEN" ] }, data.test.code: { $in: [ "xxxx" ] }, mode: "sh", data.task.code: { $nin: [ "lm", "email", "lc", "lcd", "clb" ] }, schedule.date: {
$gte: new Date(1661797800000), $lt: new Date(1662402599999) }, category: { $in: [ "VO_CALENDAR_ITEM",
"USER_CALENDAR_ITEM" ] }, $or: [ { detect_status.current.code: { $ne: "REJECTED" } }, { detect_status: { $exists: false } } ], $and:
[ { $or: [ { status.current_status.final: true }, { status: { $exists: false } } ] } ] } } planSummary: IXSCAN { data.participants.code: 1,
category: 1 } keyUpdates:0 writeConflicts:0 numYields:25 reslen:62 locks:{ Global: { acquireCount: { r: 52 } }, Database: {
acquireCount: { r: 26 } }, Collection: { acquireCount: { r: 26 } } } protocol:op_query 338ms
Log Heatmap
Heatmap
Heatmap
Keyhole
Keyhole help to produce performance analytics summaries. The information includes MongoDB
configurations, cluster statistics, database schema, indexes, and index usages.
Analyzing mongo logs and Full-Time Diagnostic data Capture (FTDC),
Cluster Info:
keyhole --allinfo "mongodb://user:secret@host.local/test?replicaSet=rs"
FTDC Data and Grafana Integration:
keyhole --web --diag /data/db/diagnostic.data
Logs Analytics:
keyhole --loginfo -v /var/log/mongodb/mongod.log.2018-06-07T11-08-32.gz
Reach Us : Info@mydbops.com
Thank You
Reference
https://medium.com/swlh/mongodb-indexes-deep-dive-understanding-indexes-9bcec6ed7aa6
https://www.mongodb.com/blog/post/performance-best-practices-hardware-and-os-configuration
https://www.slideshare.net/mongodb/mongodb-local-toronto-2019-tips-and-tricks-for-effective-indexing
https://www.mongodb.com/blog/post/performance-best-practices-indexing
https://github.com/rueckstiess/mtools
https://github.com/simagix/keyhole
https://www.youtube.com/watch?v=Mj2YM8t2G2w
https://mydbops.wordpress.com/category/mongodb/
https://www.mongodb.com/docs/manual/administration/production-notes/#production-notes

More Related Content

Similar to Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Mydbops) - Mydbops Opensource Database Meetup -13

MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDBMongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDBMongoDB
 
Beginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANABeginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANAAshish Saxena
 
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...Amazon Web Services
 
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Dbchriskite
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBMarco Segato
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBLisa Roth, PMP
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB
 
Elevate MongoDB with ODBC/JDBC
Elevate MongoDB with ODBC/JDBCElevate MongoDB with ODBC/JDBC
Elevate MongoDB with ODBC/JDBCMongoDB
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011bostonrb
 
2010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week12010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week1Wolfram Arnold
 
Scaling MongoDB
Scaling MongoDBScaling MongoDB
Scaling MongoDBMongoDB
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptxIndrani Sen
 
Webinar: Scaling MongoDB
Webinar: Scaling MongoDBWebinar: Scaling MongoDB
Webinar: Scaling MongoDBMongoDB
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDBvaluebound
 
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDBMongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDBMongoDB
 
introtomongodb
introtomongodbintrotomongodb
introtomongodbsaikiran
 

Similar to Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Mydbops) - Mydbops Opensource Database Meetup -13 (20)

MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDBMongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
 
Beginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANABeginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANA
 
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
 
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDB
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
Mongo db
Mongo dbMongo db
Mongo db
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
 
Elevate MongoDB with ODBC/JDBC
Elevate MongoDB with ODBC/JDBCElevate MongoDB with ODBC/JDBC
Elevate MongoDB with ODBC/JDBC
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011
 
2010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week12010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week1
 
Scaling MongoDB
Scaling MongoDBScaling MongoDB
Scaling MongoDB
 
MongoDB 3.4 webinar
MongoDB 3.4 webinarMongoDB 3.4 webinar
MongoDB 3.4 webinar
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptx
 
Webinar: Scaling MongoDB
Webinar: Scaling MongoDBWebinar: Scaling MongoDB
Webinar: Scaling MongoDB
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
 
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDBMongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
 

More from Mydbops

Efficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL ExplainEfficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL ExplainMydbops
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024Mydbops
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Mydbops
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMydbops
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Mydbops
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15Mydbops
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventMydbops
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...Mydbops
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Mydbops
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mydbops
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLMydbops
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsMydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDBMydbops
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mydbops
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesMydbops
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsMydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLMydbops
 

More from Mydbops (20)

Efficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL ExplainEfficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL Explain
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQL
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDB
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificates
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQL
 

Recently uploaded

ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-IVigneshvaranMech
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxViniHema
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringC Sai Kiran
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdfKamal Acharya
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industriesMuhammadTufail242431
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfAbrahamGadissa
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturingssuser0811ec
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopEmre Günaydın
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxVishalDeshpande27
 
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptxCloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptxMd. Shahidul Islam Prodhan
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Electivekarthi keyan
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdfKamal Acharya
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerapareshmondalnita
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdfKamal Acharya
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdfKamal Acharya
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
 
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfDanfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfNurvisNavarroSanchez
 

Recently uploaded (20)

ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering Workshop
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
 
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptxCloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfDanfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 

Use Performance Insights To Enhance MongoDB Performance - (Manosh Malai - Mydbops) - Mydbops Opensource Database Meetup -13

  • 1. Use Performance Insights To Enhance MongoDB Performance Manosh Malai CTO, Mydbops LLP 12Th November 2022 Mydbops 13th OpenSource Database Meetup
  • 2. Interested in Open Source technologies Interested in MongoDB, DevOps & DevOpSec Practices Tech Speaker/Blogger CTO, Mydbops LLP Manosh Malai About Me
  • 3. Consulting Services Managed Services Focuses on MySQL, MongoDB and PostgreSQL Mydbops Services
  • 4. 500 + Clients In 5+ Yrs. of Operations Our Clients
  • 5. MongoDB Performance Best Practices MongoDB Performance Analysis Tool and Strategy Introduction Agenda
  • 7. Database Performance Database Performance can be defined as the optimization of resource use to increase throughput and minimize contention, enabling the largest possible workload to be processed.
  • 9. { 1. SCHEMA DESIGN 2. INDEXING 3. LINUX TUNING {
  • 10. Modelling Approach RDBMS Develop Application and Queries Define/Re-Define Data Model Production Denormalize/Poor Performance R D B M S Design normalized Data Model/Schema Develop Application Data model dictates how to write queries for application operation Application evolve and data became denormalized Re-structured the Data Model and normalized This cause poor performance and required downtime
  • 11. Modelling Approach MongoDB Develop Application and Queries Define Data Model Production New Requirement M o n g o D B MQL Develop the Application Define the Data Model Application evolve Improve the Data Model Application Evolve and improve data model will happen recursively without any downtime and complication Design is part of each phase of the application lifetime
  • 12. Strategy of Modelling Goal 1 Goal 2 Goal 3 Goal 4 Deep Knowledge about Application behaviour Predict C, U, R, D Operation perform on Database and priorities Based on Prediction, map the relationship between entities and C, U, R, D Finalize the Data model, which suite to the application
  • 13. RDBMS MongoDB Eid FName LName Email Mobile JobName 101 Manosh Malai abc@myd bops.com xxxxxxxxxx xxx 102 Kabilesh P.R def@mydb ops.com xxxxxxxxxx xxx id Eid Skill 1 101 Linux 2 101 MongoDB id Eid CertNam e CertNO 1 101 RHCSS xxx 2 101 AWS xxx 3 101 MongoDB xxx { Eid: "101", FName: "Manosh", LName: "Malai", Email: "abc@mydbops.com", Mobile: xxxxxxxxxx, JobName: "xxx", Skills: ["Linux", "MongoDB"], Certifications: [ { CertName: "RHCSS", CertNo: "xxx" }, { CertName: "AWS", CertNo: "xxx" }, { CertName: "MongoDB", CertNo: "xxx" } ] }
  • 14. Data Model Type Embedded Model Link/Reference/Normalized Model Emp_Collection: { Eid: "101", FName: "Manosh", LName: "Malai", Email: "abc@mydbops.com", Mobile: xxxxxxxxxx, JobName: "xxx", Skills: ["Linux", "MongoDB"], Certifications: [ { CertName: "RHCSS", CertNo: "xxx" }, { CertName: "AWS", CertNo: "xxx" }, { CertName: "MongoDB", CertNo: "xxx" } ] } Emp_Collection: { Eid: "101", FName: "Manosh", LName: "Malai", Email: "abc@mydbops.com", Mobile: xxxxxxxxxx, JobName: "xxx", Skills: ["Linux", "MongoDB"] } Emp_Certification_Collection: { CertName: "RHCSS", CertNo: "xxx", Eid: "101", }
  • 15. Choose Embedded VS Reference How frequently does the embedded data get accessed? Does the embedded information change/update often? Is the data queried using the embedded information?
  • 17. ▪ Understand your application’s query patterns, Design your data model, Select the appropriate indexes. ▪ MongoDB has a flexible schema does not mean you can ignore schema design. ▪ Prioritize embedding, unless there is an unavoidable reason. ▪ Don't be afraid of application-level joins: If the index is built correctly and the returned results are limited by projection conditions, then application-level joins will not be much more expensive than joins in relational databases. Key Consideration(RECAP TOO)
  • 18. ▪ Array should not grow without bound ▪ When the array size growing outbound, index performance on the array will fall down ▪ Avoid lookup if they can avoided ▪ Avoid huge number of collection ▪ Avoid default _id Field: 12 bytes is too large and some computational cost ▪ Optimization for keys: Every Document had schema, so every document store keyname in document and it consume more space. Key Consideration(RECAP TOO)
  • 19. In the Database world, index plays a vital role in a performance, that not an exception with MongoDB Indexing Single Field Indexes Compound Indexes Multikey Indexes Text Indexes Wildcard Indexes 2dsphere Indexes 2d Indexes geoHaystack Indexes Hashed Indexes Index Type Index Properties TTL Indexes Unique Indexes Partial Indexes Case Insensitive Indexes Hidden Indexes Sparse Indexes
  • 20. ▪ Follow ESR Rule in Compound Indexes ▪ Use Covered Queries as much possible ▪ How Prefix Compression improves query performance and Disk usage Indexing Strategies and so on.
  • 21. Follow ESR Rule in Compound Indexes EQUAL SORT RANGE In Single Field Index, the document can either be ascending or descending sort regardless of the physical ordering of the index key ESR is no strict rule. Its just a guideline, help to produce better query performance If we put equality key first, we will limit the amount of data we looking Avoid blocking/In-memory sorting Fail to follow ESR guidelines in index creation drives us to unwanted totalKeysExamined, totalDocsExamined traversal, and put stress on memory and CPU resource. finally, executionTimeMillis of the query too more than the advised value.
  • 22. ESR db.emp.find({role: "mongodb-dba", exp: {$gt: 5}}).sort({location: 1}) mongodb-dba mysql-dba ROLE: LOCATION: Bangalore Bangalore 1 Hyderabad 3 Chennai 2 EXP: 10 7 5 5 BLOCKING SORT Chennai 2 Bangalore 1 Hyderabad 3 RESULT ROOT db.emp.createIndex({role:1, exp:1, location:1}) E R S Doc Examined
  • 23. ESR db.emp.find({role: "mongodb-dba", exp: {$gt: 5}}).sort({location: 1}) mongodb-dba mysql-dba ROLE: 6 LOCATION: Chennai 2 Hyderabad 3 EXP: 5 7 5 10 ROOT db.emp.createIndex({role:1, location:1, exp:1}) Bangalore 1 E S R Bangalore
  • 24. Key Consideration Index creation in foreground will do collection level locking. Index creation in the background helps to overcome the locking bottleneck but decrease the efficiency of index traversal. In MongoDB 4.2 version index creation system was reconstructed. This new indexing method help to overcome the above-specified incompetence or inefficiency. Starting in MongoDB 4.4, the index builds on a replica set or sharded cluster build simultaneously across all data-bearing replica set members.
  • 25. Cont... Recommend the developer to write the covered query. This kind of query will be entirely satisfied with an index. So zero documents need to be inspected to satisfy the query, and this makes the query run lot faster. All the projection keys need to be indexed. Use Index to sort the result and avoid blocking sort. Remove Duplicate and unused index, it also improve the disk throughput and memory optimization. Operator name mislead between Equality and Range, use index bound to make sure operator your using is Range or Equality $ne and $nin(range) $regex range $in Alone: Equality Match $in range with sort
  • 26. B-Tree & Prefix Compression: Query performance & Disk usage In B-Tree indexes, Low Cardinality value actually harm performance In Low Cardinality value preference to use Partial Index prefix Index compression- Repeated prefix value is not written WITHOUT PREFIX COMPRESSION MongoDB-DBA,Bangalore,10 MongoDB-DBA,Chennai,5 MySQL-DBA,Bangalore,7 MongoDB-DBA,Hyderabad,5 MongoDB-DBA,Bangalore,10 ,Chennai,5 ,Hyderabad,5 MySQL-DBA,Bangalore,7 Without Prefix Comp With Prefix Comp
  • 27. Linux Tuning Swappiness sysctl -w vm.swappiness=1 Dirty Ratio sysctl -w vm.dirty_ratio = 15 sysctl -w vm.dirty_background_ratio = 5 zone_reclaim_mode sysctl -w vm.zone_reclaim_mode=0
  • 28. Linux Tuning # Edit the file /etc/systemd/system/multi-user.target.wants/mongod.service ExecStart=/usr/bin/mongod --config /etc/mongod.conf To ExecStart=/usr/bin/numactl --interleave=all /usr/bin/mongod --config /etc/mongod.conf systemctl daemon-reload systemctl stop mongod systemctl start mongod NUMA
  • 29. Linux Tuning # Verifying $ cat /sys/block/xvda/queue/scheduler noop [deadline] cfq # Adjusting the value dynamically $ echo "noop" > /sys/block/xvda/queue/scheduler $ vim /etc/sysconfig/grub GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto console=ttyS0,115200 elevator=noop" $ grub2-mkconfig -o /boot/grub2/grub.cfg IO Scheduler
  • 30. Linux Tuning $ echo "never" > /sys/kernel/mm/transparent_hugepage/enabled $ echo "never" > /sys/kernel/mm/transparent_hugepage/defrag $ vim /etc/sysconfig/grub GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto console=ttyS0,115200 elevator=noop transparent_hugepage=never" $ grub2-mkconfig -o /boot/grub2/grub.cfg Transparent Huge Pages
  • 31. Linux Tuning $ vi /etc/systemd/system/multi-user.target.wants/mongod.service # (file size) LimitFSIZE=infinity # (cpu time) LimitCPU=infinity # (virtual memory size) LimitAS=infinity # (locked-in-memory size) LimitMEMLOCK=infinity # (open files) LimitNOFILE=64000 # (processes/threads) LimitNPROC=64000 ulimit Settings
  • 32. Linux Tuning vim /etc/security/limits.conf mongo hard cpu unlimited mongo soft cpu unlimited mongo hard memlock unlimited mongo soft memlock unlimited mongo hard nofile 64000 mongo soft nofile 64000 mongo hard nproc 192276 mongo soft nproc 192276 mongo hard fsize unlimited mongo soft fsize unlimited mongo hard as unlimited mongo soft as unlimited ulimit Settings
  • 33. Linux Tuning $ vi /etc/sysctl.conf net.core.somaxconn = 4096 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_intvl = 30 net.ipv4.tcp_keepalive_time = 120 net.ipv4.tcp_max_syn_backlog = 4096 net.ipv4.tcp_keepalive_probes = 6 Network Stack
  • 35. MongoDB Explain queryPlanner executionStats allPlansExecution db.<collection name>.find({}).explain() Important Parameter queryPlanner.winningPlan.inputStage.stage executionStats.nReturned executionStats.totalKeysExamined executionStats.totalDocsExamined
  • 36. mydbExplainPlan Stage1: queryInfo _________________ plannerVersion: 1 namespace: "test.app_logs" indexFilterSet: false Stage2: explainPlan ___________________ 1 IXSCAN ( index: "name_1" ms: 0 returned: 437 keys: 437 ) 2 FETCH ( ms: 0 returned: 437 docs: 437 ) 3 SORT_KEY_GENERATOR ( ms: 0 returned: 0 ) 4 SORT ( ms: 20 returned: 437 ) Totals: ms: 21 keysExamined: 437 docsExamined: 437 Stage3: winningPlan ___________________ { "stage" : "SORT", "sortPattern" : { "requestMethod" : 1 }, "inputStage" : { "stage" : "SORT_KEY_GENERATOR", "inputStage" : { "stage" : "FETCH", "inputStage" : { "stage" : "IXSCAN", "keyPattern" : { "name" : 1 }, "indexName" : "name_1", "isMultiKey" : false, "isUnique" : false, "isSparse" : false, "isPartial" : false, "indexVersion" : 1, "direction" : "forward", "indexBounds" : { "name" : [ "["Rajnish Kumar", "Rajnish Kumar"]" ] } } } } }
  • 37. mydbExplainPlan "inputStage" : { "stage" : "FETCH", "nReturned" : 437, "executionTimeMillisEstimate" : 0, "works" : 438, "advanced" : 437, "needTime" : 0, "needYield" : 0, "saveState" : 6, "restoreState" : 6, "isEOF" : 1, "invalidates" : 0, "docsExamined" : 437, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", "nReturned" : 437, "executionTimeMillisEstimate" : 0, "works" : 438, "advanced" : 437, "needTime" : 0, "needYield" : 0, "saveState" : 6, "restoreState" : 6, "isEOF" : 1, "invalidates" : 0, "keyPattern" : { "name" : 1 }, "indexName" : "name_1", "isMultiKey" : false, "isUnique" : false, "isSparse" : false, "isPartial" : false, "indexVersion" : 1, "direction" : "forward", "indexBounds" : { "name" : [ "["Rajnish Kumar", "Rajnish Kumar"]" ] }, "keysExamined" : 437, "dupsTested" : 0, "dupsDropped" : 0, "seenInvalidated" : 0 } } } } } Stage4: executionStats ______________________ { "executionSuccess" : true, "nReturned" : 437, "executionTimeMillis" : 21, "totalKeysExamined" : 437, "totalDocsExamined" : 437, "executionStages" : { "stage" : "SORT", "nReturned" : 437, "executionTimeMillisEstimate" : 20, "works" : 877, "advanced" : 437, "needTime" : 439, "needYield" : 0, "saveState" : 6, "restoreState" : 6, "isEOF" : 1, "invalidates" : 0, "sortPattern" : { "requestMethod" : 1 }, "memUsage" : 513569, "memLimit" : 33554432, "inputStage" : { "stage" : "SORT_KEY_GENERATOR", "nReturned" : 0, "executionTimeMillisEstimate" : 0, "works" : 439, "advanced" : 0, "needTime" : 1, "needYield" : 0, "saveState" : 6, "restoreState" : 6, "isEOF" : 1, "invalidates" : 0, Stage5: rejectedPlans _____________________ Info: 'No Rejected Plans'
  • 38. planCache db.runCommand( { planCacheSetFilter: <collection>, query: <query>, sort: <sort>, projection: <projection>, collation: { <collation> }, indexes: [ <index1>, <index2>, ...], comment: <any> } planCacheSetFilter planCacheClearFilter db.runCommand( { planCacheCleearFilter: <collection>, query: <query>, sort: <sort>, projection: <projection>, collation: { <collation> }, indexes: [ <index1>, <index2>, ...], comment: <any> } planCacheListFilter db.runCommand( { planCacheListFilters: <collection> } )
  • 39. MongoDB Mtools mtools is a collection of helper scripts to parse, filter, and visualize MongoDB log files. For every DBA this is a Swiss army knives tools. mlogfilter mloginfo mlaunch
  • 40. mlogfilter mlogfilter mongod.log --slow --json | mongoimport -d test -c mycoll mlogfilter mongod.log --namespace admin.$cmd --slow 1000 mlogfilter mongod.log --operation <query, insert, update, delete, command, getmore> mlogfilter mongod.log --pattern '{"_id": 1, "host": 1, "ns": 1}' mlogfilter mongod.log --from FROM [FROM ...], --to TO [TO ...] mlogfilter mongod.log --from Aug --to Sep
  • 41. mloginfo mloginfo mongod.log --queries mloginfo mongod.log --restarts mloginfo mongod.log --connections mloginfo mongod.log --rsstate
  • 42. mydbloganalyzer namespace queryHash operation planSummary count min max mean mydbops.test_agency_calendar_items 23f7c966a91c577b08484df5d2966921 find IXSCAN 2 257 311 284 mydbops.test_institutional_customdatas 36a1a0a95644bbb338aad9d60fd1d664 update -None- 1 11088 11088 11088 mydbops.test_institutional_calendar_items ad09e16227eca0c09bc5a5a4a5366879 count IXSCAN 1 338 338 338 mydbops.test_institutional_calendar_items 75b56caee221c631de8e6bdcdd6ea861 getMore IXSCAN 1 589 589 589 mydbops.test_agency_leads b6aafc97910c571e16e08d7d0a5d0552 aggregate -None- 1 338 338 338 mydbops.test_agency_deviceevents 9c81413804374a82269516f71824a02e insert -None- 1 297 297 297 queryHash:ad09e16227eca0c09bc5a5a4a5366879 2022-08-31T17:52:05.670+0000 I COMMAND [conn55991305] command mydbops.test command: count { count: "sbil_institutional_calendar_items", query: { state: { $in: [ "COMPLETED", "OPEN" ] }, data.test.code: { $in: [ "xxxx" ] }, mode: "sh", data.task.code: { $nin: [ "lm", "email", "lc", "lcd", "clb" ] }, schedule.date: { $gte: new Date(1661797800000), $lt: new Date(1662402599999) }, category: { $in: [ "VO_CALENDAR_ITEM", "USER_CALENDAR_ITEM" ] }, $or: [ { detect_status.current.code: { $ne: "REJECTED" } }, { detect_status: { $exists: false } } ], $and: [ { $or: [ { status.current_status.final: true }, { status: { $exists: false } } ] } ] } } planSummary: IXSCAN { data.participants.code: 1, category: 1 } keyUpdates:0 writeConflicts:0 numYields:25 reslen:62 locks:{ Global: { acquireCount: { r: 52 } }, Database: { acquireCount: { r: 26 } }, Collection: { acquireCount: { r: 26 } } } protocol:op_query 338ms
  • 46. Keyhole Keyhole help to produce performance analytics summaries. The information includes MongoDB configurations, cluster statistics, database schema, indexes, and index usages. Analyzing mongo logs and Full-Time Diagnostic data Capture (FTDC), Cluster Info: keyhole --allinfo "mongodb://user:secret@host.local/test?replicaSet=rs" FTDC Data and Grafana Integration: keyhole --web --diag /data/db/diagnostic.data Logs Analytics: keyhole --loginfo -v /var/log/mongodb/mongod.log.2018-06-07T11-08-32.gz
  • 47. Reach Us : Info@mydbops.com Thank You