{"id":300813,"date":"2021-07-16T15:25:27","date_gmt":"2021-07-16T12:25:27","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/whats-new-in-mongodb-5-0-cloudsavvy-it\/"},"modified":"2021-07-16T15:25:27","modified_gmt":"2021-07-16T12:25:27","slug":"whats-new-in-mongodb-5-0-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/whats-new-in-mongodb-5-0-cloudsavvy-it\/","title":{"rendered":"#What\u2019s New In MongoDB 5.0? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2c139466918\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2c139466918\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-mongodb-5-0-cloudsavvy-it\/#Time_Series_Data\" >Time Series Data<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-mongodb-5-0-cloudsavvy-it\/#Live_Resharding\" >Live Resharding<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-mongodb-5-0-cloudsavvy-it\/#Versioning_and_Releases\" >Versioning and Releases<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-mongodb-5-0-cloudsavvy-it\/#Serverless_MongoDB\" >Serverless MongoDB<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-mongodb-5-0-cloudsavvy-it\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#What\u2019s New In MongoDB 5.0? \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage aligncenter size-full wp-image-12810\" srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/f5932bc2.jpg?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/f5932bc2.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/f5932bc2.jpg?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Illustration showing the MongoDB logo\" width=\"1602\" height=\"902\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>MongoDB\u2019s latest major release, v5.0, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.mongodb.com\/blog\/post\/launched-today-mongodb-5-0-serverless-atlas-evolution-application-data-platform\">was launched<\/a> on July 13th, 2021. This iteration of the document-oriented database adds new features and improvements as well as a revised release cadence for future versions.<\/p>\n<h2 id=\"time-series-data\"><span class=\"ez-toc-section\" id=\"Time_Series_Data\"><\/span>Time Series Data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One of the headline feature additions is first-class support for time <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/watch-movies-tv-seriess\/\" data-internallinksmanager029f6b8e52c=\"8\" title=\"Watch Movies &amp; TV Series\" target=\"_blank\" rel=\"noopener\">series<\/a> data. While some developers have already <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.mongodb.com\/blog\/post\/time-series-data-and-mongodb-part-1-introduction\">built their own<\/a> time series tooling around MongoDB, having time series data types natively available will help many more to get started.<\/p>\n<p>A \u201ctime series\u201d refers to any kind of data where records are created sequentially at different points in time. Common use cases include sensor measurement streams and transaction history logs, where each record corresponds directly to a particular moment.<\/p>\n<p>New time series collections provide a special data store that\u2019s optimized for data with these characteristics. Values will be compacted into a unique schema structure when persisted to disk, providing better indexing, more efficient storage use, and reduced server load. You can <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.mongodb.com\/manual\/core\/timeseries-collections\">set the granularity<\/a> of time data to seconds, minutes, or hours. It\u2019s also possible to automatically expire data after a set number of seconds.<\/p>\n<pre>db.createCollection(&#13;\n    \"measurements\",&#13;\n    {&#13;\n        timeseries: {&#13;\n            timeField: \"timestamp\",&#13;\n            granularity: \"minutes\"&#13;\n        },&#13;\n        expireAfterSeconds: 3600&#13;\n    }&#13;\n);<\/pre>\n<p>The snippet above defines a time series collection called <code>measurements<\/code>. Its granularity is set to minutes. Documents in the collection will be automatically deleted after an hour.<\/p>\n<p>MongoDB 5.0 provides built-in support for querying and manipulating time series data too. You can extract time-based moving averages that track temporal trends with minimal code of your own.<\/p>\n<pre>db.measurements.aggregate([&#13;\n    {&#13;\n        $project: {&#13;\n            date: {&#13;\n                $dateToParts: {date: \"$timestamp\"}&#13;\n            }&#13;\n        },&#13;\n        $group: {&#13;\n            _id: {&#13;\n                time: {&#13;\n                    hour: \"$date.hour\",&#13;\n                    minute: \"$date.minute\"&#13;\n                }&#13;\n            },&#13;\n            averageMeasurement: {$avg: \"measurement\"}&#13;\n        }&#13;\n    }&#13;\n]);<\/pre>\n<p>Assuming a time series collection with <code>timestamp<\/code> and <code>measurement<\/code> fields, the above aggregate command would output something like this:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"json\">\n<pre class=\"de1\">{&#13;\n    \"_id\": {&#13;\n        \"time\": {&#13;\n            \"hour\": 12,&#13;\n            \"month\": 30&#13;\n        },&#13;\n        \"averageMeasurement\": 1.5&#13;\n    },&#13;\n    \"_id\": {&#13;\n        \"time\": {&#13;\n            \"hour\": 12,&#13;\n            \"month\": 45&#13;\n        },&#13;\n        \"averageMeasurement\": 2.7&#13;\n    }&#13;\n}<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The records are grouped by their timestamp using a projection. Each group\u2019s <code>measurement<\/code> values are then averaged into the <code>averageMeasurement<\/code> field.<\/p>\n<h2 id=\"live-resharding\"><span class=\"ez-toc-section\" id=\"Live_Resharding\"><\/span>Live Resharding<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One of the biggest challenges with horizontally scaling MongoDB has been its <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>roach to sharding. Choosing the correct shard key is critical to your cluster\u2019s performance but was previously a one-way operation. Once you\u2019d set the key, you couldn\u2019t change it, leaving you powerless if you made the wrong decision on day one. MongoDB itself described shard key selection as a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.mongodb.com\/blog\/post\/on-selecting-a-shard-key-for-mongodb\">\u201cone-way parachute jump\u201d<\/a> best resolved by creating a whole new cluster.<\/p>\n<p>MongoDB 5.0 finally puts an end to shard key nightmares. If you get it wrong, you can re-index your collections using a new shard key. MongoDB will handle the entire migration for you, without causing any database downtime. This makes it much easier to escape subpar performance caused by incorrect shard configuration.<\/p>\n<h2 id=\"versioning-and-releases\"><span class=\"ez-toc-section\" id=\"Versioning_and_Releases\"><\/span>Versioning and Releases<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>MongoDB 5.0 brings significant future-proofing enhancements. The database has gained a versioned API which lets you avoid breaking changes as you upgrade to new releases.<\/p>\n<p>You\u2019ll be able to update to future versions without modifying your app\u2019s code. Everything will work seamlessly as long as the new release supports the API version you target. It means your application is more decoupled from the underlying database version, so you can upgrade to new MongoDB versions earlier without risking broken code.<\/p>\n<p>Accompanying this change is a new <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.mongodb.com\/blog\/post\/new-quarterly-releases-starting-with-mongodb-5-0\">release schedule<\/a>. MongoDB will start shipping future versions more quickly, with a \u201cRapid Release\u201d coming out every quarter. These will be minor semantic versions with no breaking changes, providing new features in an accelerated cycle. Each year, a new major release will arrive, rolling up the Rapid Releases and potentially breaking backwards compatibility.<\/p>\n<p>The new release model lets you access emerging features more quickly without impacting MongoDB\u2019s overall stability. If you don\u2019t want to upgrade each quarter, you can stay on the major release branch and retain the annual cadence. Rapid releases will only be officially supported in MongoDB\u2019s managed Atlas service. They\u2019ll be available for self-hosted users as optional development builds.<\/p>\n<h2 id=\"serverless-mongodb\"><span class=\"ez-toc-section\" id=\"Serverless_MongoDB\"><\/span>Serverless MongoDB<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>MongoDB has also launched a preview of its new serverless Atlas instances. Atlas is the company\u2019s official database-as-a-service offering for popular cloud platforms.<\/p>\n<p>With serverless deployment, you\u2019ll get automatic provisioning of the correct resources for your current workload. The platform automatically adapts to changing demands, so you don\u2019t need to manually scale your infrastructure. You\u2019ll only be billed for what you use.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.mongodb.com\/cloud\/atlas\/serverless\">Serverless Atlas<\/a> is managed by MongoDB. It uses the latest database release version with support for automatic upgrades. Creating serverless instances lets you access new MongoDB clusters without configuring them yourself. You pick a cloud provider, create a new database, and connect from your application.<\/p>\n<h2 id=\"summary\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>MongoDB 5.0 extends the database with more capabilities that enhance its versatility. It also cements its position as a cloud-native platform that\u2019s available in a range of managed solutions, now including serverless options.<\/p>\n<p>Besides the headline changes, there\u2019s a healthy selection of ecosystem improvements and enhancements. A new <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.mongodb.com\/products\/shell\">MongoDB Shell<\/a> simplifies developer interaction with databases by offering syntax highlighting and autocomplete. <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.mongodb.com\/realm\/sdk\/dotnet\/unity\">New SDKs<\/a> also help integrate MongoDB with more programming languages and frameworks, including Unity, Flutter and Kotlin.<\/p>\n<p>On the security front, expanded support for <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.mongodb.com\/manual\/core\/security-client-side-encryption\/\">Client-Side Field Level Encryption<\/a> lets you encrypt data residing in multi-cloud databases. Certificate rotation improvements facilitate x509 swaps without downtime, reducing the impact of routine hardening procedures.<\/p>\n<p>MongoDB 5.0 is available now via Atlas, public cloud providers, and as a self-hosted <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.mongodb.com\/try\/download\/community\">open-source solution<\/a>. There\u2019s official packages for Amazon Linux, Debian, RedHat, SUSE, Ubuntu, and Windows, as well as a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hub.docker.com\/_\/mongo\">Docker image<\/a> for containerized environments.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/12809\/whats-new-in-mongodb-5-0\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#What\u2019s New In MongoDB 5.0? \u2013 CloudSavvy IT&#8221; MongoDB\u2019s latest major release, v5.0, was launched on July 13th, 2021. This iteration of the document-oriented database adds new features and improvements as well as a revised release cadence for future versions. Time Series Data One of the headline feature additions is first-class support for time series&#8230;<\/p>\n","protected":false},"author":1,"featured_media":300814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/f5932bc2.jpg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-300813","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/300813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=300813"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/300813\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/300814"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=300813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=300813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=300813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}