What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
MyDBOPS
88 views
21 slides
Aug 26, 2024
Slide 1 of 21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
About This Presentation
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
* Performance Enhancements: Discover the impressive speed boosts in write and read performance, with benchmarks showing up to a 54% improvement in write-heavy workloads and a 27% improvement in read-heavy workloads.
* Time Series Enhancem...
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
* Performance Enhancements: Discover the impressive speed boosts in write and read performance, with benchmarks showing up to a 54% improvement in write-heavy workloads and a 27% improvement in read-heavy workloads.
* Time Series Enhancements: Learn about the new block processing feature and the transition to columnar storage, which promises faster queries and smarter use of storage space.
* Command Path Optimization: Understand the major overhaul of the command path for faster response times and more efficient database operations.
* Express Path Efficiency: Explore the new Express Path designed to optimize specific queries for speed and reduced overhead.
* Resource Efficiency: Learn about the reduced memory fragmentation and enhanced peak load behavior for better overall system performance.
* Advanced Sharding Capabilities: Discover the new capabilities for moving and converting collections between shards.
* Queryable Encryption Enhancements: Gain insights into the support for range queries within encrypted fields, enhancing security and functionality.
Mydbops Managed Services specializes in taking the pain out of database management while optimizing performance. Since 2015, we have been providing top-notch support and assistance for the top three open-source databases: MySQL, MongoDB, and PostgreSQL.
Our team offers a wide range of services, including assistance, support, consulting, 24/7 operations, and expertise in all relevant technologies. We help organizations improve their database's performance, scalability, efficiency, and availability.
About Me
Manosh Malai
❏Interested in Open Source technologies
❏Interested in MongoDB, DevOps & DevOpSec Practices
❏Tech Speaker/Blogger
❏MongoDB User Group Leader(Bangalore)
Consulting
Services
Consulting
Services
Managed
Services
❏Database Management and consultancy
provider
❏Founded in 2016
❏Assisted 800+ happy customers
❏AWS partners
❏PCI & ISO certified
About Us
❏Up to 54% improvement in write performance (YCSB Write Bulk Data)
❏Read performance gains of up to 27% (YCSB Read-Heavy workloads)
❏Mixed workload improvements (95% Read, 5% Write) see up to 25% gains
❏Linkbench benchmarks suggest an 18% performance increase
❏Time Series workloads (TSBS) benefit from up to a 60% boost
Performance Enhancements
Benchmark Improvement
YCSB Write-Heavy (100% Write) Up to 54%
YCSB Read-Heavy (95% Read) Up to 27%
Linkbench (if data available) Up to 18%
Time Series Workloads (TSBS) Up to 60%
Workload Specific
Improvements
MongoDB 5.0, 6.0 & 7.0
❏Storage Engine: Classic —> SBE
❏Significant improvements: $group, $project, $match, $sort, $lookup(in replica) Operation
❏Columnar Storage: Boosts performance for aggregation, sorting, visualization(Time Series Enhancements)
❏Game-Changer: Efficiently handles large volumes of time series data
MongoDB 8.0 (Expected)
❏Block Processing: Faster queries $group 60% Improvement
❏Awaiting Details: Confirmed improvements, documentation pending
Workload Specific Improvements
Command Path Optimization in MongoDB 8.0
❏Overview: Major overhaul of the internal command path handling
❏Performance: Significant enhancements for faster response times
❏Efficiency: More efficient database operations guaranteed
References
➔https://jira.mongodb.org/browse/SERVER-80296
➔https://jira.mongodb.org/browse/SERVER-84283
➔https://jira.mongodb.org/browse/SERVER-82831
Workload Specific Improvements
Express Path Latency Improvement
❏Improvement: 17% Latency Reduction
❏Key Enhancement: Introduction of SortedDataKeyValueView and seekForKeyValueView
Current Method
❏Invocation: Uses SortedDataInterface::seek with index key
❏Creation: Constructs underutilized BSONObj
❏Data Retrieval: Fetches IndexKeyEntry with RecordId
Reference:
→https://jira.mongodb.org/browse/SERVER-89445
→mongo-r8.0.0-rc10/src/mongo/db/storage/key_string.h
→mongo-r8.0.0-rc10/src/mongo/db/storage/sorted_data_interface.h
Express Path Efficiency
Express Path Latency Improvement
Proposed Method
❏Direct Retrieval: Uses seekForKeyValueView
❏Avoids BSONObj: Bypasses unnecessary BSONObj creation
❏Efficient Data Access: Combines keystring and RecordId into a tuple
Benefits
❏Reduced Overhead: Streamlines query process
❏Enhanced Speed: Faster query execution in the Express Path
❏Resource Efficiency: Better performance and resource allocation
Express Path Efficiency
❏Google TCMalloc
❏Per-CPU Cache: Faster data access and reduced latency.
❏18% Memory Fragmentation Reduction: More efficient use of memory.
❏Enhanced Peak Load Performance: Better responsiveness and stability under high load.
Reduced Memory Fragmentation
Query Insight Features
❏Detailed Namespace-Level Metrics: Fast issue resolution with performance comparison across
collections.
❏Heatmap Panel: Visualize and understand query trends.
Improved Visibility In Query Insights: MongoDB Atlas
Query Shape and Rejection Filters
Query Shape Standardization:
❏Uses kToRepresentativeParseableValue method to create a unified query shape.
❏Focuses on structural patterns for optimization.
Reject Operations Using Query Shape:
❏Query Shape and Operation Rejection:
❏Standardizes query structure for optimization.
❏Identifies and simplifies structurally similar queries.
❏Rejects resource-consuming queries via their query shape.
Improved Visibility In Query Insights: MongoDB Atlas
New Feature: Persistent Query Settings
Advantages:
❏Applies index for specific query shapes matching hash.
❏Replicates settings across replica set members.
❏Persists configurations between restarts.
❏No application code changes required.
Persistent Query Settings
db.adminCommand({
setQuerySettings: '<QueryShapeHash>',
indexFilters: '<Index Name>'
})
{
planSummary: "COLLSCAN",
queryShapeHash: '7F312F79FCOC3_*',
durationMilli s: 11123232 // Too long
}
Code Example slow query log entry:
Global Read Timeout Definition
❏Set a default timeout (maxTimeMS) for all read operations across your cluster.
❏Protects against resource-intensive queries.
❏Ensures efficient query execution and cluster stability.
Code example:
Define Read Timeout Globally
Move Unsharded Collection
Simplified Process
❏Use db.adminCommand({moveCollection: "mydbops.mongodb", toShard: "shard1"}) to relocate unsharded
collections.
❏Ensures seamless transfer without disrupting operations.
Convert Sharded Collection to Unsharded
Streamlined Operation
❏Utilize db.adminCommand({unshardCollection: "mydbops.mongodb", toShard: "shard1"}) for converting
sharded collections to unsharded.
❏Enables faster resharding, reducing impact on workload significantly.
Advanced Sharding Capabilities
Example:
Resharding 500GB in a 1TB cluster now completes in hours, enhancing scalability and operational
efficiency.
Advanced Sharding Capabilities
Range Query Support
Enhanced Functionality:
❏Introduces support for range queries within date ranges and numeric bounds.
❏Includes Decimal 128 for accurate handling of financial values.
❏Encrypted fields now support operators like $gt, $lt, $gte, and $lte.
Queryable Encryption Enhancements in MongoDB 8.0