Nghiên cứu về MongoDB và ứng dụng của NoSQL trong hệ thống cơ sở dữ liệu

Khóa luận phân tích hiệu suất truy vấn trên cơ sở dữ liệu NoSQL, so sánh với hệ thống thông tin truyền thống, mang lại cái nhìn sâu sắc.

Chuyên ngành

Information Systems

Người đăng

Ẩn danh

Thể loại

Thesis

2021

79
3
0

Phí lưu trữ

30 Point

Mục lục chi tiết

Introduction

Acknowledgment

1. CHAPTER 1: INTRODUCTION

1.1. The science and novelty of the topic

1.2. Reasons for choosing topics

1.3. Research objectives

1.4. Subject of study

1.5. Scope of the study

1.6. Method of implementation

1.7. Expected results achieved

1.8. Expect the structure of the thesis

2. CHAPTER 2: OVERVIEW OF NOSQL DATABASES

2.1. NoSQL

2.2. History

2.3. NoSQL storage architecture

2.3.1. Outline

2.3.2. Some characteristics

2.3.3. Archiving architecture

2.3.4. Non-Schema

2.4. CAP theory

3. CHAPTER 3: MONGODB ADMINISTRATION SYSTEM

3.1. Database and Collection. Fields and data types

3.2. Development history of MongoDB. Characteristics of MongoDB

3.3. Design the data model

3.3.1. Embedded data model

3.3.2. Reference data model

3.3.3. Model of relationships between document

3.3.4. Compare index types

3.3.5. Index properties

3.4. The replica-set structure

3.4.1. Fragmentation in MongoDB

3.4.2. Balanced data distribution

3.4.3. Configuration steps

4. CHAPTER 4: COMPARISON OF TWO DBMS MANAGEMENT SYSTEMS MONGODB AND SQL SERVER

4.1. Main differences

4.2. Syntax differences

5. CHAPTER 5: CONCLUSION

5.1. Some results achieved

5.2. In terms of comparative experiment

Tóm tắt

I. Tổng quan về MongoDB Giải pháp NoSQL hiệu suất cao

MongoDB là một trong những hệ thống cơ sở dữ liệu NoSQL phổ biến nhất hiện nay. Với khả năng mở rộng và tính linh hoạt cao, MongoDB đáp ứng tốt nhu cầu lưu trữ và xử lý dữ liệu lớn. Hệ thống này cho phép người dùng lưu trữ dữ liệu dưới dạng tài liệu JSON, giúp dễ dàng quản lý và truy vấn. Đặc biệt, MongoDB hỗ trợ các ứng dụng yêu cầu hiệu suất cao và khả năng mở rộng linh hoạt.

1.1. Đặc điểm nổi bật của MongoDB trong hệ thống NoSQL

MongoDB cung cấp một mô hình dữ liệu linh hoạt, cho phép người dùng dễ dàng thêm hoặc thay đổi cấu trúc dữ liệu mà không cần phải định nghĩa trước. Điều này giúp giảm thiểu thời gian phát triển và tăng cường khả năng thích ứng với các yêu cầu thay đổi của ứng dụng.

1.2. Lợi ích của việc sử dụng MongoDB cho doanh nghiệp

Việc áp dụng MongoDB giúp doanh nghiệp tiết kiệm chi phí lưu trữ và tăng cường hiệu suất xử lý dữ liệu. Hệ thống này cho phép mở rộng dễ dàng, giúp doanh nghiệp có thể đáp ứng nhanh chóng với sự gia tăng khối lượng dữ liệu.

II. Thách thức trong việc quản lý cơ sở dữ liệu truyền thống

Các hệ thống cơ sở dữ liệu quan hệ (RDBMS) thường gặp khó khăn trong việc xử lý khối lượng dữ liệu lớn và không cấu trúc. Những hạn chế này dẫn đến hiệu suất kém và khó khăn trong việc mở rộng. Đặc biệt, khi số lượng người dùng tăng lên, RDBMS có thể trở nên quá tải và không đáp ứng được nhu cầu.

2.1. Vấn đề về hiệu suất trong RDBMS

RDBMS thường gặp khó khăn trong việc xử lý các truy vấn phức tạp và khối lượng dữ liệu lớn. Điều này dẫn đến thời gian phản hồi chậm và khả năng mở rộng hạn chế.

2.2. Khó khăn trong việc phân phối dữ liệu

Với các hệ thống RDBMS, việc phân phối dữ liệu giữa các máy chủ là một thách thức lớn. Điều này có thể dẫn đến mất mát dữ liệu và khó khăn trong việc duy trì tính toàn vẹn của dữ liệu.

III. Giải pháp NoSQL Tại sao chọn MongoDB

