Better explanation about mongoDB in RayaFeeL
MongoDB’s latest major release, v5.0, was launched 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 data. While some developers have already built their own time series tooling around MongoDB, having time series data types natively available will help many more to get started.
A “time series” 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.
New time series collections provide a special data store that’s 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 set the granularity of time data to seconds, minutes, or hours. It’s also possible to automatically expire data after a set number of seconds.
db.createCollection( "measurements", { timeseries: { timeField: "timestamp", granularity: "minutes" }, expireAfterSeconds: 3600 } );
The snippet above defines a time series collection called measurements
. Its granularity is set to minutes. Documents in the collection will be automatically deleted after an hour.
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.
db.measurements.aggregate([ { $project: { date: { $dateToParts: {date: "$timestamp"} } }, $group: { _id: { time: { hour: "$date.hour", minute: "$date.minute" } }, averageMeasurement: {$avg: "measurement"} } } ]);
Live Re-sharing:
One of the biggest challenges with horizontally scaling MongoDB has been its approach to sharing. Choosing the correct shard key is critical to your cluster’s performance but was previously a one-way operation. Once you’d set the key, you couldn’t change it, leaving you powerless if you made the wrong decision on day one. MongoDB itself described shard key selection as a “one-way parachute jump” best resolved by creating a whole new cluster.
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.
Versioning and Releases
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.
Accompanying this change is a new release schedule. MongoDB will start shipping future versions more quickly, with a “Rapid Release” 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.
The new release model lets you access emerging features more quickly without impacting MongoDB’s overall stability. If you don’t 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’s managed Atlas service. They’ll be available for self-hosted users as optional development builds.
Server less MongoDB
MongoDB has also launched a preview of its new server less Atlas instances. Atlas is the company’s official database-as-a-service offering for popular cloud platforms.
With server less deployment, you’ll get automatic provisioning of the correct resources for your current workload. The platform automatically adapts to changing demands, so you don’t need to manually scale your infrastructure. You’ll only be billed for what you use.
Server less Rayafeel is managed by MongoDB. It uses the latest database release version with support for automatic upgrades. Creating serve rless 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.
Summary
MongoDB 5.0 extends the database with more capabilities that enhance its versatility. It also cements its position as a cloud-native platform that’s available in a range of managed solutions, now including server less options.
Want to know about Domain Name and Web Hosting?
We even have Facebook, Instagram and Linked in! Comment or like if your more of the social media type 😉