MongoDB套路

现代应用的的数据库面临的挑战

  • 应用的存储容量的增长超过了RDBMS所提供的能力
  • 应用需要未知级别的扩展能力
  • 应用需要7*24的高可用
  • 数据需要全局分布式
  • 用户需要在任何位置进行读写数据
  • 用户总是寻求减少软件和硬件成本 

所有这些挑战导致了Nosql的诞生,具有以下主要优势

• Availability.
• Fault tolerance.
• Scalability.

关键特性

• They do not use SQL as a query language.
• Most NoSQL databases are designed to run on clusters.
• They operate without a schema, freely adding fields to
the database without having to define any changes in
structure first.
• They are polygot persistent, meaning there are different
ways to store the data based on the requirements.
• They are designed in such a way that they can be
scaled out.

 MongoDB的特点:

一个记录就是一个文档,是一组键值的集合。

使用文档带来的好处

1在许多编程语言中,一个文档可以对应原生的数据类型

2嵌入式文档有助于减少昂贵的联接

使用BSON

文档数据库使用Json 格式来存储数据,MongoDB使用二进制格式来表示JSON。

MongoDB提供了丰富的查询语言来处理CRUD、聚合、文本搜索。

 

猜你喜欢

转载自www.cnblogs.com/PerfectBeauty/p/13176137.html