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

Vue two fields joint verification to achieve the password modification function

Table of contents 1. Introduction 2. Solution Imp...

How to install Jenkins on CentOS 8

To install Jenkins on CentOS 8, you need to use t...

Design of pop-up windows and floating layers in web design

In the trend of gradual transition from tradition...

Zookeeper stand-alone environment and cluster environment construction

1. Single machine environment construction# 1.1 D...

JavaScript to show and hide the drop-down menu

This article shares the specific code for JavaScr...

JavaScript event loop case study

Event loop in js Because JavaScript is single-thr...

How to analyze SQL execution plan in MySQL through EXPLAIN

Preface In MySQL, we can use the EXPLAIN command ...

How to build a redis cluster using docker

Table of contents 1. Create a redis docker base i...

Example code and method of storing arrays in mysql

In many cases, arrays are often used when writing...

The actual process of implementing the guessing number game in WeChat applet

Table of contents Function Introduction Rendering...

Detailed explanation of MySQL transaction isolation level and MVCC

Table of contents Transaction Isolation Level Pro...

Detailed explanation of JavaScript object conversion to primitive value

Table of contents Object.prototype.valueOf() Obje...

JavaScript+HTML to implement student information management system

Table of contents 1. Introduction 2. Rendering 3....

MySQL 8.0.11 Community Green Edition Installation Steps Diagram for Windows

In this tutorial, we use the latest MySQL communi...