MongoDB nổi bật như một giải pháp NoSQL hiệu quả cho các ứng dụng yêu cầu hiệu suất cao và khả năng mở rộng. Với kiến trúc phân tán, MongoDB cho phép xử lý đồng thời nhiều truy vấn mà không làm giảm hiệu suất. Hệ thống này cũng hỗ trợ tính năng sao lưu và phục hồi dữ liệu hiệu quả.

3.1. Kiến trúc phân tán của MongoDB

MongoDB sử dụng kiến trúc phân tán, cho phép lưu trữ dữ liệu trên nhiều máy chủ khác nhau. Điều này giúp tăng cường khả năng chịu lỗi và đảm bảo tính sẵn sàng của dữ liệu.

3.2. Tính năng mở rộng của MongoDB

MongoDB cho phép mở rộng theo chiều ngang, nghĩa là có thể thêm nhiều máy chủ mới vào hệ thống mà không làm gián đoạn dịch vụ. Điều này giúp doanh nghiệp dễ dàng mở rộng quy mô khi cần thiết.

IV. Ứng dụng thực tiễn của MongoDB trong doanh nghiệp

MongoDB đã được áp dụng rộng rãi trong nhiều lĩnh vực, từ thương mại điện tử đến mạng xã hội. Nhiều công ty lớn như Facebook và eBay đã sử dụng MongoDB để quản lý khối lượng dữ liệu khổng lồ và cung cấp trải nghiệm người dùng tốt hơn.

4.1. MongoDB trong thương mại điện tử

Nhiều nền tảng thương mại điện tử sử dụng MongoDB để quản lý danh mục sản phẩm và thông tin khách hàng. Hệ thống này giúp tối ưu hóa quy trình tìm kiếm và xử lý đơn hàng.

4.2. MongoDB trong mạng xã hội

Các mạng xã hội lớn sử dụng MongoDB để lưu trữ và xử lý dữ liệu người dùng. Điều này giúp cải thiện hiệu suất và khả năng mở rộng khi số lượng người dùng tăng lên.

V. Kết luận Tương lai của MongoDB trong lĩnh vực NoSQL

MongoDB đang trở thành một trong những lựa chọn hàng đầu cho các hệ thống cơ sở dữ liệu NoSQL. Với sự phát triển không ngừng của công nghệ và nhu cầu ngày càng cao về hiệu suất, MongoDB hứa hẹn sẽ tiếp tục phát triển và đáp ứng tốt hơn nữa nhu cầu của người dùng.

5.1. Xu hướng phát triển của MongoDB

MongoDB đang không ngừng cải tiến và phát triển các tính năng mới để đáp ứng nhu cầu ngày càng cao của thị trường. Điều này giúp hệ thống trở nên linh hoạt và mạnh mẽ hơn.

5.2. Tác động của MongoDB đến ngành công nghệ thông tin

Sự phát triển của MongoDB đã tạo ra một làn sóng mới trong ngành công nghệ thông tin, thúc đẩy các doanh nghiệp chuyển đổi sang các giải pháp NoSQL để tối ưu hóa quy trình làm việc và nâng cao hiệu suất.

10/07/2025

Trích đoạn nội dung tài liệu

NATIONAL UNIVERSITY HOCHIMINH CITY UNIVERSITY OF INFORMATION TECHNOLOGY ADVANCED PROGRAM IN INFORMATION SYSTEMS NGUYEN TAN THANH- 15520813 BACHELOR OF ENGINEERING IN INFORMATION SYSTEMS THESIS ADVISOR Assoc. Nguyen Dinh Thuan HO CHI MINH CITY, 2021 Introduction Nowadays, with the booming technology era, the success of Internet has made the number of users accessing the same system increasing. Typically, Facebook serves more than 1000 billion visitors a month and more than 800 million visitors, we can imagine how information explosion is. To solve the above explosive problem, we have expanded super large server systems, divided into many clusters located all over the world.

But with the current growth rate exponentially, increasing the number of servers is not enough. We need to review and upgrade storage solutions for the future. The database server system is very demanding or the server will be overloaded. For systems with numbers in the millions to billions, good performance is a must.

In today's RDBMS systems, the performance problem is often not good for this. The SQL language is an interpreted language with constraints in tables that make the actual performance of the database system sluggish when it is executed on such a large system. Not to mention that with large systems, the issue of data distribution, data integrity is very important. NoSQL meets all of these requirements.With the speed of not going through the SQL queries, having high availability, high dispersion and great stability, NoSQL is suitable for systems with numbers.

large number of queries. In this thesis, I will research on a fairly popular NoSQL type - MongoDB. MongoDB is an open source database. MongoDB offers a flexible data model to meet the requirements of real-world systems.

MongoDB allows to build high- performance, low-latency applications quickly and efficiently. MongoDB deserves to be a reliable database. Acknowledgment We would like to send our deep thanks to Mr.Nguyễn Đình Thuân, who helped and facilitated the group to complete this graduation thesis well. He dedicated himself to guide and give extremely valuable comments to make the topic more and more complete.

