Home Database Mysql Tutorial MongoDB2.6 新特性

MongoDB2.6 新特性

Jun 07, 2016 pm 03:19 PM
mongodb new features characteristic

MongoDB 2.6 已经在今天发布,当然,关注MongoDB的同志自然知道这个消息。 整个MongoDB2.6,个人觉得认证系统是一个重新设计的系统。当然,MongoDB 2.4.6开始,就已经在尝试新的基于Role的认证方式了,但是真正的成熟还是在2.6.0这个版本。 什么是基于角色Ro

MongoDB 2.6 已经在今天发布,当然,关注MongoDB的同志自然知道这个消息。

整个MongoDB2.6,个人觉得认证系统是一个重新设计的系统。当然,MongoDB 2.4.6开始,就已经在尝试新的基于Role的认证方式了,但是真正的成熟还是在2.6.0这个版本。

什么是基于角色Role的认证系统?

在以往的MongoDB中,官方一直推荐MongoDB应该在一个Trust的环境下运行,对于认证和安全性上的考虑是不充分的。

(MongoDB的安全性和读写的完整性以前一直被人诟病,WriteConcern解决了写数据的安全性,这次的RoleBase的认证机制,在一定程度上提高了MongoDB的安全性)

现在在MongoDB中创建的User,除了有用户名,密码等传统属性之外,还有一个Role的概念。

每个Role的操作权限是不同的,而且,根据细化的配置,可以将每个Role的权限定义的非常详细,

Role可以查询,修改某个数据库,某个数据表,都可以做到小粒度的定义。

每个用户可以同时拥有多个Role,这样的话,管理员可以对于各个用户的权限做到非常精确的控制了。

MongoDB的 具体实现 Role:

每个Role可以有多个Privilege,每个Privilege指定了可以访问的资源(可以指定数据集,数据库,精确到具体的某个数据集)

对于资源的可以执行的操作(Action),例如 数据集的查找 或者 更新。对于各种的操作已经做到非常小的粒度的细化了。

例如 添加用户 和 删除用户 已经是两个操作了(Action),而不是通常理解的,增删改是同样的操作。

(当然,可能也有人认为如此细化对于管理者来说也是一种负担。不过一个Role一旦精心设计之后,就可以分配给不同用户,一劳永逸了)

 

TextSearch全文检索

这个功能在 2.4.6里面就有的功能,这次的变化是,将这个TextSearch的放入了Aggerate里面了。

换句话说,原来的全文检索的结果是孤立的,现在可以作为聚合检索的一个部分了,文本检索的结果可以作为其他聚合操作的输入数据。

 

作为MongoDB5年里程碑的这个版本,还有其他很多对以往功能的增强。

作为一个长期观察MongoDB的人来说,我个人认为,现在是大家可以尝试MongoDB的一个时间点了。

2.6.0以前的版本的确有很多诟病,除了前面说过的读写的安全之外,还有很多设计上的问题。

经过2.4的很多演化后,很多东西都定型了:

主从(Master-Slaver)模型 被 Replication模型代替

加入基于Role的认证后,可以自定义角色(当然,系统也有一些内置的角色)

全文检索(很遗憾,不支持中文)的强化 具有特色的 地理聚合(很多处理地理坐标的内置函数)

TLL数据集(数据集里面的记录会慢慢自动删除掉,有点缓存的意思)Capped数据集(固定大小的数据集,在存储和读写上提高效率,牺牲灵活性)

Sharding支持了ShardKey

索引的内容丰富了不少,特别是有了text属性的索引,对于全文检索的帮助很大

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the use of net4.0 What is the use of net4.0 May 10, 2024 am 01:09 AM

.NET 4.0 is used to create a variety of applications and it provides application developers with rich features including: object-oriented programming, flexibility, powerful architecture, cloud computing integration, performance optimization, extensive libraries, security, Scalability, data access, and mobile development support.

