当前位置:网站首页>Overview of new features in mongodb5.0
Overview of new features in mongodb5.0
2022-06-24 06:33:00 【phoenix、】
The overview
MongoDB It's gone by now 12 A year . Just released today 5.0 edition . Let's take a look at what new features and functions have been released in the new version ~ The official choice is from 4.4 Jump straight to 5.0 It may also be to express that the version changes a lot ( Adjusted the release rhythm ) The meaning of .
From the bold features in the figure above , The main functions include :
Time-Series collectionsNative timeline supportClustered indexesCluster indexWindow functionsWindow functionNew temporal operatorsNew time-dependent operatorsLive reshardingReal time redistributionMulti-cloudA hybrid cloud
Show more at the press conference , Let's look at the details .
server List of new features
Native Time Series
Local time series , Essentially, Expansion and enhancement MongoDB Ability in temporal data processing .( Maybe it's because I found that many customers put their original existence MongoDB Data migration to ElasticSearch To do time series data analysis, so I want to focus on strengthening the ability of this piece .)
What is a time series set ? Essentially ,MongoDB5.0 A new collection type is introduced ( Think about it , Before a capped collection, Common set , System collections and views based on common collections ), And this set of targeted support and optimization .
What data is suitable for ? Everything related to timing is OK , For example, financial transactions , Various intelligent terminals / Monitoring data of the sensor . The official example is weather data from all over the United States ( temperature 、 Humidity, etc ).
Creating a time series set will create a normal set and an automatically created corresponding writable non materialized view in the background ( non-materialized view ), This view acts as an abstraction layer . This abstraction layer allows the user to always process the data as the original single document , Therefore, users no longer need to know how the time series data is stored and persisted , Just focus on how the business layer should use or analyze these time series data .
How to use ?
The usage is as simple as ever , It's basically no different from using normal sets . It just needs to be added to a specific field timeseries Key words can be used .
Create a file called weather Time series set of :
db.createCollection("weather", {
timeseries: {
timeField: "ts",
metaField: "source",
granularity: "minutes"
},
expireAfterSeconds: 9000
}); among :
timeFieldFields are time series fields , The type must be MongoDB Supported time types, such asISODate("2021-05-20T10:24:51.303Z").metaFieldFor metadata fields , Can be used to create secondary indexes , For example, mark the source of time series data .MongoDB Will automatically have the same... For a period of time metaField The measurements of are aggregated and done , To eliminate duplication of this field in the storage tier .granularityIs a granularity field , Update frequency of real-time sequence data , The default is seconds (seconds).expireAfterSecondsOverdue fields , Not a new field . Time series data with TTL Indexes , So that time series data can be eliminated automatically .
If the time table is created with
expireAfterSeconds, There is no need to create TTL Index . After that, you need to usecollModcommand . In the future, we can cooperate Atlas Online archiving (Online Archive) Function to use .
As an early version , There are some more in the timeline Limit , such as :
- append only, Update not supported / Delete
- I won't support it Change Streams,Realm Sync or Atlas Search
- Only in metaField Create a secondary index on
- wait
Versioned API
Mainly to solve the problem of version update .
Many online businesses want to use the new features of the new version , But for various reasons , Generally, they don't dare to upgrade online databases . Database upgrade is also a big challenge for O & M colleagues . Code changes involved in the process , Driver upgrade , Comprehensive compatibility testing and so on have brought a lot of workload .Versioned API Can play a role in such a scenario , That is to say, the database has been upgraded to a newer version , But the stock business will still use the old version API To visit . There will be no incompatibilities . let me put it another way , This function Completely decouple the application lifecycle from database updates .
Live Resharding
Try to completely solve the problem of unreasonable initial database modeling .
stay 4.4 Previous versions ,shard key Once defined, it cannot be changed . Many businesses have been running for a long time , After accumulating a lot of data, I found my own shard key unreasonable , It is difficult to change . There are generally only two ways :1) Remove from service (dump&load);2) Online migration (live migration). The former requires long downtime for maintenance , The latter takes a long time and requires the business to handle all kinds of complex logic by itself (DDL, Orphan documents , Data consistency and so on ), Are not optimal solutions .
We see in the 4.4 The version is officially launched refinable shard keys. But only through shard key To adjust the data distribution by adding suffixes to the . As its name shows , This is just refine, It can't be completely solved shard key Unreasonable questions .
Live Resharding It can be understood that the official himself is MongoDB Internally implemented live migration And deal with various complex situations and consistency problems , For those initial shard key Businesses that are unreasonable but have a huge amount of data are very friendly .
It's also easy to use , It's just a mongos Performed on command nothing more :
db.adminCommand({
reshardCollection: "<database>.<collection>",
key: <shardkey>
})Of course , This feature also has some limitations , Just a few , Please refer to the official documents for details :
- At the same time, there can only be one partition table in resharding
- Tables with unique restrictions are not supported
- resharding During this period, you cannot do some operations , For example, cluster level
addShardAnd table levelcreateIndexes/renameCollectionetc.
Atlas to update
MongoDB Ops Manager 5.0
- Support MongoDB 5.0 Automation of deployment 、 Monitoring and backup / recovery .
- Improve load performance by parallelizing client restore .
- Use Ops Manager stay Kubernetes Deployment in China MongoDB Quick Start experience for .
- Guide the user to complete Atlas Migration experience , Guide the user to configure the migration host , Push data from their existing environment to a fully managed Atlas The cloud service .
Online Archive
Online archiving , The purpose is to solve Data cooling The needs of .
- Effectively reduce data storage costs ;
- Automated data tiering , No need to manually migrate or delete valuable data ;
- Searchable archive data , Support joint query of business data and archived data ;
Serverless Model (preview)
be based on serverless Server free instance of the concept , It hasn't been officially launched yet Atlas platform . There may be two main products : elastic database model & serverless model .
And others serverless Products ( such as Lambda 、 DynamoDB 、 cloud function ) similar , Support the following capabilities :
- Easy to use , Just select the managed cloud region
- No need to worry about back-end infrastructure
- Stretch and stretch
- Pay as you go
- Auto update server edition , Make use of
Versioned APIThe ability of
You may see other cloud service providers based on MongoDB Doing something similar , The authorities decided to do it themselves , Let's look forward to .
Atlas Data Lake & Charts
The two capabilities are integrated . Can be based on data lake Quickly create and share visual charts with data in .
Atlas Search
Bottom based lucene, Support full-text search .
Added support for function scoring , Allows you to apply mathematical formulas to document fields to calculate dependencies , Such as popularity or distance —— for example , Nearby restaurants with more or better comments will be higher in the search results list . In addition, new support Custom search synonyms collection To support more general user queries .
Realm SDK
Realm Let users on their mobile phones 、 Simple on IOT devices like tablets and raspberry pies 、 Strong local persistence . Its essence is to solve the problem of terminal data synchronization . Allow developers to interact directly with storage objects , Without thinking about ORM Or database syntax . Released earlier this year Realm Sync, Support terminal devices and atlas Synchronize data between database backend .
The new function is :
- Support Unity , It can be seen that MongoDB Further moves in the game industry :smile:
- In the future, cross platform frameworks will be supported ——Kotlin & Flutter
- A way to more finely control synchronized data ——Realm Flexible Sync ( Unpublished )
new MongoDB Shell(mongosh)
new mongo shell, Syntax highlighting has been introduced 、 Intelligent automatic completion 、 Context help and helpful error messages , It can be for MongoDB Users create a more intuitive interactive experience .
- And 4.0 The above MongoDB Cluster compatible , You don't need to put your own mongoDB Cluster upgrade to 5.0 You can experience .
- More useful error help information ( Sometimes complex commands are crazy without a brace ..)
- Better interaction shell Prompt information
- Even you can be like mysql See the same table Visualized library table schema( It's really not NoSql Ha ha ha )
other
- Faster release frequency ( Change from year to quarter )
releases in the future.png - Support
window function; - New time-dependent operators , such as
$dateAdd,$dateDiff,$dateSubtract, It is also to better support the processing of time series data - Read the following snapshot (
read concern "snapshot"), And you can set the retention time dbstatsandserverStatusCommand output update , Will show more systems / Library table related information- For more changes, please refer to release notes
summary
Represent personal opinion only , Welcome to exchange ~
- The trend of database convergence ( Whether it's OLAP and OLTP, still SQL And NoSQL)
- The support of native time series data is 5.0 The highlight of the version , As for and ES The differences and comparisons between the two have yet to be further studied after experience
- Atlas More and more powerful ,MongoDB Expect to bind users through these capabilities .
Reference link
- https://www.mongodb.com/new
- https://www.mongodb.com/blog/post/launched-today-mongodb-5-0-serverless-atlas-evolution-application-data-platform
- https://developer.mongodb.com/how-to/new-time-series-collections/
- https://www.mongodb.com/blog/post/new-mongodb-shell-ga
- https://docs.mongodb.com/v5.0/release-notes/5.0/
- https://www.mongodb.com/blog/post/announcing-mongodb-realm
- https://docs.mongodb.com/manual/core/sharding-reshard-a-collection/
边栏推荐
- "Adobe international certification" in the design industry, why can't big but big designs have good results?
- How to solve domain name redirection? How to avoid such problems?
- Continuously evolving cloud native application delivery
- What is the role of website domain name
- Enter the software test pit!!! Software testing tools commonly used by software testers software recommendations
- Domain name, resolution, SSL certificate product selection
- Event delegation
- Manual for automatic testing and learning of anti stepping pits, one for each tester
- Tencent cloud won the "best customer value award for security hosting services in China" from Sullivan toubao Research Institute
- Why the computer can't start
猜你喜欢
![[fault announcement] one stored procedure brings down the entire database](/img/7c/e5adda73a077fe4b8f04b59d1e0e1e.jpg)
[fault announcement] one stored procedure brings down the entire database

创客教育给教师发展带来的挑战

Manual for automatic testing and learning of anti stepping pits, one for each tester

Enter the software test pit!!! Software testing tools commonly used by software testers software recommendations

ServiceStack. Source code analysis of redis (connection and connection pool)

Technology is a double-edged sword, which needs to be well kept

The product layout is strengthened, the transformation of digital intelligence is accelerated, and FAW Toyota has hit 2022million annual sales
Oracle case: ohasd crash on AIX
Fault analysis | using --force to batch import data leads to partial data loss

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing
随机推荐
Source code analysis of current limiting component uber/ratelimit
解读AI机器人产业发展的顶层设计
TensorFlow 2 quickstart for beginners
The 2021 Tencent digital ecology conference landed in Wuhan, waiting for you to come to the special session of wechat with low code
WordPress applet build applet from zero to one [server configuration]
Project deployment for learning 3D visualization from scratch
Get the short video! Batch download of Kwai video (with source code)
PMP | 8 abilities that excellent project managers focus on training
Innovating the security service mode, deeply convinced that the organization has been equipped with a "continuous online expert group"
Micro build low code supports Excel to import data source
Kangaroo cloud: the overall architecture and key technical points of building a real-time computing platform based on Flink
Little transparent apprentice's way to go ashore
Technology is a double-edged sword, which needs to be well kept
From home to Ali, a year for junior students to apply for jobs
Neighbor vote: use proximity voting to optimize monocular 3D target detection (ACM mm2021)
Easyscreen live streaming component pushes RTSP streams to easydarwin for operation process sharing
What is an enterprise mailbox domain name? How to register an enterprise mailbox domain name
At the trusted cloud conference, Tencent securely unlocked a number of new certifications!
Analysis of official template of micro build low code (I)
WordPress pill applet build applet from zero to one [wordpress pagoda configure SSL pseudo static]