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

js to achieve simulated shopping mall case

Friends who are learning HTML, CSS and JS front-e...

How to set up Referer in Nginx to prevent image theft

If the server's images are hotlinked by other...

Graphical explanation of the function call of proto file in Vue

1. Compile proto Create a new proto folder under ...

Solve the MySQL 5.7.9 version sql_mode=only_full_group_by problem

MySQL 5.7.9 version sql_mode=only_full_group_by i...

Example test MySQL enum type

When developing a project, you will often encount...

Tips for turning pixels into comprehensive brand experiences

Editor: This article discusses the role that inte...

Brief analysis of centos 7 mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar

Baidu Cloud Disk: Link: https://pan.baidu.com/s/1...

IE6 implements min-width

First of all, we know that this effect should be ...

How to expand the disk space of Linux server

Table of contents Preface step Preface Today I fo...

Workerman writes the example code of mysql connection pool

First of all, you need to understand why you use ...

Vue implements click feedback instructions for water ripple effect

Table of contents Water wave effect Let's see...

Practical method of deleting files from Linux command line

rm Command The rm command is a command that most ...

Similar to HTML tags: strong and em, q, cite, blockquote

There are some tags in XHTML that have similar fu...