The teacher's suggestions help us to approach, understand and solve the problem more easily. At the same time, we would also like to express our gratitude to the teachers and teachers of the University of Information Technology - National University of Ho Chi Minh City, especially the teachers and faculty of Software Technology who are dedicated imparting knowledge and experiences to us from the first days of studying at school. The enthusiasm of our teachers has helped us to have a solid foundation knowledge as well as valuable practical experience so that we can successfully complete our tasks of study, work and research. Besides, we also send our thanks to family, brothers, sisters and friends for encouraging and helping us a lot in the learning process as well as in life.

Ho Chi Minh City, 2021 Student implementation Nguyén Tan Thanh PROFESSER'S COMMENTS TEACHER’S COMMENTS CHAPTER I: INTRODUCTION .----- 5255225 Sc‡>t2xtrertrterrrterrrrrrrrrrrrrree 1 11 The science and novelty of the topic .2 Reasons for Choosing tOpics .4 Subject Of SẨUY. Sàn HH HT HH TH HH tt 3 1.5 _ Scope of the study. Method ofimplemen(atiON.7 _ Expected results achieved. Expect the structure of the thesis fO.

5 +6 5+c‡E‡*‡EEEkekeEerrrkrkekrree 3 2 CHAPTER 2: OVERVIEW OF NOSQL DATABASES. MMs nsec Ae TA. NoSQL storage architecCture.2 Some charaC(€riS(ICS.--¿- + St St tt re. Archiving archit€C(UTC.-- ¿+6 St HH1 HH1.

+ Sàn TT HH HH HH ti 9 2.Ặ cà St HH. Base and ACID.4 Final COnSIS(TCY. TT HH HT ng Hiến 12 2.5 Mulu-version Concurrency control (MVCC).6 Scalability and perÍOrImanCe.5 Features of NoSQL database.- ¿cà tt Sv SH 212121111111 ke 15 2.6 Difference between NoSQL and SQ\L.7 Advantages and disadVantage©S. Sàn HH HH nhà 19 3.

CHAPTER 3: MONGODB ADMINISTRATION SYSTEM. ó- HH T HH HH HT HH TT HH TT HH 20 3.2 Development history of MongolDB. Characteristics of MongolDB. S2 121 121211 11H H121 HH HH HH HH HH gi 22 3.1 Database and ColleCtiOn.

Fields and data types .-- Set tHerười 25 3. Design the data model .1 Embedded data model,.2 Reference data model. Model of relationships between document. Compare index types.4 Index pTOp€T(IS.

TT HH HH HH in 38 3.1 The replica - set StUCẨUT€.1 Fragmentation in MongolDB.3 Balanced data distributiOn.4 Configuration Sf€ps. cece cee 5 5S 11212121 115 E1 12121111 TH HH HH gi 47 4 CHAPTER 4: COMPARISON OF TWO DBMS MANAGEMENT SYSTEMS MONGODB AND SQL SERVER.1 Main diŸf€T€TICC. 53 42 Syntax differences NA .cccseeceseseseesecseseseeeesesessesesescseseeseseseseseeseseneees 57 5 CHAPTER 5: CONCLUSION.1 Some results achieved: .2 In terms of comparative eXp€TimeI(. ceccecessceeesseseseseeeteeseseseseseseeeeresseaeseseeteesserseseees 67 CHAPTER I: INTRODUCTION The Covid epidemic breaks out all over the world, all industries tend to turn to digital.

The impact of IT on human society is enormous. The development and application of the Internet have changed the model and way of doing business. Simultaneously with the development of social networks, which have allowed users to freely create content on social networks, data growth is rampant from data about images, blogs, social media updates. Everyday, electronic documents, music and video files are developed at a rapid rate.

All types of information, audio and video data can be digitally converted so that any computer can store, process and forward them to multiple people. This leads to data increasing very quickly, exceeding the processing limit of traditional database management systems. Storing and exploiting this huge amount of data to filter out useful data is the biggest challenge that humanity has faced in modern society.1 The science and novelty of the topic Current Relational Database Management systems (RDBMs) show weaknesses such as indexing large amounts of data, paging, or distributing media streams (movies, pictures, music, etc. Relational databases are designed for not too large data models while social networking services have a huge amount of data and are constantly updated due to the large number of users.

NoSQL database is especially suitable for extremely large applications (search services, social networks,. and small, minimizing computations, related read-write tasks combined with batch processing. Processing ensures the data processing requirements of social networking services. This database system can store and process from very small amounts to very large amounts of data to petabytes of data with high fault resistance and load capacity but requires only low hardware resources.

Up to now, there are about 150 types of NoSQL databases, each database system has its own characteristics and often used for different projects. In this thesis, I would like to learn in detail about MongoDB database management system, and compare it with the traditional database management system, SQL Server. MongoDB is an open source database system developed and supported by 10gen, the leading NoSQL database used by millions of people. MongoDB is often used for mid- range and large applications, usually social networking sites.

Currently, MongoDB is being used in a number of big companies such as MTV Networks, Craigslist, Foursquare. MongoDB is a database that is developing well and is used for many technology projects today. With the advantage of being an open source database system, the development potential of MongoDB is huge.1: Performance on MySQL and Cassandra (Source: itzone.vn) Facebook Search > 50 GB Data MySQL Cassandra Writes Average ~300ms 0.12ms Reads Average ~350ms 15ms 1.2 Reasons for choosing topics However, due to the massive data explosion, especially the unstructured nature of the data in recent years, non-relational database technologies like MongoDB become useful for solving problems that Traditional relational database encountered. Due to the needs of the era.

I decided to choose the thesis topic "Compare MongoDB and SQL Server". This is a very relevant topic, the development of information technology. Thesis plays an important role in providing a new insight into a trendy database, helping to develop applications with medium or high data volume, especially for social networking sites.3 Research objectives Find out the features of NoSQL and the difference between NoSQL and SQL. Understand the storage architecture of NoSQL, the types of NoSQL databases, the pros and cons of NoSQL.

From the specific characteristics of the NoSQL management systems, from there it is possible to use the NoSQL administration systems suitable for each appropriate application. Learn MongoDB and compare it with SQL Server database management system. As well as learn the features, schema design, index, replication, and querying on the MongoD admin system. The detail of the comparison is to show the difference between a non-relational database management system - MongoDB and a relational database management system - SQL Server.4 Subject of study Learn about NoSQL database overview, test, compare and evaluate NoSQL with traditional relational database model (SQL Server).

Learn about MongoDB and compare it with other NoSQL database management systems like SQL server. The comparison criteria include theoretical and experimental differences.5 Scope of the study Learn about NoSQL and MongoDB database management system and compare the theory and experiment between MongoDB and SQL Server management system, theoretically compare them based on features, limitations, computability, integrity, distribution, system requirements, architecture. Experimentally, we will compare and evaluate the performance of MongoDB compared to SQL Server on the regular operations of a popular database: Select, Update, Delete and Insert.6 Method of implementation - Learn about NoSQL database, especially MongoDB database management system and the traditional SQL Server database management system. - Experiment with Query questions such as Select, Update, Delete and Insert on many data with different records to compare their execution time on each database system.

- Conclusion and development direction 1.7 Expected results achieved Understand overview of NoSQL-MongoDB database, test, compare, evaluate MongoDB with traditional relational database model (SQL Server) on different datasets through which we can use it. Database management system in each specific case.8 Expect the structure of the thesis to - Chapter 1: Overview - Chapter 2: NoSQL database - Chapter 3: MongoDB database management system - Chapter 4: Results of running experiments comparing two database management systems, MongoDB and SQL Server - Chapter 5: Conclusion and development direction CHAPTER 2: OVERVIEW OF NOSQL DATABASES 2.1 NoSQL NoSQL - Not Only SQL, a new generation of databases that doesn't use the relational data model to manage data. NoSQL has schema-free. Designed for distributed data storage models with huge amounts of data up to rows of petabytes.

According to Eric Evans "The focus of NoSQL is to solve problems that RDBMS cannot solve" [21]. NoSQL is a new generation of database with outstanding features such as: Non relation, Distribute, open source, and Horizontal scalable, free schema, simple API. It is possible to store data processing from very small amounts up to rows of petabytes in a system with high load, high fault tolerance and real-time response [1] [2] [17]. NoSQL encompasses a wide range of different database technologies that have been developed in response to the need for increased data volume, access frequency and processing efficiency, along with economical storage capabilities.

Relational databases are not designed to meet the challenges of the scale of storage and agility of these modern applications. [17] DATA GROWTH 40 X axis: Year Y axis: Global data 35 Unit of measurement: Zettabytes 1ZB = 1,000’ bytes 30 25 20 15 10 ° oni 2005 2006 20 7 | 2008 2014 2015 2016 5 2 2018 § 2 Figure 2.1: Chart of data growth [Note: UNECE research source] 2.2 History NoSQL has a lot of motivation to develop, but in fact NoSQL is not a completely new thing. The term "NoSQL" was used by Carlo Strozzi in 1998 as the name of the file based on the database he is working on. This is the generic name for lightweight open source relational database but does not use SQL for queries.

This is a relational database without an SQL interface. As such it is not really a part of our NoSQL movement today. [12] [1] [3] The term re-emerged in 2009 when Eric Evans, a member of Rackspace, commissioned by the Cassandra project, reintroduced the term NoSQL when Last.

Nội dung được bảo vệ bản quyền — Tải xuống đầy đủ