Home Database Mysql Tutorial MongoDB(一)简单介绍

MongoDB(一)简单介绍

Jun 07, 2016 pm 04:10 PM
mongodb one time introduce study Simple

这两天简单学习了一下MongoDB数据库,属于NoSQL类型数据库的一种,先简单宏观的看一下NoSQL的相关知识和MongoDB的基础知识。 NoSQL是Not Only SQL的缩写,它指的是非关系型数据库,即有别于Oracle,mysql,sqlserver等常用的关系型数据库。它是以key-value形式

这两天简单学习了一下MongoDB数据库,属于NoSQL类型数据库的一种,先简单宏观的看一下NoSQL的相关知识和MongoDB的基础知识。

NoSQL是Not Only SQL的缩写,它指的是非关系型数据库,即有别于Oracle,mysql,sqlserver等常用的关系型数据库。它是以key-value形式存在,即我们熟悉的JSON数据形式。

发展:NoSQL是随着互联网Web2.0网站的兴起,传统的关系数据库在应付web2.0网站,特别是超大规模数据量和高并发的SNS类型的web2.0纯动态网站已经显得力不从心,暴露了很多难以克服的问题,而NoSQL也就是为了应付这些问题而出现,并不断发展着。最开始是google公司的Bigtable,淘宝数据平台的Tair,视觉中国网站的MongoDB等都代表NoSQL的不断发展。

NoSQL发展迅速的原因:随着互联网的不断发展,各种类型的应用层出不穷,所以导致在这个云计算的时代,对技术提出了更多的需求。虽然关系型数据库已经在业界的数据存储方面占据不可动摇的地位,但是由于其天生的几个限制,使其难以满足以上的几个需求:扩展困难,读写慢,成本高,有限的支撑容量。但是NoSQL关注的对数据高并发读写和对海量数据的存储等,与关系型数据库相比,它们在架构和数据模型方面做了削弱,而在扩展和并发等方面做了增强突出。

特点:非关系型的,分布式的,开源的,水平可扩展的。

优点:扩展简单,读写更加快速,成本更加低廉,灵活的数据模型。

不足:不提供的对SQL的支持,支持的特性不够丰富,现在的产品相比关系型数据库不够成熟。

总而言之NoSQL的出现是紧随时代的步伐——大数据,云计算而诞生,并不断发展的,是处在一个成长中的。下边简单看一下它的比较成熟的一个产品MongoDB的简单介绍。

MongoDB 的名称取自“humongous” (巨大的) 的中间部分,足见mongodb 的宗旨在处理大量数据上面。是一个可扩展、高性能的下一代数据库,由 C++语言编写,旨在为web 应用提供可扩展的高性能数据存储解决方案。


Mongo DB很好的实现了面向对象的思想(OO思想),在Mongo DB中每一条记录都是一个Document对象。MongoDB最大的优势在于所有的数据持久操作都无需开发人员手动编写SQL语句,直接调用方法就可以轻松的实现CRUD操作。

好,看一下它有什么特性,根据这些特性我们可以选择什么时候用它:高性能、易部署、易使用,存储数据非常方便是它的主要特点:

2模式自由,支持动态查询、完全索引,可轻易查询文档中内嵌的对象及数组

2面向文档存储,易存储对象类型的数据, 包括文档内嵌对象及数组

2高效的数据存储,支持二进制数据及大型对象(如照片和视频)

2支持复制和故障恢复;提供了主-从、主-主模式的数据复制及服务器之间的数据复制

2自动分片以支持云级别的伸缩性,支持水平的数据库集群,可动态添加额外的服务器

适用场景:

2适合作为信息基础设施的持久化缓存层

2适合实时的插入,更新与查询,并具备应用程序实时数据存储所需的复制及高度伸缩性

2Mongo 的 BSON 数据格式非常适合文档化格式的存储及查询

2适合由数十或数百台服务器组成的数据库。因为 Mongo 已经包含了对 MapReduce 引擎的内置支持

不适用场景:

2要求高度事务性的系统

2传统的商业智能应用

2 复杂的跨文档(表)级联查询

