In this blog post we will explore how to manage Mongos servers using Cloud Manager. Mongos (short for “MongoDB Shard”) is a routing service for MongoDB shard configurations that process queries from the application layer and determines the location of the data in the sharded cluster.
How to Add a Mongos server
For deployments under automation, it’s very easy to add a Mongos to your Sharded Cluster. Go to Deployments>Processes and click the wrench at the Sharded Cluster top level.
Next, scroll down to the MongoS settings. There you will see your current settings. Increase the # of Mongos processes to the desired number. For determining which host to deploy the new Mongos, here I chose Regular Expression and entered a string matching an existing host. Choose your desired port range for the Mongos. When you are finished click Apply.
Next review your changes. Here you see that the number of Mongos is increasing from 3 to 4. Confirm the host, port, and other details and click Click & Confirm.
How to Remove a Mongos server
Conversely, it’s also simple to remove a Mongos from your deployment if it’s under automation. From the Deployment>Processes view, change the filter to ‘Mongos’ as shown below. We must first Shutdown the process. Click the “…” menu for the target mongos and choose the Shutdown option. Review & deploy the change.
Once the target mongos is shut down go back to Deployment>Processes and select the ‘Mongos’ filter again. Click the “…” menu for the target mongos and this time choose ‘Remove from Cluster’
Finally, review your changes. Confirm that the number of Mongos processes is reduced and that the target host and server looks correct. Confirm & Deploy to complete the operation.
What’s New in MongoDB 3.2, Part 3: Tools and Integrations for Data Analysts and DBAs
Welcome to the final post in our 3-part MongoDB 3.2 blog series. In part 1 we covered the new storage engines and the use-cases they served. In part 2 we covered features designed to support mission-critical applications, including document validation and the enhanced replication protocol. In this post, I’ll provide an overview of new tools and integrations supporting data analysts, DBAs, and operations teams. Remember, you can get the detail now on everything MongoDB 3.2 offers by downloading the What’s New white paper . New Users With MongoDB deployed across a wider range of an organization’s application portfolio, data analysts, DBAs, and operations teams will need to integrate MongoDB within their existing processes and tool sets. MongoDB 3.2 allows analysts to support the business with new insights from untapped data sources, while DBAs and Ops teams are able to operationalize MongoDB alongside existing relational databases, protecting existing investments in management platforms and skillsets. Data Analysts and Scientists ### MongoDB Connector for BI Driven by growing requirements for self-service analytics, faster discovery and prediction based on real-time operational data, and the need to integrate multi-structured and streaming data sets, BI and analytics platforms are one of the fastest growing software markets. To address these requirements, modern application data stored in MongoDB can for the first time be easily explored with industry-standard SQL-based BI and analytics platforms. Using the MongoDB Connector for BI , analysts, data scientists and business users can now seamlessly visualize semi-structured and unstructured data managed in MongoDB, alongside traditional data in their SQL databases, using the same BI tools deployed within millions of enterprises. Figure 1: Uncover new insights with powerful visualizations generated from MongoDB MongoDB Connector for BI Implementation SQL-based BI tools expect to connect to a data source with a fixed schema presenting tabular data. This presents a challenge when working with MongoDB’s dynamic schema and rich, multi-dimensional documents. In order for BI tools to query MongoDB as a data source, the BI Connector does the following: Provides the BI tool with the schema of the MongoDB collection to be visualized. Users can review the schema output to ensure data types, sub-documents and arrays are correctly represented Translates SQL statements issued by the BI tool into equivalent MongoDB queries that are then sent to MongoDB for processing Converts the returned results into the tabular format expected by the BI tool, which can then visualize the data based on user requirements The BI Connector is available with MongoDB Enterprise Advanced. Watch the demo to see the BI Connector in action, and review the documentation to learn more. You can also download the BI Connector for evaluation Dynamic Lookup: Bringing Left Outer JOINs to MongoDB Applications get great efficiency from MongoDB by combining data that is accessed together into a single document. In contrast, a typical relational database schema scatters related data across scores of tables – e.g., a blog site that stores every tag, category, comment, author and callback as rows in separate tables from the blog post they’re associated with. Typically it is most advantageous to take a denormalized data modeling approach for operational databases – the efficiency of reading or writing an entire record in a single operation outweighing any modest increase in storage requirements. However, there are examples where normalizing data can be beneficial, especially when data from multiple sources needs to be blended for analysis. Consider a shopping cart, which presents two options for handling the order and product information: Include all data for an order in the same document Fast reads – one find delivers all the required data The order document contains the product details that were correct at the time the order was placed; the price of that product may change in the future but the order document remains an accurate representation of the order Consumes additional storage – the details of each product are stored in many order documents; this has become less of an issue as memory and storage prices have fallen Order document references product documents Space efficient – product details are stored just once Slower reads – multiple trips to the database If an attribute of the product (such as the unit price) changes in the future, any older order documents are then incorrect as they reference this newer version Extra application logic – an application must iterate over product IDs in the order document and then fetch the product documents MongoDB 3.2 introduces the ability to combine data from multiple collections by implementing left outer joins through the $lookup operator, which can now be included as a stage in a MongoDB Aggregation Framework pipeline . The new $lookup stage provides more flexibility in data modeling, and allows richer analytics to be run with higher performance and less application-side code. You can learn more from the documentation and see worked examples in this series of blog posts . Real-Time Analytics and Search MongoDB 3.2 extends the options for performing analytics on live, operational data – ensuring that answers are delivered quickly and simply, and are based on current data. Work that would previously have needed to be implemented in client code can now be performed by the database – freeing the developer to focus on building new features. Improved Aggregation The aggregation pipeline is a powerful way to perform complex analytical queries on MongoDB data. Aggregation pipeline stages allow manipulation of a "stream" of documents from a collection that can either be returned via a cursor to the client (similar to find ), or be stored in a new collection via a final $out stage. When analyzing very large data sets, it is frequently sufficient to look at a random sample of documents rather than all of the data. For example, if you wanted to compare the number of check-ins to coffee shops to those at bars, you can get a good approximation without searching through every single check-in. Previously, this sampling would have to have been implemented in the application, but MongoDB introduces the $sample operator, which can be included at any point in the aggregation pipeline. MongoDB documents can store arrays as well as simple values. While this feature is very expressive and powerful, without the corresponding ability to manipulate and filter arrays in documents during aggregations, their usefulness has been limited in an analytical context. New operators have been added to allow more flexibility when dealing with arrays: $slice , $arrayElemAt , $concatArrays , $isArray , $filter , and $min . New mathematical operators have been added for operations such as truncate, ceiling, floor, absolute, rounding, square root, logarithms and standard deviations. These operators can be used to move code from the client tier directly into the database, allowing higher performance with lower developer complexity. By combining the new and existing operators aggregation pipelines can be built to generate sophisticated results with a single query. Review the documentation to learn more about all of the aggregation pipeline enhancements. Improved Text Search Text searches on the data in MongoDB can either be performed in the database or by an external search engine. Performing the search within the database is more efficient and simpler to administer, so that is the preferred option whenever possible. MongoDB 3.2 increases the set of use cases that can be met with in-database text searches by adding support for case-sensitive searches, as well as additional languages including Arabic, Farsi, Urdu, Simplified Chinese, and Traditional Chinese. To provide support for these languages, MongoDB Enterprise Advanced provides integratation with Basis Technology Rosette Linguistics Platform (RLP) to perform normalization, word breaking, sentence breaking, and stemming or tokenization depending on the language. More information on text search enhancements can be found in the documentation . DBAs: MongoDB Compass MongoDB’s dynamic schema and rich document model make developers more productive, but they also make it difficult to explore and understand the underlying data and its structure – in particular for non-developers who aren't familiar with the MongoDB query language. The MongoDB Compass GUI allows users to understand the structure of data in the database and perform ad hoc queries against it – all with zero knowledge of MongoDB's query language. Typical users could include architects building a new MongoDB project or a DBA who has inherited a database from an engineering team, and who must now maintain it in production. They need to understand what kind of data is present, define what indexes might be appropriate, and identify if Document Validation rules should be added to enforce a consistent document structure. Until now, users wishing to understand the shape of their data would have to connect to the MongoDB shell and write queries to reverse engineer the document structure, field names and data types. Similarly, anyone wanting to run custom queries on the data would need to understand MongoDB's query language. MongoDB Compass provides users with a graphical view of their MongoDB schema by sampling a subset of documents from a collection. By using sampling, MongoDB Compass minimizes database overhead and can present results to the user almost instantly. Figure 2: Document structure and contents exposed by MongoDB Compass Querying Data As illustrated in Figure 3, a query can be built and executed by simply selecting document elements from the MongoDB Compass user interface. By selecting multiple values, sophisticated queries can be built. The query can then be executed at the push of a button and the results viewed both graphically and as a set of JSON documents. Figure 3: Interactively build and execute database queries with MongoDB Compass MongoDB Compass samples the database to provide a fast, interactive experience no matter how large the database. If the full results are needed then the query can be simply copied and pasted into a MongoDB shell window. MongoDB Compass is included with MongoDB Professional and MongoDB Enterprise Advanced. You can learn more about Compass in the documentation , and see it in action in our short 3-part demo series: Part 1: Introduction to Compass Part 2: Schema visualization Part 3: Visual query building To evaluate MongoDB Compass, head to the MongoDB Download Center . Operations Teams MongoDB Ops Manager and Cloud Manager are the best way to run MongoDB, reducing tasks such as deployment, scaling, upgrades and backups to just a few clicks or an API call. Operations teams can be 10-20x more productive using the Ops or Cloud Manager platforms. With the enhancements to both Ops and Cloud Manager in MongoDB 3.2, administrators can: Integrate MongoDB alongside existing Application Performance Monitoring platforms for global health visibility over the entire IT estate, all from a single pane of glass Drill down into any MongoDB-specific issues using Ops Manager’s granular monitoring of database telemetry, including new query profiler visualizations Use Ops Manager automation to initiate zero-downtime maintenance and upgrade activities, such as rolling out new indexes across a sharded cluster Create point-in-time, consistent snapshots of the database on standard network-mountable filesystems, and restore complete running MongoDB clusters from backup files. APM Integration: New Relic & AppDynamics Many operations teams use Application Performance Monitoring (APM) platforms such as New Relic and AppDynamics to gain global oversight of their complete IT infrastructure from a single management UI. Issues that risk affecting customer experience can be quickly identified and isolated to specific components – whether attributable to devices, hardware infrastructure, networks, APIs, application code, databases and more. The MongoDB drivers have been enhanced with a new API that exposes query performance metrics to APM tools. Administrators can monitor time spent on each operation, and identify slow running queries that require further analysis and optimization. In addition, Cloud Manager will provide packaged integration with the New Relic platform. Key metrics from Cloud Manager are accessible to the APM for visualization, enabling MongoDB health to be monitored and correlated with the rest of the application estate. Figure 4: MongoDB integrated into a single view of application performance As shown in Figure 4, summary metrics familiar to Cloud Manager users are presented within the APM’s UI. Administrators can also run New Relic Insights for analytics against monitoring data to generate dashboards that provide real-time tracking of Key Performance Indicators (KPIs). If the operations team needs finer grained telemetry, they can drill down into the 100+ system metrics maintained by Cloud Manager. For example, the new visual query profiler helps diagnose slow running queries, which can then be resolved by adding a new index and automatically deploying that across every node in the cluster. Query Performance Visualization: Enabling Fast and Simple Query Optimization The MongoDB database profiler collects fine-grained information that can be used to analyze query performance. However, the output could be difficult to parse, making slow running queries difficult to correct. In addition, the profiler had to be individually activated for each MongoDB instance, and the output manually aggregated from every node to provide a holistic view across the entire deployment. Delivered as part of Ops Manager and Cloud Manager, the new Visual Query Profiler provides a quick and convenient way for operations teams and DBAs to analyze specific queries or query families. The Visual Query Profiler (as shown in Figure 5) displays how query and write latency varies over time – making it simple to identify slower queries with common access patterns and characteristics, as well as identify any latency spikes. A single click in the Ops Manager UI activates the profiler, which then consolidates and displays metrics from every node in a single screen. Figure 5: Visual Query Profiling in MongoDB Ops Manager Index Suggestions & Automated Index Builds Further simplifying operations, the visual query profiler will analyze data it collects to provide recommendations for new indexes that can be created to improve query performance. Once identified, these new indexes need to be rolled out in the production system. In order to minimize the impact to the live system, the best practice is to perform a rolling index build – starting with each of the secondaries and finally applying changes to the original primary, after swapping its role with one of the secondaries. While this rolling process can be performed manually, Ops Manager and Cloud Manager can now automate the process across MongoDB replica sets, reducing operational overhead and the risk of failovers caused by incorrectly sequencing management processes. New Indexing Option: Partial Indexes Secondary indexes are one of the ways that MongoDB distinguishes itself from NoSQL databases – allowing applications to efficiently access their data in multiple ways. However, secondary indexes do come with a cost: Database writes will be slower when they need to update the secondary index Memory and storage is needed to store the secondary index Partial indexes balance delivering good query performance while consuming fewer system resources. For example, consider an order processing application. The order collection is frequently queried by the application to display all incomplete orders for a particular user. Building an index on the userID field of the collection is necessary for good performance. However, only a small percentage of orders are in progress at a given time. Limiting the index on userID to contain only orders that are in the “active” state could reduce the number of index entries from millions to thousands, saving working set memory and disk space, while speeding up queries even further as smaller indexes result in faster searches. By specifying a filtering expression during index creation, a user can instruct MongoDB to include only documents that meet the desired conditions. When performing the database find operation, the application should include the value being used for the filtering as well as the indexed value in order for the partial index to be used by the optimizer. Review the documentation to learn more. Additional Ops Manager Enhancements Beyond the functionality discussed above, a number of enhancements improve productivity of Ops teams and simply installation and management. Ops teams can now automate their database restores reliably and safely using Ops Manager and Cloud Manager. Complete development, test, and recovery clusters can now be built in a few simple clicks. Integrating with existing storage infrastructure, MongoDB backup files can now be stored on a standard network-mountable file system. Operations teams can configure backups against specific collections only, rather than the entire database, speeding up backups and reducing the requisite storage space. This enhancement is also available in the Cloud Manager platform. Installation and configuration of all application and backup components can now be made through the centralized Ops Manager UI, which also provides a single, at-a-glance dashboard for health monitoring. Enhancements to the backup architecture provide faster time to first database snapshot. Eliminating false alarms, maintenance windows can now be defined during which Ops Manager and Cloud Manager alerts will not be triggered. From APM integration through to profiler visualization with index suggestions and automated rolling index builds, through to platform simplification and automated cluster restores, Ops Manager can make your teams more productive. Next Steps This post wraps up our 3-part blog series. As you have seen, MongoDB 3.2 is a significant release of the world’s fastest growing database: New storage engine options, coupled with document validation, the enhanced replication protocol and sharding improvements extend the range of mission-critical applications MongoDB can serve. New tools such as the BI Connector, Compass, and Cloud Manager integration to APM platforms allow organizations to take advantage of MongoDB while protecting investments in existing frameworks and workflows. Remember, you can get the detail now on everything MongoDB 3.2 offers by downloading the What’s New white paper . Alternatively, if you’d had enough of reading about it and want to get your hands on the code now, then: Download MongoDB 3.2 today. Evaluate MongoDB Enterprise, along with the Connector for BI, MongoDB Compass and Ops Manager by heading to the MongoDB download center . To start using MongoDB 3.2 as quickly and efficiently as possible, bring in the experts. MongoDB’s consulting engineers can deliver a private training on 3.2 features tailored to your needs, then work with you to develop a customized upgrade plan for your deployment. Interested? Learn more About the Author - Mat Keep Mat is a director within the MongoDB product marketing team, responsible for building the vision, positioning and content for MongoDB’s products and services, including the analysis of market trends and customer requirements. Prior to MongoDB, Mat was director of product management at Oracle Corp. with responsibility for the MySQL database in web, telecoms, cloud and big data workloads. This followed a series of sales, business development and analyst / programmer positions with both technology vendors and end-user companies.
Being Latine in Tech: Two MongoDB Employees Share Their Advice on Building Careers in Engineering
Ashley Naranjo and Martin Bajana, members of MongoDB’s employee resource group QueLatine, share their career journeys and offer insight into how other members of the Latine community can build careers in tech. Jackie Denner: How did you make your way into the tech industry? Ashley Naranjo: I am a first-generation Latina with a passion for Information Technology and a knack for problem-solving. After graduating early from high school, I embarked on a career in Nursing. I chose Nursing initially because I wanted to make a difference and help others, but my path took an unexpected turn when COVID-19 reshaped our world. In light of the circumstances, I reevaluated my options and decided to seize an opportunity with a program called Year Up . During the intensive six-month training and deployment phase, I not only completed rigorous coursework but also obtained IT Google Coursera certifications and actively pursued CompTIA certifications. This experience allowed me to secure an internship at Meta (Facebook) as an Enterprise Operation IT Support Tech, where my love for technology blossomed. During my time at Meta, I had the privilege of assisting diverse Meta users worldwide with a wide range of technical issues, including troubleshooting, software and hardware support, internal access permissions, and more. The exposure to a global tech environment further fueled my passion for the field. When my internship concluded, I was offered a 1-year contract role with Meta to continue my work as a support tech for the same team. Throughout that year, I immersed myself in all aspects of technology, maximizing my learning opportunities and applying my networking skills. As time went on, I knew I needed a new challenge. This led me to embark on a search for an exciting role, which eventually brought me to MongoDB. I am passionate about driving technological innovation, and MongoDB is a place where I can make an impact. Martin Bajana: My interest in technology stems from a variety of sources. From a young age, I developed a strong passion for video games and exploring new technologies. Whether it was experimenting with the latest gaming consoles or delving into computer hardware, I relished the opportunity to learn and understand the inner workings of these technologies. In school, I discovered my affinity for mathematics, which further solidified my decision to pursue a career in the tech industry. Choosing to study computer science in college was a natural progression for me, as it allowed me to combine my love for technology with my aptitude for problem-solving. After completing my education, I was recruited by Verizon, where I worked on front-end applications and Android development. Although the transition was initially challenging, I persevered and regained my confidence. It was during this period that I realized a career in technology was my long-term aspiration. Throughout my tenure at Verizon, I embraced opportunities to work across various teams, acquiring valuable experience and honing my skills. Eventually, I made the decision to join MongoDB, which has provided me with an enriching journey and the chance to shape my career in the tech industry. JD: Have there been any challenges you've faced throughout your career? AN: Imposter syndrome has been a significant challenge for me throughout my career, and it's something I still deal with to this day. When surrounded by my talented colleagues, I would often compare myself to them and focus on my perceived weaknesses and flaws, leading to a lack of self-confidence. However, I tackled this issue by addressing my feelings with my manager. Her support and guidance helped me realize my own potential and acknowledge my accomplishments. Maintaining a positive mindset has enabled me to view myself as a competent engineer and recognize the value I bring to my team. I have learned to take ownership of my successes and embrace opportunities for growth. Stepping out of my comfort zone has become a regular practice, as personal and professional development often stems from embracing challenges and discomfort. By giving myself permission to take up space and be confident in my abilities, I have been able to overcome imposter syndrome and continue to thrive in my role. MB: I have been fortunate enough to work for companies and teams that value and respect me for the work I deliver. Being in the tech industry and growing up in a culturally diverse region of the country, I have had exposure to individuals from various backgrounds and identities, which has made me more comfortable as a Latinx individual in the industry. My personal goal is to promote a work environment where everyone is judged based on the contributions they bring to the team, rather than their identity. I believe in supporting and respecting the identities of my peers and coworkers while fostering a culture of inclusivity and equality. JD: How has MongoDB supported your career growth and development? AN: In my time working at MongoDB, I have experienced exceptional support that has greatly contributed to my professional development and growth. As an engineer at MongoDB, I have been provided with numerous opportunities to expand my knowledge and skills through participation in tech talks, hackathons, and continuous learning about emerging technologies. I am grateful for the proactive approach taken by my manager and team leaders in fostering my growth as an engineer. Additionally, MongoDB's commitment to diversity and inclusion is evident through the company's DEI initiatives. Platforms like our employee resource group “QueLatine” have made me feel a stronger sense of connection and belonging, particularly among my Latinx peers. By recognizing the power of our diverse backgrounds and experiences, MongoDB empowers us to have a meaningful impact in the industry. MB: I have experienced full support from my leader since day one. They have proactively sought to understand my career goals and have helped me create a clear career path to achieve those goals. This level of support has enabled me to take on challenging projects and initiatives within the company, allowing me to grow and develop in my career. Furthermore, MongoDB offers a wealth of learning and development resources to its employees, which I have fully utilized to continue learning and growing my skill set. JD: What is your advice for other Latines who want to begin careers in tech? AN: Having made a significant career change myself, I can empathize with the challenges that come with exploring new paths, particularly in the tech industry. As a Latina in tech, I feel a strong desire to encourage and raise awareness within our community about the incredible resources and opportunities that are available to us. My advice to others who may be considering a similar journey is to prioritize the continuous development of your technical skills, actively seek out mentoring opportunities, push yourself beyond your comfort zone by honing your networking abilities, and most importantly, believe in yourself and your ability to achieve great things! MB: Navigating the vast world of technology can certainly be overwhelming, but it's important not to fear feeling lost. Even after 12 years in this career, there are still days where I come across something I've never heard of before. Fortunately, we live in a world abundant with resources for continuous learning. My advice is to take the time to explore and ask questions. Seek out open-source projects that you can contribute to, and connect with other professionals in the tech industry who can share their experiences and provide guidance. Additionally, taking advantage of hackathons and other tech events can expose you to new technologies and ideas. Don't be afraid to make mistakes, and most importantly, don't give up! Join us in transforming the way developers work with data. Build your tech career at MongoDB .