To read up on the most up-to-date blog posts on MongoDB check out Planet MongoDB, a newly-released aggregator of the best blogs on MongoDB. MongoDB community members share tips, ticks and best practices on using MongoDB on a regular basis, and Planet MongoDB will bring that expertise into a single feed.
If you have a blog you would like to see added to the aggregator let us know so we can add you in.
How MongoDB's Journaling Works
This was originally posted to Kristina Chodorow’s blog, Snail in a Turtleneck I was working on a section on the gooey innards of journaling for The Definitive Guide , but then I realized it’s an implementation detail that most people won’t care about. However, I had all of these nice diagrams just laying around. Good idea, Patrick! So, how does journaling work? Your disk has your data files and your journal files, which we’ll represent like this: When you start up mongod , it maps your data files to a shared view . Basically, the operating system says: “Okay, your data file is 2,000 bytes on disk. I’ll map that to memory address 1,000,000-1,002,000. So, if you read the memory at memory address 1,000,042, you’ll be getting the 42nd byte of the file.“ (Also, the data won’t necessary be loaded until you actually access that memory.) This memory is still backed by the file: if you make changes in memory, the operating system will flush these changes to the underlying file. This is basically how mongod works without journaling: it asks the operating system to flush in-memory changes every 60 seconds. However, with journaling, mongod makes a second mapping, this one to a private view . Incidentally, this is why enabling journalling doubles the amount of virtual memory mongod uses. Note that the private view is not connected to the data file, so the operating system cannot flush any changes from the private view to disk. Now, when you do a write, mongod writes this to the private view. mongod will then write this change to the journal file, creating a little description of which bytes in which file changed. The journal appends each change description it gets. At this point, the write is safe. If mongod crashes, the journal can replay the change, even though it hasn’t made it to the data file yet. The journal will then replay this change on the shared view. Finally, at a glacial speed compared to everything else, the shared view will be flushed to disk. By default, mongod requests that the OS do this every 60 seconds. The last step is that mongod remaps the shared view to the private view. This prevents the private view from getting too “dirty” (having too many changes from the shared view it was mapped from). And that’s how journaling works. Thanks to Richard, who gave the best explanation of this I’ve heard (Richard is going to be teaching an online course on MongoDB this fall, if you’re interested in more wisdom from the source).
MongoDB and AWS: How a decade-old collaboration got even better in 2022
Developers select MongoDB because it makes building with data for almost any class of application easy and fast for them. They select Amazon Web Services (AWS) because it offers a comprehensive and broadly adopted cloud platform, offering more than 200 fully featured services. Bringing together MongoDB Atlas on AWS helps developers build and ship higher quality applications faster and scale them further. MongoDB has collaborated with AWS for close to a decade now, but 2022 has seen dramatic growth in both the quantity and quality of our joint activities, resulting in a strategic collaboration agreement announced earlier this year. Our collaboration spans joint product engineering and integration so MongoDB Atlas is a first-party service on AWS, and also extends to making it easy for customers to procure MongoDB Atlas on AWS. In 2022, we have worked more closely together than ever before. In this post, we'll cover what we've achieved, and how our customers benefit. If at any point you want to stop reading about the partnership and experience it in action, we invite you to get started for free with MongoDB's fully managed, pay-as-you-go listing on the AWS Marketplace . Delivering an outstanding customer experience Since re:Invent 2021, MongoDB and AWS have jointly seen an explosion in customer success, with MongoDB for Startups becoming one of the most widely used offerings in the AWS Activate program after we launched in July. And, since launching in the AWS Marketplace with pay-as-you-go pricing in December 2021, MongoDB Atlas has become one of the most popular self-service listings, with well over 1,000 customers. More broadly, we've seen our AWS Marketplace business show triple-digit growth through significant, mutual investments across engineering, sales, and marketing. We've also found great success working with AWS' Workload Migration and Proof of Concept programs, helping many new customers accelerate their migration to MongoDB Atlas on AWS over the past 12 months. Additionally, while MongoDB works closely with AWS across the globe, we devoted increased attention to Europe this past year, resulting in a considerable increase in customer adoption. As a result, AWS named us their AWS Marketplace Partner of the Year - EMEA in November 2022. One way that we've helped to accelerate such customer success is by making it easier to procure MongoDB Atlas on AWS. Over the past year, MongoDB and AWS have significantly simplified the purchasing experience for customers. We did this across a few key areas. One thing customers love about buying through AWS Marketplace is how seamless it makes the purchasing experience. However, historically this has been slowed somewhat for MongoDB customers by the need to agree to separate legal terms. Starting in November 2022, however, all Atlas on AWS customers purchasing through the AWS Marketplace Self Service listing use AWS Marketplace’s Standard Contract for Marketplace (SCMP) terms and conditions rather than MongoDB Cloud Terms of Service, thereby further reducing friction to getting productive, faster, with MongoDB. Close product collaboration Behind these improvements to our joint purchasing experience were significant improvements to how MongoDB Atlas integrates with key AWS services. MongoDB has long worked seamlessly with core AWS services such as Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Simple Storage Service (Amazon S3), and more recently has collaborated with AWS to ensure tight integration with AWS container services like Amazon Elastic Kubernetes Service (Amazon EKS) and Amazon Elastic Container Service (Amazon ECS), AWS serverless technologies like AWS Lambda, Amazon Eventbridge, and AWS Fargate; and edge computing services like AWS Wavelength . Over the past year, however, we've delved more deeply into AWS machine learning services (Amazon Comprehend, Amazon Kendra, Amazon Lex, etc.), AWS AppSync, Amazon Forecast, AWS Elastic Beanstalk, and more. In addition to direct integrations with AWS services, we made it simpler for customers to use MongoDB with important joint partners such as Datadog, Databricks, and Confluent. For Datadog, we improved MongoDB Atlas App Service to support forwarding logs on AWS to Datadog, thereby improving observability through real-time log analytics. With Databricks, we announced MongoDB as a data source within a Databricks notebook, thereby offering data practitioners an easier, more curated experience for connecting Databricks to MongoDB Atlas data. And with Confluent, we strengthened our integrations to help developers easily build robust, reactive data pipelines that stream events between applications and services in real time. Through innovations to the purchasing process and the product experience, we've helped make thousands of customers successful running MongoDB on AWS. Some joint customers, like Unqork , are upending entire industries with innovative approaches to technology and business. Others, like Volvo's Connected Solutions business , rely on MongoDB and AWS to scale their fleet management solution from tens of millions to billions of daily events. Other recent customers include Verizon , Marsello , GLS , and Shopline . Get started with MongoDB Atlas on AWS You needn't take our word for it, however. With just a few clicks — and no risk — you can get started for free with MongoDB Atlas on AWS . There's no upfront commitment, and if you choose to continue to build with MongoDB on AWS, you only pay for what you use.