Want to create interactive content? It’s easy in Genially!

Get started free

NoSQL Database

lien kim

Created on April 16, 2022

Start designing with a free template

Discover more than 1500 professional designs like these:

Transcript

NoSQL Database

Team Name Truong Thi Kim Lien - 19521748 Nguyen Vu Thanh Long - 19521795

Lecturer: Ms.Thai Thuy Han Uyen

Table of contents

01

NoSQL Database

Overview of the NoSQL Database

02

MongoDB

NoSQL Database Example

03

Demo

Instructions for basic operations when using MongoDB

NoSQL Database

What is NoSQL Database

NoSQL Database is a non-relational Data Management System that does not require a fixed schema. It avoids joins, and is easy to scale. The major purpose of using a NoSQL database is for distributed data stores with humongous data storage needs. NoSQL is used for Big data and real-time web apps.

When people use the term “NoSQL database,” they typically use it to refer to any non-relational database. Some say the term “NoSQL” stands for “non SQL” while others say it stands for “not only SQL.” Either way, most agree that NoSQL databases are databases that store data in a format other than relational tables.

+ info

Brief history of NoSQL Database

  • 1998- Carlo Strozzi use the term NoSQL for his lightweight, open-source relational database
  • 2000- Graph database Neo4j is launched
  • 2004- Google BigTable is launched
  • 2005- CouchDB is launched
  • 2007- The research paper on Amazon Dynamo is released
  • 2008- Facebook's open sources the Cassandra project
  • 2009- The term NoSQL was reintroduced

+ info

NoSQL Database Features

Each NoSQL database has its own unique features.

Non-relational

Simple API

NoSQL Database nerver follow the relatinal model.

APIs allow low-level data manipulation & selection methods.

+ info

+ info

Schema-free

Distributed

NoSQL databases are either schema-free or have relaxed schemas.

Multiple NoSQL databases can be executed in a distributed fashion.

+ info

+ info

Types of NoSQL Database

There are the four main types of NoSQL databases:

Document databases

A document database stores data in JSON, BSON , or XML documents (not Word documents or Google docs, of course). In a document database, documents can be nested. Particular elements can be indexed for faster querying.

Key-value stores

The simplest type of NoSQL database is a key-value store . Every data element in the database is stored as a key value pair consisting of an attribute name (or "key") and a value.

Column-oriented databases

While a relational database stores data in rows and reads data row by row, a column store is organized as a set of columns.

Graph databases

A graph database focuses on the relationship between data elements.

+ info

Why use NoSQL Database

The concept of NoSQL databases became popular with Internet giants like Google, Facebook, Amazon, etc. who deal with huge volumes of data. The system response time becomes slow when you use RDBMS for massive volumes of data. To resolve this problem, we could “scale up” our systems by upgrading our existing hardware. This process is expensive. The alternative for this issue is to distribute database load on multiple hosts whenever the load increases. This method is known as “scaling out.”

NoSQL databases are non-relational, so they scale out better than relational databases as they are designed with web applications in mind.

When should NoSQL be used?

When deciding which database to use, decision-makers typically find one or more of the following factors lead them to selecting a NoSQL database:

  • Fast-paced Agile development
  • Storage of structured and semi-structured data
  • Huge volumes of data
  • Requirements for scale-out architecture
  • Modern application paradigms like microservices and real-time streaming

+ info

Advantages of NoSQL

NoSQL databases bring you many benefits during software development:

  • Can be used as a Primary or Analytic Data Source
  • Big Data Capability
  • No Single Point of Failure
  • Easy Replication
  • No Need for a Separate Caching Layer
  • It provides fast performance and horizontal scalability.
  • Can handle structured, semi-structured, and unstructured data with equal effect
  • NoSQL databases don’t need a dedicated high-performance server
  • Support Key Developer Languages and Platforms
  • Simple to implement than using RDBMS
  • Handles big data which manages data velocity, variety, volume, and complexity

+ info

Disadvantages of NoSQL

Besides the benefits brought to users, NoSQL databases also have limitations:

  • No standardization rules
  • Limited query capabilities
  • RDBMS databases and tools are comparatively mature
  • It does not offer any traditional database capabilities, like consistency when multiple transactions are performed simultaneously.
  • When the volume of data increases it is difficult to maintain unique values as keys become difficult
  • Doesn’t work as well with relational data
  • The learning curve is stiff for new developers
  • Open source options are not so popular for enterprises.

+ info

MongoDB

The concept of MongoDB

MongoDB is a document-oriented NoSQL database used for high volume data storage.

Instead of using tables and rows as in the traditional relational databases, MongoDB makes use of collections and documents. Documents consist of key-value pairs which are the basic unit of data in MongoDB. Collections contain sets of documents and function which is the equivalent of relational database tables.

+ info

History of MongoDB

The first version of the MongoDB database shipped in August 2009. The 1.0 release and those that followed shortly after were focused on validating a new and largely unproven approach to database design – built on a JSON-like document data model and layered onto an elastic and distributed systems foundation. Those early MongoDB releases attracted masses of adoption across startups and enterprises alike.

