Explanation of the usage scenarios of sql and various nosql databases

Explanation of the usage scenarios of sql and various nosql databases

SQL is the main trunk. Why do I understand it this way:

From a technical perspective

  • Relational grid fully reflects the reality of business
  • Due to the emphasis on data in transactions, auditing, flash memory, etc., some particularly important data must be placed in SQL. At least user information is important data in a system.
  • So SQL must be there, and the backbone of data storage

When to introduce NoSQL

Let's first look at the process of sql -> sql + nosql.

https://www.jb51.net/article/79236.htm Why use NoSQL

These nosql?

For the Java language:

  • redis: for caching - extremely fast read speed (in memory)
  • mongoDb - read and write transactions are balanced. json developed by node.js
  • Neo4j - .java is more like SQL but the query is faster, but the advanced features are charged... - Social (image database)
  • Cassandra - writes data faster than reading. - Used for log storage.
  • HBase Offline Analysis

My idea:

In terms of Java language:

  • - redis is used for caching (values ​​are stored in javabeans) and hot data that does not need to be stored
  • - mongoDb is used for less important but necessary storage.
  • - Cassandra is highly recommended for log management (put the log in the database.)
  • - HBASE offline analysis, big data
  • - Solr, ES - Search within the site and replace SQL, etc.
  • - Or use neo4j instead of sql database. When there is a transaction requirement, start a separate thread with priority 2 and store it in sql.

The NoSQL Era

There are already many NoSQL databases, such as MongoDB, Redis, Riak, HBase, Cassandra, etc. Each one has one of the following characteristics:

  • No longer using SQL, for example, MongoDB and Cassandra have their own query languages
  • Usually open source projects
  • Born for cluster operation
  • Weak structure - does not strictly limit the data structure type

Applicable scenarios

Store user information, such as sessions, profiles, parameters, shopping carts, etc. This information is usually associated with an ID (key), and a key-value database is a good choice in this scenario.

Not applicable scenarios

1) Instead of querying by key, query by value. There is no way to query by value in the Key-Value database.

2) The relationship between data needs to be stored. In a Key-Value database, data cannot be associated by two or more keys.

3) Transaction support. Rollback is not possible when a failure occurs in the Key-Value database.

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Detailed explanation of database language classification DDL, DCL, DML
  • MySQL: mysql functions
  • Explanation of CAST and CONVERT functions for type conversion in MySQL database
  • MySQL 8.0.15 installation graphic tutorial and database basics
  • SQL SERVER database backup code example
  • Syntax and usage of window functions in PostgreSQL database
  • How to reasonably use the redundant fields of the database
  • Mysql master/slave database synchronization configuration and common errors
  • PHP singleton mode database connection class and page static implementation method
  • How to improve query efficiency in a database query of tens of millions?

<<:  Vue.js implements image switching function

>>:  Two ways to install Python3 on Linux servers

Recommend

Steps to install MySQL on Windows using a compressed archive file

Recently, I need to do a small verification exper...

How to quickly paginate MySQL data volumes of tens of millions

Preface In backend development, in order to preve...

Example analysis of the page splitting principle of MySQL clustered index

This article uses an example to illustrate the pa...

Example of using @media responsive CSS to adapt to various screens

Definition and Use Using @media queries, you can ...

Native JS to achieve special effects message box

This article shares with you a special effect mes...

Example usage of Linux compression file command zip

The ".zip" format is used to compress f...

Complete steps to solve 403 forbidden in Nginx

The webpage displays 403 Forbidden Nginx (yum ins...

50 Super Handy Tools for Web Designers

Being a web designer is not easy. Not only do you...

JavaScript programming through Matlab centroid algorithm positioning learning

Table of contents Matlab Centroid Algorithm As a ...

How to use Font Awesome 5 in Vue development projects

Table of contents Install Dependencies Configurat...

CSS example code for setting scroll bar style

The CSS implementation code for setting the scrol...

Implementation of element multiple form validation

In the project, form testing is often encountered...

Javascript File and Blob Detailed Explanation

Table of contents File() grammar parameter Exampl...

How to use Vue cache function

Table of contents Cache function in vue2 Transfor...

MySQL 8.0.20 Installation Tutorial with Pictures and Text (Windows 64-bit)

1: Download from mysql official website https://d...