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

Nginx Service Quick Start Tutorial

Table of contents 1. Introduction to Nginx 1. Wha...

Summary of data interaction between Docker container and host

Preface When using Docker in a production environ...

Mysql uses stored procedures to quickly add millions of data sample code

Preface In order to reflect the difference betwee...

Analysis and summary of the impact of MySQL transactions on efficiency

1. Database transactions will reduce database per...

Solve the problem of MySql8.0 checking transaction isolation level error

Table of contents MySql8.0 View transaction isola...

Introduction to the use and disabling of transparent huge pages in Linux

introduction As computing needs continue to grow,...

Example usage of JavaScript tamper-proof object

Table of contents javascript tamper-proof object ...

How to display percentage and the first few percent in MySQL

Table of contents Require Implementation Code dat...

HTML (css style specification) must read

CSS style specifications 1. Class Selector 2. Tag...

Collection of 12 practical web online tools

1. Favicon.cc To create ico icon websites online,...

IIS 7.5 uses URL Rewrite module to achieve web page redirection

We all know that Apache can easily set rewrites f...

MySQL installation tutorial under Linux centos7 environment

Detailed introduction to the steps of installing ...

A simple example of creating a thin line table in html

Regarding how to create this thin-line table, a s...

CSS implements 0.5px lines to solve mobile compatibility issues (recommended)

【content】: 1. Use background-image gradient style...