Developers have downloaded MongoDB more than 200 million times, and have consistently rated it as their most wanted database.

MongoDB Features

  • Each database contains collections which in turn contains documents. Each document can be different with a varying number of fields. The size and content of each document can be different from each other.
  • The document structure is more in line with how developers construct their classes and objects in their respective programming languages. Developers will often say that their classes are not rows and columns but have a clear structure with key-value pairs.
  • The rows (or documents as called in MongoDB) doesn’t need to have a schema defined beforehand. Instead, the fields can be created on the fly.
  • The data model available within MongoDB allows you to represent hierarchical relationships, to store arrays, and other more complex structures more easily.
  • Scalability – The MongoDB environments are very scalable. Companies across the world have defined clusters with some of them running 100+ nodes with around millions of documents within the database

+ info

Key Components of MongoDB Architecture

NameCollection Surname

_id

This is a field required in every MongoDB document. The _id field represents a unique value in the MongoDB document. The _id field is like the document’s primary key. If you create a new document without an _id field, MongoDB will automatically create the field.

This is a grouping of MongoDB documents. A collection is the equivalent of a table which is created in any other RDMS such as Oracle or MS SQL. A collection exists within a single database. As seen from the introduction collections don’t enforce any sort of structure.

Database

Cursor

This is a container for collections like in RDMS wherein it is a container for tables. Each database gets its own set of files on the file system. A MongoDB server can store multiple databases.

This is a pointer to the result set of a query. Clients can iterate through a cursor to retrieve results.

Key Components of MongoDB Architecture

Field

Document

A record in a MongoDB collection is basically called a document. The document, in turn, will consist of field name and values.

A name-value pair in a document. A document has zero or more fields. Fields are analogous to columns in relational databases.

JSON

This is known as JavaScript Object Notation. This is a human-readable, plain text format for expressing structured data. JSON is currently supported in many programming languages.

Why use MongoDB Database

  • Document-oriented – Since MongoDB is a NoSQL type database, instead of having data in a relational type format, it stores the data in documents.
  • Ad hoc queries - MongoDB supports searching by field, range queries, and regular expression searches. Queries can be made to return specific fields within documents.
  • Indexing – Indexes can be created to improve the performance of searches within MongoDB. Any field in a MongoDB document can be indexed.
  • Replication – MongoDB can provide high availability with replica sets. A replica set consists of two or more mongo DB instances. Each replica set member may act in the role of the primary or secondary replica at any time.
  • Load balancing – MongoDB uses the concept of sharding to scale horizontally by splitting data across multiple MongoDB instances.

When to use MongoDB Database?

Mongodb should be used in the following cases:

  • Performing content management and transmission
  • Mobile and Social Architectures
  • Manage customer data

+ info

Advantages of MongoDB

The outstanding advantages of Mongodb that convince users to choose today are:

  • They are very flexible when it comes to storing so if you want something just insert freely.
  • The data contained in Mongodb are usually not bound to each other, so when you insert, delete or update, you won't have to spend too much time checking them satisfy the constraints as in the RDBMS.
  • Mongodb is easy to extend, and in Mongodb there is always the concept of a cluster as a cluster of nodes that will contain data that communicates with each other.
  • The data cases "_id" will always be automatically indexed, so the information query speed will always reach the highest performance.
  • If there is a data query, then the record will be cached to Ram memory.
  • Mongodb's query speed is always faster than relational database management systems.

+ info

Disadvantages of MongoDB

In addition to countless outstanding advantages as above, but Mongodb still has a few weaknesses:

  • Mongodb does not have the same binding properties as in RDBMS, so when you work with Mongodb, you need to be very careful.
  • It can be memory intensive since the data is stored as key-values, so the collections will only differ in value so the key can be repeated.
  • Mongodb doesn't even support joins, so it's easy to have data redundancy.
  • When performing insert/update/remove records, MongoDB will not be able to update immediately to the hard drive. Only after 60 seconds, Mongodb can write all the data changed from RAM to the hard drive.

+ info

Demo

Thanks for listening!

Map

Write a subtitle here

80%

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut Lorem ipsum dolor sit amet.

Process

Write a subtitle here

Step 3

Step 1

Step 2

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod

+ info

+ info

+ info

Write a title here

Euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip

+ info

Write a title here

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna.

Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet

+ info

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut.

Team

Nombre Apellido

Nombre Apellido

Nombre Apellido

Nombre Apellido

Nombre Apellido

Job

Job

Job

Job

Job

+ info

+ info

+ info

+ info

+ info

Nombre Apellido

Nombre Apellido

Nombre Apellido

Nombre Apellido

Nombre Apellido

Job

Job

Job

Job

Job

+ info

+ info

+ info

+ info

+ info

Customers

" Lorem ipsum dolor sit amet, adipiscing elit, sed diam nonummy nibh mana aliquam erat volutpat"

" Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh magna aliquam erat volutpat"

Author'sName

Author'sName

" Nibh euismod tincidunt ut Lorem ipsum dolor sit amet"

" Sed diam nonummy nibh euismod ,sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna"

Author'sName

Author'sName