Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to MongoDB (1)-- Overview of Database

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Overview of Database

1.1. Introduction

What is the above picture?

Answer: garage

What's the garage for?

Answer: parking the car, in other words: storing the car.

What is the database used for?

Answer: store data.

Thinking 1: the teacher asked you to summarize the number of people who were late this week. How do you record it?

The amount of data is relatively small, so an excel table is used to store the list of latecomers.

Thinking 2: how to store Sichuan college entrance examination scores in 2017?

With a large amount of data, it is obvious that excel can not be satisfied, so it needs to be stored in the database.

Not only that, many enterprises have their own data to manage and need to use databases.

1.2. What is a database?

Database (Database) is a warehouse that organizes, stores and manages data according to data structure. It came into being more than 60 years ago. With the development of information technology and market, especially after the 1990s, database technology has been developed more rapidly and applied more widely. It is mainly used to manage the data of various systems as an important technical means of scientific research and decision-making.

What are the common databases:

The following picture shows the ranking of the database in 2015.

Relational database [what is a relational database?

Relational databases store data in rows and columns for users to understand. This series of rows and columns are called tables, and a set of tables make up the database. There is a relationship between the table and the data record between the table.

]: Access mySql SqlServer oracle db2 et al.

Non-relational database: MongoDB,Redis,HBase,CouchDB and so on.

In the name of document data, the word "document" is easy to misunderstand. In fact, this document is bson. Bson is a superset of json, for example, binary types cannot be stored in json, while bson extends types to provide binary support. Each record stored in mongodb can be represented by bson. So you can also think of mongodb as a database for storing bson data.

Database is a discipline, the person who specializes in database operation and maintenance is called Database Administrator, referred to as DBA, and some DBA refers to the in-depth study of a database.

Thinking: in the course of these two days of learning, for our web front-end discipline students, how do we learn it, to what extent?

What we ask of you:

 understands the history of database development. (for interview)

 installs MongoDB and configures environment variables.

 learns common commands.

 learns to CRUD MongoDB in a back-end language.

Introduction to 1.3.NoSQL

NoSQL refers to a non-relational database. NoSQL, sometimes referred to as the abbreviation of Not Only SQL, is a general term for database management systems that are different from traditional relational databases.

NoSQL is used to store very large-scale data. Google or Facebook, for example, collect terabytes of data for their users every day. These types of data stores do not require fixed schemas and can be scaled out without redundant operations.

Introduction to 1.4.MongoDB

MongoDB is based on distributed [not physically together, is separate. For example, a web page with html tags loaded with css styles, pictures, and videos. Among these resources, html,js,css may be on server A, pictures may be on server B, and video may be on server c.

] the database stored in the file. Written in C++ language. Designed to provide scalable high-performance data storage solutions for WEB applications.

MongoDB is the most functional non-relational database, most like a relational database.

With the continuous development of big data, non-relational database has become more and more important, and related products have developed rapidly. Among them, MongoDB is a leader. As a high-performance open source document database, MongoDB is famous for its agility, extensibility and friendly to enterprise applications. Because of its simple operation, completely free and open source code, MongoDB is favored by IT employees and is widely deployed in the actual production environment.

Companies that use MongoDB include: BAT, 360, Foursquare, Craiglist, Disney, SAP, Intuit, EA and so on.

Many large companies are using it, and more and more companies are using it. We may come into contact with related projects in the future. Although the database is done by back-end personnel, as a senior front-end, it is necessary to understand it. Only in this way can we better cooperate with back-end developers to know each other and know each other.

Advantages of 1.5.MongoDB

It is characterized by high performance, easy to deploy, easy to use, and it is very convenient to store data. The main functional features are:

is oriented to collective storage and is easy to store data of object type.

mode is free.

supports dynamic queries.

supports full indexing, including internal objects.

supports queries.

supports replication and failure recovery.

uses efficient binary data storage, including large objects such as video.

automatically handles fragments to support scalability at the cloud computing level

supports multiple languages such as RUBY,PYTHON,JAVA,C++,PHP.

files are stored in BSON (an extension of JSON)

1.6.BSON

BSON is a binary storage format similar to json, referred to as Binary JSON. Like JSON, it supports embedded document objects and array objects, but BSON has some data types that JSON does not have, such as Date and BinData types.

BSON can be used as a storage form of network data exchange, which is a bit similar to Google's Protocol Buffer, but BSON is a storage form of schema-less, its advantage is high flexibility, but its disadvantage is that the space utilization is not very ideal.

BSON has three characteristics: lightweight, ergodicity and efficiency.

Later, you will see that all the data in our database is in bson format.

1.7. The difference between non-relational database and relational database

Advantages of non-relational databases:

Performance

NOSQL is based on key-value pairs, which can be thought of as the correspondence between primary keys and values in the table, and does not need to be parsed by the SQL layer, so the performance is very high.

Expandability

It is also because there is no coupling between the data based on key-value pairs, so it is very easy to scale horizontally.

Advantages of relational databases:

Complex query

You can use SQL statements to easily do very complex data queries between multiple tables.

Transaction support

So that the data access requirements with high security performance can be realized.

Summary:

The  database function is used to store data.

 database is divided into relational database and non-relational database (nosql).

 relational databases are made up of tables and relationships between tables, nosql is made up of collections, and there are a lot of documents under the collection.

 non-relational database files are stored in BSON (an extension of JSON).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report