Integration of Java functions and databases in serverless architecture Integration of Java functions and databases in serverless architecture Apr 28, 2024 am 08:57 AM

In a serverless architecture, Java functions can be integrated with the database to access and manipulate data in the database. Key steps include: creating Java functions, configuring environment variables, deploying functions, and testing functions. By following these steps, developers can build complex applications that seamlessly access data stored in databases.

How to configure MongoDB automatic expansion on Debian How to configure MongoDB automatic expansion on Debian Apr 02, 2025 am 07:36 AM

This article introduces how to configure MongoDB on Debian system to achieve automatic expansion. The main steps include setting up the MongoDB replica set and disk space monitoring. 1. MongoDB installation First, make sure that MongoDB is installed on the Debian system. Install using the following command: sudoaptupdatesudoaptinstall-ymongodb-org 2. Configuring MongoDB replica set MongoDB replica set ensures high availability and data redundancy, which is the basis for achieving automatic capacity expansion. Start MongoDB service: sudosystemctlstartmongodsudosys

How to ensure high availability of MongoDB on Debian How to ensure high availability of MongoDB on Debian Apr 02, 2025 am 07:21 AM

This article describes how to build a highly available MongoDB database on a Debian system. We will explore multiple ways to ensure data security and services continue to operate. Key strategy: ReplicaSet: ReplicaSet: Use replicasets to achieve data redundancy and automatic failover. When a master node fails, the replica set will automatically elect a new master node to ensure the continuous availability of the service. Data backup and recovery: Regularly use the mongodump command to backup the database and formulate effective recovery strategies to deal with the risk of data loss. Monitoring and Alarms: Deploy monitoring tools (such as Prometheus, Grafana) to monitor the running status of MongoDB in real time, and

Navicat's method to view MongoDB database password Navicat's method to view MongoDB database password Apr 08, 2025 pm 09:39 PM

It is impossible to view MongoDB password directly through Navicat because it is stored as hash values. How to retrieve lost passwords: 1. Reset passwords; 2. Check configuration files (may contain hash values); 3. Check codes (may hardcode passwords).

Major update of Pi Coin: Pi Bank is coming! Major update of Pi Coin: Pi Bank is coming! Mar 03, 2025 pm 06:18 PM

PiNetwork is about to launch PiBank, a revolutionary mobile banking platform! PiNetwork today released a major update on Elmahrosa (Face) PIMISRBank, referred to as PiBank, which perfectly integrates traditional banking services with PiNetwork cryptocurrency functions to realize the atomic exchange of fiat currencies and cryptocurrencies (supports the swap between fiat currencies such as the US dollar, euro, and Indonesian rupiah with cryptocurrencies such as PiCoin, USDT, and USDC). What is the charm of PiBank? Let's find out! PiBank's main functions: One-stop management of bank accounts and cryptocurrency assets. Support real-time transactions and adopt biospecies

How to sort mongodb index How to sort mongodb index Apr 12, 2025 am 08:45 AM

Sorting index is a type of MongoDB index that allows sorting documents in a collection by specific fields. Creating a sort index allows you to quickly sort query results without additional sorting operations. Advantages include quick sorting, override queries, and on-demand sorting. The syntax is db.collection.createIndex({ field: <sort order> }), where <sort order> is 1 (ascending order) or -1 (descending order). You can also create multi-field sorting indexes that sort multiple fields.

What is the CentOS MongoDB backup strategy? What is the CentOS MongoDB backup strategy? Apr 14, 2025 pm 04:51 PM

Detailed explanation of MongoDB efficient backup strategy under CentOS system This article will introduce in detail the various strategies for implementing MongoDB backup on CentOS system to ensure data security and business continuity. We will cover manual backups, timed backups, automated script backups, and backup methods in Docker container environments, and provide best practices for backup file management. Manual backup: Use the mongodump command to perform manual full backup, for example: mongodump-hlocalhost:27017-u username-p password-d database name-o/backup directory This command will export the data and metadata of the specified database to the specified backup directory.

See all articles