综上,我们对NoSQL,MongoDB有了个宏观的理解,知道NoSQL出现并不断发展状态的原因,MongoDB的使用范围,长处短处等,这对于我们对此款软件的认识非常重要,关系到我们技术选择的一关。就是认识人一样,我们是从整体容貌开始,然后随着不断的深入,在观察他们细节外貌,行为方式,生活习惯等等,学习一门技术也是这样,先了解他了,然后在开始一点点的学习技术,并随着使用次数的增多,不断的加深理解,不断的升华。

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Which version is generally used for mongodb? Which version is generally used for mongodb? Apr 07, 2024 pm 05:48 PM

It is recommended to use the latest version of MongoDB (currently 5.0) as it provides the latest features and improvements. When selecting a version, you need to consider functional requirements, compatibility, stability, and community support. For example, the latest version has features such as transactions and aggregation pipeline optimization. Make sure the version is compatible with the application. For production environments, choose the long-term support version. The latest version has more active community support.

The difference between nodejs and vuejs The difference between nodejs and vuejs Apr 21, 2024 am 04:17 AM

Node.js is a server-side JavaScript runtime, while Vue.js is a client-side JavaScript framework for creating interactive user interfaces. Node.js is used for server-side development, such as back-end service API development and data processing, while Vue.js is used for client-side development, such as single-page applications and responsive user interfaces.

Where is the database created by mongodb? Where is the database created by mongodb? Apr 07, 2024 pm 05:39 PM

The data of the MongoDB database is stored in the specified data directory, which can be located in the local file system, network file system or cloud storage. The specific location is as follows: Local file system: The default path is Linux/macOS:/data/db, Windows: C:\data\db. Network file system: The path depends on the file system. Cloud Storage: The path is determined by the cloud storage provider.

What are the advantages of mongodb database What are the advantages of mongodb database Apr 07, 2024 pm 05:21 PM

The MongoDB database is known for its flexibility, scalability, and high performance. Its advantages include: a document data model that allows data to be stored in a flexible and unstructured way. Horizontal scalability to multiple servers via sharding. Query flexibility, supporting complex queries and aggregation operations. Data replication and fault tolerance ensure data redundancy and high availability. JSON support for easy integration with front-end applications. High performance for fast response even when processing large amounts of data. Open source, customizable and free to use.

What does mongodb mean? What does mongodb mean? Apr 07, 2024 pm 05:57 PM

MongoDB is a document-oriented, distributed database system used to store and manage large amounts of structured and unstructured data. Its core concepts include document storage and distribution, and its main features include dynamic schema, indexing, aggregation, map-reduce and replication. It is widely used in content management systems, e-commerce platforms, social media websites, IoT applications, and mobile application development.

Introduction to the skills and attributes of Hua Yishan Heart of the Moon Lu Shu Introduction to the skills and attributes of Hua Yishan Heart of the Moon Lu Shu Mar 23, 2024 pm 05:30 PM

In Hua Yishan Heart Moon, Lu Shu is an SSR celebrity. He is positioned as a single-target backline player and has a very impressive critical hit rate. Many players don’t know much about Lu Shu. Here’s what I’ve brought you. Come and take a look at the introduction to the skills and attributes of Hua Yishan Heart of the Moon Lu Shu. Celebrity Attributes Celebrity Skills 1. Lu Ming Shuzhong Skill Description: Lu Shu was born in Qiongqihui in Shuzhong. He has practiced martial arts since he was a child and has outstanding martial arts skills. Causes basic attack damage equal to 100% of the enemy's back row attack power, and reduces the target's rage by 10 points. Skill attributes: Level 2: Basic attack damage increased to 105%. Level 2: Basic attack damage is increased to 110%, and the target's rage is reduced by 15 points. Level 2: Basic attack damage increased to 115%. Level 2: Basic attack damage is increased to 120%, and the target's rage is reduced by 20 points. Level 2: Basic attack

How to open mongodb How to open mongodb Apr 07, 2024 pm 06:15 PM

On Linux/macOS: Create the data directory and start the "mongod" service. On Windows: Create the data directory and start the MongoDB service from Service Manager. In Docker: Run the "docker run" command. On other platforms: Please consult the MongoDB documentation. Verification method: Run the "mongo" command to connect and view the server version.

Where are the mongodb database files? Where are the mongodb database files? Apr 07, 2024 pm 05:42 PM

The MongoDB database file is located in the MongoDB data directory, which is /data/db by default, which contains .bson (document data), ns (collection information), journal (write operation records), wiredTiger (data when using the WiredTiger storage engine ) and config (database configuration information) and other files.

See all articles