MongoDB supports a wide range of indexing options to enable fast querying of your data. In this talk we’ll cover how indexing works, the various indexing options, and cover use cases where each might be useful.
The document outlines MongoDB release history and roadmaps. It summarizes features introduced in releases 2.2, 2.4 and beyond. Key features in 2.2 included concurrency improvements, a new aggregation framework, TTL collections, and tag aware sharding. 2.4 added security enhancements, hash-based sharding, and geospatial indexing. Ongoing work includes collection locking, field authorization, and full-text search. The document encourages users to provide feedback and get involved with the local MongoDB user group.
The document provides a roadmap and overview of recent releases of MongoDB including versions 1.8, 2.0, 2.2, and 2.4. It summarizes some of the key features introduced in each release such as journaling, indexing improvements, aggregation framework, sharding enhancements, and performance improvements. It then focuses on details of the 2.2 release including concurrency improvements, the new aggregation framework, TTL collections, tag aware sharding, and read preferences. It concludes by outlining some ongoing work and encouraging participation in the MongoDB community.
The document discusses 10 key performance indicators for MongoDB:
1) Slow operations using the profiler
2) Replication lag by checking oplog timestamps
3) High resident memory usage indicating paging is occurring
4) High page faults
5) High write lock percentage indicating concurrency issues
6) Large reader/writer queues indicating lock contention
7) Frequent background flushing indicating I/O issues
8) Too many connections
9) High network traffic
10) Collection fragmentation leading to increased storage size
It provides examples of how to check for each indicator using the db.serverStatus() command.
The document discusses MongoDB performance optimization strategies presented by Moshe Kaplan at a VP R&D Open Seminar. It covers topics like sharding, in-memory databases, MapReduce, profiling, indexes, server stats, schema design, and locking in MongoDB. Slides include information on tuning configuration parameters, analyzing profiling results, explain plans, index management, and database stats.
The document provides instructions on various MongoDB commands for working with databases, collections, and documents. It demonstrates how to start the MongoDB CLI, create and drop databases and collections, insert, update, find, and remove documents, and add indexes. It also discusses sharding, backups using mongodump, and restores with mongorestore.
This document summarizes MongoDB's recent release history and highlights of upcoming releases. It outlines key features from releases 2.0 through 2.4 including journaling, sharding, indexing improvements, and the aggregation framework. Release 2.2 focused on concurrency improvements like yielding and database-level locking as well as the new aggregation framework. Future releases will focus on areas like security, geospatial indexing, and distributed non-sharded collections. Community involvement through testing, feedback, and local user groups is encouraged.
This document provides an introduction and overview of MongoDB including what MongoDB is, how to install and configure it, common database commands, and CRUD operations. MongoDB is an open-source document database that provides high performance and automatic scaling. Records in MongoDB are documents composed of field-value pairs similar to JSON objects. The document covers installing MongoDB, starting the MongoDB service, basic CRUD commands like insert, find, update, and remove, and provides examples of each.
This document provides an introduction and overview of MongoDB, a popular NoSQL database. It discusses the different types of NoSQL databases and compares MongoDB to relational databases. It then covers basic operations in MongoDB like creating databases and collections, inserting, updating, and removing documents. Embedded relationships and indexing in MongoDB are also explained. The document concludes with references for further reading on MongoDB.
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter DataStax Academy
1) The document discusses Cassandra tools including the DataStax CQL drivers and the new DevCenter visual query tool.
2) The CQL drivers provide an asynchronous architecture based on Netty, support prepared statements, automatic failover, and tunable policies.
3) DevCenter is a free visual query tool that can be used by developers and admins for creating and running CQL queries and commands against Apache Cassandra and DataStax Enterprise. It is intended to be a smarter and friendlier alternative to cqlsh.
The document outlines steps for building a Node Express app with MongoDB including installing MongoDB NPM modules, creating and closing a database connection, querying, inserting, updating, and deleting documents from a collection called "Employee" with sample employee documents provided. It introduces the database and collection names and lists 7 commands for common MongoDB operations within a Node application.
Mongo db pefrormance optimization strategiesronwarshawsky
The document discusses MongoDB performance optimization strategies. It outlines various techniques such as using map-reduce operations, updating to the latest MongoDB version, implementing sharding, balancing shards, optimizing disk input/output, managing locks, using capped collections for fast writes, leveraging natural ordering for fast reads, considering query performance including indexes, minimizing document size through field name shortening, and keeping MongoDB updates. It also briefly describes Enteros' software for database problem root cause analysis across infrastructure tiers.
MongoDB is an open-source, document-oriented, NoSQL database that provides scalability, performance, and high availability. It is written in C++ and stores data in flexible, JSON-like documents, allowing for easy querying and retrieval of data. MongoDB is commonly used for applications that require scalability and large datasets, and provides features like auto-sharding, replication, and rich queries.
This is a talk I presented at University Limerick to give people an introduction into CouchDB.
What is it? How does it generally work? Introducing new concepts, etc.
The document discusses MongoDB operations like inserting, finding, updating, and deleting documents. It provides examples of inserting documents with different data structures like arrays embedded documents. It also demonstrates various find operations with filters, projections, sorting, skipping, limiting results. Operations to count and get distinct values are also covered. The document concludes by discussing how Thoughtbuzz uses MongoDB to store heterogeneous social media data from different sources in a single collection to provide unified analytics without requiring joins.
The document provides an overview of MongoDB releases including 2.2 and upcoming 2.4. Key features of release 2.2 include concurrency improvements through yielding and database-level locking, a new aggregation framework, TTL collections, and tag-aware sharding. Release 2.4 will focus on security enhancements, hash-based sharding, and geospatial indexing among other improvements. Ongoing work includes collection-level locking, field-level authorization, and full-text search. The community is encouraged to use, provide feedback on, and engage with the MongoDB product.
This document provides an overview and introduction to MongoDB including:
- MongoDB installation using yum or binary, roles in MongoDB, and how to create users
- Basic MongoDB commands like use, show dbs, and dropDatabase
- Tracing slow queries using the database profiler and viewing results in the system.profile collection
- Important monitoring commands like db.serverStatus(), currentOp(), db.stats(), and replica set commands like rs.status() and rs.printReplicationInfo()
Back to Basics Spanish Webinar 3 - Introducción a los replica setsMongoDB
Cómo crear un clúster de producción
Cómo crear un replica set
Cómo MongoDB gestiona la persistencia de los datos y cómo un conjunto de réplicas se recupera automáticamente de todo tipo de fallos
Optimizing Slow Queries with Indexes and CreativityMongoDB
This document discusses optimizing slow queries in MongoDB through the use of indexes and schema design. It begins with examples of common performance issues like inefficient reads from table scans and writes causing locks. Each example shows the slow query, explains the problem, and proposes a solution like adding an index. It emphasizes that new indexes only scale up to a point and sometimes the best approach is to redesign the schema or add hardware. The talk provides guidance on measuring performance, finding slow queries, determining if they can be indexed, and rephrasing problems in terms of desired queries.
The document discusses various topics related to using MongoDB including schema design, indexing, concurrency, and durability. For schema design, it recommends using small document sizes and separating documents that grow unbounded into multiple collections. For indexing, it emphasizes ensuring queries use indexes and introduces sparse indexes and index-only queries. It notes concurrency is coarse-grained currently but being improved. For durability, it discusses storage, journaling, replication, and write concerns.
[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례NAVER D2
This document analyzes the I/O characteristics of SQLite databases in mobile platforms like Android and Tizen. It finds that SQLite database I/O is dominant, with small 4KB writes being common. SQLite journaling and Ext4 filesystem journaling together generate excessive I/O. Various optimizations are discussed, including using SQLite's WAL journal mode, filesystem mount options, fdatasync(), and reorganizing how databases are used by platforms and applications.
This document provides an overview of NoSQL and MongoDB. It discusses trends driving the adoption of NoSQL databases like increasing data sizes, more connectedness, and individualization. It covers the different types of NoSQL databases and MongoDB in particular. Key concepts discussed include the CAP theorem, MongoDB's document-oriented data model, and basic CRUD operations in MongoDB using the shell.
Cassandra Day Chicago 2015: Advanced Data ModelingDataStax Academy
The document discusses modeling data in Cassandra using the Chebotko method. It begins by explaining the conceptual, logical, and physical modeling stages of the Chebotko method. It then provides an example of modeling user data in a music database, showing the conceptual model, identifying access patterns, and designing the logical model with tables to satisfy each query. The logical model example shows how to design Cassandra tables for queries about performers, albums, tracks, users and their activities.
Whether you’re an experienced Android developer, or you’re just getting started, you will need to think about storing data on the device. Android offers several options including relational data storage on a SQLite Database, but the APIs and examples provided by Google look like the state-of-the-art JDBC programming you did back in 1995! In this talk, you’ll learn how to use RealmDB, an elegant Object Relational database alternative to SQLite, to make database development on Android fun, easy, and testable.
The document discusses tips and tricks for using the MongoDB shell. It describes what the shell is, advantages like debugging queries and administration, and disadvantages like numbers and dates. It provides examples of shell commands and functions for tasks like loading scripts, running commands, profiling, and administration. It also discusses configuration options and ways to improve the shell experience like keyboard shortcuts and the .mongorc.js file.
How Clean is your database? Data scrubbing for all skills setsChad Petrovay
This document provides tips and best practices for cleaning up and maintaining a clean database. It discusses identifying dirty data through data mapping and assessment. Techniques presented for scrubbing data include using standards to prevent errors, spell check, function keys, security groups and search/replace functions. SQL scripts are demonstrated for updating object names, migrating text entries and monitoring changes through audit trails and usage reports. The importance of ongoing monitoring and creating a culture that values data quality is emphasized.
MongoDB + Java - Everything you need to know Norberto Leite
Learn everything you need to know to get started building a MongoDB-based app in Java. We'll explore the relationship between MongoDB and various languages on the Java Virtual Machine such as Java, Scala, and Clojure. From there, we'll examine the popular frameworks and integration points between MongoDB and the JVM including Spring Data and object-document mappers like Morphia.
In this presentation, Brett Didonato shows off Giftivo, a tool that generates gift suggestions for friends and family based on their interests. He'll showcase how they're using MongoDB.
For the first time this year, 10gen will be offering a track completely dedicated to Operations at MongoSV, 10gen's annual MongoDB user conference on December 4. Learn more at MongoSV.com
MongoDB supports replication for failover and redundancy. In this session we will introduce the basic concepts around replica sets, which provide automated failover and recovery of nodes. We'll show you how to set up, configure, and initiate a replica set, and methods for using replication to scale reads. We'll also discuss proper architecture for durability.
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter DataStax Academy
1) The document discusses Cassandra tools including the DataStax CQL drivers and the new DevCenter visual query tool.
2) The CQL drivers provide an asynchronous architecture based on Netty, support prepared statements, automatic failover, and tunable policies.
3) DevCenter is a free visual query tool that can be used by developers and admins for creating and running CQL queries and commands against Apache Cassandra and DataStax Enterprise. It is intended to be a smarter and friendlier alternative to cqlsh.
The document outlines steps for building a Node Express app with MongoDB including installing MongoDB NPM modules, creating and closing a database connection, querying, inserting, updating, and deleting documents from a collection called "Employee" with sample employee documents provided. It introduces the database and collection names and lists 7 commands for common MongoDB operations within a Node application.
Mongo db pefrormance optimization strategiesronwarshawsky
The document discusses MongoDB performance optimization strategies. It outlines various techniques such as using map-reduce operations, updating to the latest MongoDB version, implementing sharding, balancing shards, optimizing disk input/output, managing locks, using capped collections for fast writes, leveraging natural ordering for fast reads, considering query performance including indexes, minimizing document size through field name shortening, and keeping MongoDB updates. It also briefly describes Enteros' software for database problem root cause analysis across infrastructure tiers.
MongoDB is an open-source, document-oriented, NoSQL database that provides scalability, performance, and high availability. It is written in C++ and stores data in flexible, JSON-like documents, allowing for easy querying and retrieval of data. MongoDB is commonly used for applications that require scalability and large datasets, and provides features like auto-sharding, replication, and rich queries.
This is a talk I presented at University Limerick to give people an introduction into CouchDB.
What is it? How does it generally work? Introducing new concepts, etc.
The document discusses MongoDB operations like inserting, finding, updating, and deleting documents. It provides examples of inserting documents with different data structures like arrays embedded documents. It also demonstrates various find operations with filters, projections, sorting, skipping, limiting results. Operations to count and get distinct values are also covered. The document concludes by discussing how Thoughtbuzz uses MongoDB to store heterogeneous social media data from different sources in a single collection to provide unified analytics without requiring joins.
The document provides an overview of MongoDB releases including 2.2 and upcoming 2.4. Key features of release 2.2 include concurrency improvements through yielding and database-level locking, a new aggregation framework, TTL collections, and tag-aware sharding. Release 2.4 will focus on security enhancements, hash-based sharding, and geospatial indexing among other improvements. Ongoing work includes collection-level locking, field-level authorization, and full-text search. The community is encouraged to use, provide feedback on, and engage with the MongoDB product.
This document provides an overview and introduction to MongoDB including:
- MongoDB installation using yum or binary, roles in MongoDB, and how to create users
- Basic MongoDB commands like use, show dbs, and dropDatabase
- Tracing slow queries using the database profiler and viewing results in the system.profile collection
- Important monitoring commands like db.serverStatus(), currentOp(), db.stats(), and replica set commands like rs.status() and rs.printReplicationInfo()
Back to Basics Spanish Webinar 3 - Introducción a los replica setsMongoDB
Cómo crear un clúster de producción
Cómo crear un replica set
Cómo MongoDB gestiona la persistencia de los datos y cómo un conjunto de réplicas se recupera automáticamente de todo tipo de fallos
Optimizing Slow Queries with Indexes and CreativityMongoDB
This document discusses optimizing slow queries in MongoDB through the use of indexes and schema design. It begins with examples of common performance issues like inefficient reads from table scans and writes causing locks. Each example shows the slow query, explains the problem, and proposes a solution like adding an index. It emphasizes that new indexes only scale up to a point and sometimes the best approach is to redesign the schema or add hardware. The talk provides guidance on measuring performance, finding slow queries, determining if they can be indexed, and rephrasing problems in terms of desired queries.
The document discusses various topics related to using MongoDB including schema design, indexing, concurrency, and durability. For schema design, it recommends using small document sizes and separating documents that grow unbounded into multiple collections. For indexing, it emphasizes ensuring queries use indexes and introduces sparse indexes and index-only queries. It notes concurrency is coarse-grained currently but being improved. For durability, it discusses storage, journaling, replication, and write concerns.
[2C6]SQLite DB 의 입출력 특성분석 : Android 와 Tizen 사례NAVER D2
This document analyzes the I/O characteristics of SQLite databases in mobile platforms like Android and Tizen. It finds that SQLite database I/O is dominant, with small 4KB writes being common. SQLite journaling and Ext4 filesystem journaling together generate excessive I/O. Various optimizations are discussed, including using SQLite's WAL journal mode, filesystem mount options, fdatasync(), and reorganizing how databases are used by platforms and applications.
This document provides an overview of NoSQL and MongoDB. It discusses trends driving the adoption of NoSQL databases like increasing data sizes, more connectedness, and individualization. It covers the different types of NoSQL databases and MongoDB in particular. Key concepts discussed include the CAP theorem, MongoDB's document-oriented data model, and basic CRUD operations in MongoDB using the shell.
Cassandra Day Chicago 2015: Advanced Data ModelingDataStax Academy
The document discusses modeling data in Cassandra using the Chebotko method. It begins by explaining the conceptual, logical, and physical modeling stages of the Chebotko method. It then provides an example of modeling user data in a music database, showing the conceptual model, identifying access patterns, and designing the logical model with tables to satisfy each query. The logical model example shows how to design Cassandra tables for queries about performers, albums, tracks, users and their activities.
Whether you’re an experienced Android developer, or you’re just getting started, you will need to think about storing data on the device. Android offers several options including relational data storage on a SQLite Database, but the APIs and examples provided by Google look like the state-of-the-art JDBC programming you did back in 1995! In this talk, you’ll learn how to use RealmDB, an elegant Object Relational database alternative to SQLite, to make database development on Android fun, easy, and testable.
The document discusses tips and tricks for using the MongoDB shell. It describes what the shell is, advantages like debugging queries and administration, and disadvantages like numbers and dates. It provides examples of shell commands and functions for tasks like loading scripts, running commands, profiling, and administration. It also discusses configuration options and ways to improve the shell experience like keyboard shortcuts and the .mongorc.js file.
How Clean is your database? Data scrubbing for all skills setsChad Petrovay
This document provides tips and best practices for cleaning up and maintaining a clean database. It discusses identifying dirty data through data mapping and assessment. Techniques presented for scrubbing data include using standards to prevent errors, spell check, function keys, security groups and search/replace functions. SQL scripts are demonstrated for updating object names, migrating text entries and monitoring changes through audit trails and usage reports. The importance of ongoing monitoring and creating a culture that values data quality is emphasized.
MongoDB + Java - Everything you need to know Norberto Leite
Learn everything you need to know to get started building a MongoDB-based app in Java. We'll explore the relationship between MongoDB and various languages on the Java Virtual Machine such as Java, Scala, and Clojure. From there, we'll examine the popular frameworks and integration points between MongoDB and the JVM including Spring Data and object-document mappers like Morphia.
In this presentation, Brett Didonato shows off Giftivo, a tool that generates gift suggestions for friends and family based on their interests. He'll showcase how they're using MongoDB.
For the first time this year, 10gen will be offering a track completely dedicated to Operations at MongoSV, 10gen's annual MongoDB user conference on December 4. Learn more at MongoSV.com
MongoDB supports replication for failover and redundancy. In this session we will introduce the basic concepts around replica sets, which provide automated failover and recovery of nodes. We'll show you how to set up, configure, and initiate a replica set, and methods for using replication to scale reads. We'll also discuss proper architecture for durability.
Building your first java application with MongoDB MongoDB
This webinar will introduce how to build your first Java application with MongoDB by walking you through how one can build a simple location based application. The talk will cover the basics of MongoDB's document model, query language, aggregation framework and deployment architecture. New features, fixes and improvements in the latest release will also be covered.
This document summarizes a presentation about MongoDB given by a Business Development Director from 10gen. Some key points include:
- MongoDB is a scalable, high-performance, document-oriented NoSQL database that is open source and written in C++. It offers features like schema-less document storage, full text indexing, replication, auto-sharding and high availability.
- Many organizations are adopting MongoDB to address challenges with handling large volumes of data, new data types like semi-structured and unstructured data, and needing faster agile development. MongoDB provides a flexible data model, rich query language and ability to scale horizontally on commodity servers.
- MongoDB is seeing widespread adoption across industries for use cases like
Branf final bringing mongodb into your organization - mongo db-boston2012MongoDB
This document discusses bringing MongoDB into an organization. It begins by outlining why organizations should change now due to trends in big data, agile development, and new hardware architectures. It then summarizes that MongoDB is a reasonable and safe choice, highlighting its promises around developer productivity, ease of use, durability, speed and scalability, and economic value. Real-world examples of companies like Intuit and Wordnik that use MongoDB are provided. Finally, it discusses how 10gen, the creators of MongoDB, provide an ecosystem, community, and commercial services to support MongoDB users.
This document discusses why MongoDB is easier to develop, operate, and scale compared to relational databases. It provides examples of how MongoDB allows for flexible data models, easy administration through packages and shell helpers, and horizontal scaling by adding servers and sharding data across multiple machines. Resources for getting help from the MongoDB community and commercial support options are also listed.
Stephen Steneker gave a presentation on indexing and query optimization in MongoDB. He explained what indexes are, why they are needed to improve query performance, and how to work with indexes in MongoDB. He covered creating, managing, and dropping indexes, as well as options like background building, uniqueness constraints, and geospatial indexes. Steneker also discussed optimizing queries, avoiding common mistakes like trying to use multiple indexes, and ensuring indexes are selective to benefit queries.
Having the right indexes in place are crucial to performance in MongoDB. In this talk, we’ll explain how indexes work and the various indexing options. We’ll talk about the tools available to optimize your queries and avoid common pitfalls. Throughout the session, we’ll reference real-world examples to demonstrate the importance of proper indexing.
This document provides an overview of indexing in MongoDB. It discusses what indexes are, why they are needed to optimize queries, and how to work with indexes in MongoDB. Some key points covered include how to create, manage, and optimize indexes. Common indexing mistakes are also discussed, such as trying to use multiple indexes per query, having indexes with low selectivity, and queries that cannot use indexes like regular expressions and negation queries.
Having the right indexes in place are crucial to performance in MongoDB. In this talk, we’ll explain how indexes work and the various indexing options. Then, we'll cover the tools available to optimize your queries and avoid common pitfalls. This session will use real-world examples to demonstrate the importance of proper indexing.
Thomas Rückstieß gave a presentation on indexing and query optimization in MongoDB. He discussed what indexes are, why they are needed, how to create and manage indexes, and how to optimize queries. He emphasized that absent or suboptimal indexes are a common performance problem and outlined some common indexing mistakes to avoid, such as trying to use multiple indexes per query, low selectivity indexes, and queries that cannot use indexes like regular expressions and negation.
This document discusses various indexing strategies in MongoDB to help scale applications. It covers the basics of indexes, including creating and tuning indexes. It also discusses different index types like geospatial indexes, text indexes, and how to use explain plans and profiling to evaluate queries. The document concludes with a section on scaling strategies like sharding to scale beyond a single server's resources.
As your data grows, the need to establish proper indexes becomes critical to performance. MongoDB supports a wide range of indexing options to enable fast querying of your data, but what are the right strategies for your application?
In this talk we’ll cover how indexing works, the various indexing options, and use cases where each can be useful. We'll dive into common pitfalls using real-world examples to ensure that you're ready for scale.
Indexes support efficient query execution in MongoDB. Without indexes, MongoDB would need to scan every document in a collection to find matching documents for a query. Indexes store a small portion of collection data in an easy-to-traverse form, ordered by the value of specific fields. To create an index, the db.collection.createIndex() method is used, specifying the field(s) to index. Indexes can be single-field, compound on multiple fields, or multikey for array values. The aggregation pipeline provides efficient data aggregation by transforming documents through a series of pipeline stages that can filter, sort, group, and perform calculations on document fields and arrays.
The document discusses indexing and query optimization in MongoDB. It covers indexing basics, when indexes can and cannot be used, creating and maintaining indexes, and using explain() to understand query plans. The query optimizer is empirical and tries different plans to select the fastest, and hint() can be used to force a specific plan.
Indexing and Query Optimizer (Richard Kreuter)MongoDB
The document discusses indexing and query optimization in MongoDB. It covers indexing basics, when indexes can and cannot be used, creating and maintaining indexes, and using explain() to understand query plans. The query optimizer is empirical rather than cost-based, and hint() can be used to force a specific query plan.
MongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query PitfallsMongoDB
Query performance can either be a constant headache or the unsung hero of an application. MongoDB provides extremely powerful querying capabilities when used properly. As a member of the solutions architecture team, I will share common mistakes observed as well as tips and tricks to avoiding them.
Indexing and Query Optimizer (Mongo Austin)MongoDB
The document discusses indexing and query optimization in MongoDB. It provides an overview of indexing basics, how to create indexes, when indexes can and cannot be used, and the importance of compound indexes. It also describes using explain() to check query plans and the database profiler for analyzing query performance.
The document discusses indexing and query optimization in MongoDB. It provides an overview of how indexes work, how to create and maintain indexes, and when indexes can and cannot be used to optimize queries. It emphasizes the importance of compound indexes and provides examples of how to use indexes to improve queries. The document also covers the query optimizer and profiling features in MongoDB.
This document discusses indexing and query optimization in MongoDB. It provides an overview of how indexes work, how to create and manage indexes, and how the query optimizer uses indexes to efficiently search for documents. It explains that compound indexes can help queries that search on multiple fields and that the explain() method and database profiler can help analyze query performance and determine if an index is being used effectively.
MongoDB and Indexes - MUG Denver - 20160329Douglas Duncan
Indexes are data structures that store a subset of data to allow for efficient retrieval. MongoDB stores indexes using a b-tree format. There are several types of indexes including simple, compound, multikey, full-text, and geospatial indexes. Indexes improve performance by enabling efficient retrieval, sorting, and filtering of documents. Indexes are created using the createIndex command and their usage can be checked using explain plans.
Indexes are references to documents that are efficiently ordered by key and maintained in a tree structure for fast lookup. They improve the speed of document retrieval, range scanning, ordering, and other operations by enabling the use of the index instead of a collection scan. While indexes improve query performance, they can slow down document inserts and updates since the indexes also need to be maintained. The query optimizer aims to select the best index for each query but can sometimes be overridden.
This document discusses indexing and query optimization in MongoDB. It provides an overview of indexes and how they can improve query performance by allowing certain queries to use indexes rather than scanning all documents. It describes different types of indexes like compound, unique, multikey, covered and sparse indexes. It also covers topics like profiling queries, creating and managing indexes, and strategies for effective indexing.
Automated Slow Query Analysis: Dex the Index RobotMongoDB
This document discusses MongoDB indexing and the Dex automation tool. It provides an overview of MongoDB indexing fundamentals and best practices. It then introduces Dex, explaining that it analyzes query logs and profiles to recommend optimal indexes. The document demonstrates Dex's usage and capabilities, such as working with live query streams, filtering by namespace, and focusing on long-running queries. It outlines Dex's internal workings and future development plans.
Optimizing MongoDB queries is essential for enhancing application performance. One effective strategy is the use of compound indexes, which can significantly speed up queries that filter or sort on multiple fields. By creating an index that includes all the fields involved in a query, MongoDB can quickly locate the relevant documents without scanning the entire collection. This approach not only improves query response times but also reduces the load on the database server. For instance, if your application frequently queries a collection based on both 'category' and 'price', creating a compound index on these fields can lead to substantial performance gains. It's important to note that the order of fields in a compound index matters; the sequence should reflect the most common query patterns to maximize efficiency. Additionally, while indexes enhance read operations, they can impact write performance due to the overhead of maintaining the index during insert, update, and delete operations. Therefore, it's crucial to balance the benefits of faster queries with the potential costs in write performance. By carefully designing and implementing compound indexes, you can achieve optimal query performance in MongoDB.
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB
This presentation discusses migrating data from other data stores to MongoDB Atlas. It begins by explaining why MongoDB and Atlas are good choices for data management. Several preparation steps are covered, including sizing the target Atlas cluster, increasing the source oplog, and testing connectivity. Live migration, mongomirror, and dump/restore options are presented for migrating between replicasets or sharded clusters. Post-migration steps like monitoring and backups are also discussed. Finally, migrating from other data stores like AWS DocumentDB, Azure CosmosDB, DynamoDB, and relational databases are briefly covered.
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB
These days, everyone is expected to be a data analyst. But with so much data available, how can you make sense of it and be sure you're making the best decisions? One great approach is to use data visualizations. In this session, we take a complex dataset and show how the breadth of capabilities in MongoDB Charts can help you turn bits and bytes into insights.
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB
MongoDB Kubernetes operator and MongoDB Open Service Broker are ready for production operations. Learn about how MongoDB can be used with the most popular container orchestration platform, Kubernetes, and bring self-service, persistent storage to your containerized applications. A demo will show you how easy it is to enable MongoDB clusters as an External Service using the Open Service Broker API for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB
Are you new to schema design for MongoDB, or are you looking for a more complete or agile process than what you are following currently? In this talk, we will guide you through the phases of a flexible methodology that you can apply to projects ranging from small to large with very demanding requirements.
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB
Humana, like many companies, is tackling the challenge of creating real-time insights from data that is diverse and rapidly changing. This is our journey of how we used MongoDB to combined traditional batch approaches with streaming technologies to provide continues alerting capabilities from real-time data streams.
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB
Time series data is increasingly at the heart of modern applications - think IoT, stock trading, clickstreams, social media, and more. With the move from batch to real time systems, the efficient capture and analysis of time series data can enable organizations to better detect and respond to events ahead of their competitors or to improve operational efficiency to reduce cost and risk. Working with time series data is often different from regular application data, and there are best practices you should observe.
This talk covers:
Common components of an IoT solution
The challenges involved with managing time-series data in IoT applications
Different schema designs, and how these affect memory and disk utilization – two critical factors in application performance.
How to query, analyze and present IoT time-series data using MongoDB Compass and MongoDB Charts
At the end of the session, you will have a better understanding of key best practices in managing IoT time-series data with MongoDB.
Join this talk and test session with a MongoDB Developer Advocate where you'll go over the setup, configuration, and deployment of an Atlas environment. Create a service that you can take back in a production-ready state and prepare to unleash your inner genius.
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB
Our clients have unique use cases and data patterns that mandate the choice of a particular strategy. To implement these strategies, it is mandatory that we unlearn a lot of relational concepts while designing and rapidly developing efficient applications on NoSQL. In this session, we will talk about some of our client use cases, the strategies we have adopted, and the features of MongoDB that assisted in implementing these strategies.
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB
Encryption is not a new concept to MongoDB. Encryption may occur in-transit (with TLS) and at-rest (with the encrypted storage engine). But MongoDB 4.2 introduces support for Client Side Encryption, ensuring the most sensitive data is encrypted before ever leaving the client application. Even full access to your MongoDB servers is not enough to decrypt this data. And better yet, Client Side Encryption can be enabled at the "flick of a switch".
This session covers using Client Side Encryption in your applications. This includes the necessary setup, how to encrypt data without sacrificing queryability, and what trade-offs to expect.
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB
MongoDB Kubernetes operator is ready for prime-time. Learn about how MongoDB can be used with most popular orchestration platform, Kubernetes, and bring self-service, persistent storage to your containerized applications.
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB
These days, everyone is expected to be a data analyst. But with so much data available, how can you make sense of it and be sure you're making the best decisions? One great approach is to use data visualizations. In this session, we take a complex dataset and show how the breadth of capabilities in MongoDB Charts can help you turn bits and bytes into insights.
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB
When you need to model data, is your first instinct to start breaking it down into rows and columns? Mine used to be too. When you want to develop apps in a modern, agile way, NoSQL databases can be the best option. Come to this talk to learn how to take advantage of all that NoSQL databases have to offer and discover the benefits of changing your mindset from the legacy, tabular way of modeling data. We’ll compare and contrast the terms and concepts in SQL databases and MongoDB, explain the benefits of using MongoDB compared to SQL databases, and walk through data modeling basics so you feel confident as you begin using MongoDB.
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB
Join this talk and test session with a MongoDB Developer Advocate where you'll go over the setup, configuration, and deployment of an Atlas environment. Create a service that you can take back in a production-ready state and prepare to unleash your inner genius.
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB
The document discusses guidelines for ordering fields in compound indexes to optimize query performance. It recommends the E-S-R approach: placing equality fields first, followed by sort fields, and range fields last. This allows indexes to leverage equality matches, provide non-blocking sorts, and minimize scanning. Examples show how indexes ordered by these guidelines can support queries more efficiently by narrowing the search bounds.
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB
Aggregation pipeline has been able to power your analysis of data since version 2.2. In 4.2 we added more power and now you can use it for more powerful queries, updates, and outputting your data to existing collections. Come hear how you can do everything with the pipeline, including single-view, ETL, data roll-ups and materialized views.
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB
The document describes a methodology for data modeling with MongoDB. It begins by recognizing the differences between document and tabular databases, then outlines a three step methodology: 1) describe the workload by listing queries, 2) identify and model relationships between entities, and 3) apply relevant patterns when modeling for MongoDB. The document uses examples around modeling a coffee shop franchise to illustrate modeling approaches and techniques.
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB
MongoDB Atlas Data Lake is a new service offered by MongoDB Atlas. Many organizations store long term, archival data in cost-effective storage like S3, GCP, and Azure Blobs. However, many of them do not have robust systems or tools to effectively utilize large amounts of data to inform decision making. MongoDB Atlas Data Lake is a service allowing organizations to analyze their long-term data to discover a wealth of information about their business.
This session will take a deep dive into the features that are currently available in MongoDB Atlas Data Lake and how they are implemented. In addition, we'll discuss future plans and opportunities and offer ample Q&A time with the engineers on the project.
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB
Virtual assistants are becoming the new norm when it comes to daily life, with Amazon’s Alexa being the leader in the space. As a developer, not only do you need to make web and mobile compliant applications, but you need to be able to support virtual assistants like Alexa. However, the process isn’t quite the same between the platforms.
How do you handle requests? Where do you store your data and work with it to create meaningful responses with little delay? How much of your code needs to change between platforms?
In this session we’ll see how to design and develop applications known as Skills for Amazon Alexa powered devices using the Go programming language and MongoDB.
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB
aux Core Data, appréciée par des centaines de milliers de développeurs. Apprenez ce qui rend Realm spécial et comment il peut être utilisé pour créer de meilleures applications plus rapidement.
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB
Il n’a jamais été aussi facile de commander en ligne et de se faire livrer en moins de 48h très souvent gratuitement. Cette simplicité d’usage cache un marché complexe de plus de 8000 milliards de $.
La data est bien connu du monde de la Supply Chain (itinéraires, informations sur les marchandises, douanes,…), mais la valeur de ces données opérationnelles reste peu exploitée. En alliant expertise métier et Data Science, Upply redéfinit les fondamentaux de la Supply Chain en proposant à chacun des acteurs de surmonter la volatilité et l’inefficacité du marché.
16. How do I create indexes?
// Create an index if one does not exist
db.recipes.createIndex({ main_ingredient: 1 })
// The client remembers the index and raises no errors
db.recipes.ensureIndex({ main_ingredient: 1 })
* 1 means ascending, -1 descending
17. What can be indexed?
// Multiple fields (compound key indexes)
db.recipes.ensureIndex({
main_ingredient: 1,
calories: -1
})
// Arrays of values (multikey indexes)
{
name: 'Chicken Noodle Soup’,
ingredients : ['chicken', 'noodles']
}
db.recipes.ensureIndex({ ingredients: 1 })
18. What can be indexed?
// Subdocuments
{
name : 'Pavlova',
contributor: {
name: 'Ima Aussie',
id: 'ima123'
}
}
db.recipes.ensureIndex({ 'contributor.id': 1 })
db.recipes.ensureIndex({ 'contributor': 1 })
19. How do I manage indexes?
// List a collection's indexes
db.recipes.getIndexes()
db.recipes.getIndexKeys()
// Drop a specific index
db.recipes.dropIndex({ ingredients: 1 })
// Drop all indexes and recreate them
db.recipes.reIndex()
// Default (unique) index on _id
20. Background Index Builds
// Index creation is a blocking operation that can take a long time
// Background creation yields to other operations
db.recipes.ensureIndex(
{ ingredients: 1 },
{ background: true }
)
22. Uniqueness Constraints
// Only one recipe can have a given value for name
db.recipes.ensureIndex( { name: 1 }, { unique: true } )
// Force index on collection with duplicate recipe names – drop the
duplicates
db.recipes.ensureIndex(
{ name: 1 },
{ unique: true, dropDups: true }
)
* dropDups is probably never what you want
23. Sparse Indexes
// Only documents with field calories will be indexed
db.recipes.ensureIndex(
{ calories: -1 },
{ sparse: true }
)
// Allow multiple documents to not have calories field
db.recipes.ensureIndex(
{ name: 1 , calories: -1 },
{ unique: true, sparse: true }
)
* Missing fields are stored as null(s) in the index
24. Geospatial Indexes
// Add latitude, longitude coordinates
{
name: '10gen Sydney’,
loc: [ 151.21037, -33.88456 ]
}
// Index the coordinates
db.locations.ensureIndex( { loc : '2d' } )
// Query for locations 'near' a particular coordinate
db.locations.find({
loc: { $near: [ 151.21, -33.88 ] }
})
25. TTL Collections
// Documents must have a BSON UTC Date field
{ 'status' : ISODate('2012-11-09T11:44:07.211Z'), … }
// Documents are removed after 'expireAfterSeconds' seconds
db.recipes.ensureIndex(
{ submitted_date: 1 },
{ expireAfterSeconds: 3600 }
)
26. Limitations
• Collections can not have > 64 indexes.
• Index keys can not be > 1024 bytes (1K).
• The name of an index, including the namespace, must be <
128 characters.
• Queries can only use 1 index*
• Indexes have storage requirements, and impact the
performance of writes.
• In memory sort (no-index) limited to 32mb of return data.
28. Profiling Slow Ops
db.setProfilingLevel( n , slowms=100ms )
n=0 profiler off
n=1 record operations longer than slowms
n=2 record all queries
db.system.profile.find()
* The profile collection is a capped collection, and fixed in size
29. The Explain Plan (Pre Index)
db.recipes.find( { calories:
{ $lt : 40 } }
).explain( )
{
"cursor" : "BasicCursor" ,
"n" : 42,
"nscannedObjects” : 12345
"nscanned" : 12345,
...
"millis" : 356,
...
}
* Doesn’t use cached plans, re-evals and resets cache
30. The Explain Plan (Post Index)
db.recipes.find( { calories:
{ $lt : 40 } }
).explain( )
{
"cursor" : "BtreeCursor calories_-1" ,
"n" : 42,
"nscannedObjects": 42
"nscanned" : 42,
...
"millis" : 0,
...
}
* Doesn’t use cached plans, re-evals and resets cache
32. The Query Optimiser
• For each "type" of query, MongoDB
periodically tries all useful indexes
• Aborts the rest as soon as one plan wins
• The winning plan is temporarily cached for
each “type” of query
33. Manually Select Index to Use
// Tell the database what index to use
db.recipes.find({
calories: { $lt: 1000 } }
).hint({ _id: 1 })
// Tell the database to NOT use an index
db.recipes.find(
{ calories: { $lt: 1000 } }
).hint({ $natural: 1 })
34. Use Indexes to Sort Query
Results
// Given the following index
db.collection.ensureIndex({ a:1, b:1 , c:1, d:1 })
// The following query and sort operations can use the index
db.collection.find( ).sort({ a:1 })
db.collection.find( ).sort({ a:1, b:1 })
db.collection.find({ a:4 }).sort({ a:1, b:1 })
db.collection.find({ b:5 }).sort({ a:1, b:1 })
35. Indexes that won’t work for
sorting query results
// Given the following index
db.collection.ensureIndex({ a:1, b:1, c:1, d:1 })
// These can not sort using the index
db.collection.find( ).sort({ b: 1 })
db.collection.find({ b: 5 }).sort({ b: 1 })
36. Index Covered Queries
// MongoDB can return data from just the index
db.recipes.ensureIndex({ main_ingredient: 1, name: 1 })
// Return only the ingredients field
db.recipes.find(
{ main_ingredient: 'chicken’ },
{ _id: 0, name: 1 }
)
// indexOnly will be true in the explain plan
db.recipes.find(
{ main_ingredient: 'chicken' },
{ _id: 0, name: 1 }
).explain()
{
"indexOnly": true,
}
39. Trying to Use Multiple
Indexes
// MongoDB can only use one index for a query
db.collection.ensureIndex({ a: 1 })
db.collection.ensureIndex({ b: 1 })
// Only one of the above indexes is used
db.collection.find({ a: 3, b: 4 })
40. Compound Key Mistakes
// Compound key indexes are very effective
db.collection.ensureIndex({ a: 1, b: 1, c: 1 })
// But only if the query is a prefix of the index
// This query can't effectively use the index
db.collection.find({ c: 2 })
// …but this query can
db.collection.find({ a: 3, b: 5 })
42. Regular Expressions
db.users.ensureIndex({ username: 1 })
// Left anchored regex queries can use the index
db.users.find({ username: /^joe smith/ })
// But not generic regexes
db.users.find({username: /smith/ })
// Or case insensitive queries
db.users.find({ username: /Joe/i })