NoSQL Introduction
NoSQL, or not-only SQL, refers to non-relational databases
- relational database to ensure the integrity and relevance of data
ID Name Age Salary
- Non-relational database, which does not guarantee the integrity and correlation of data, and has high efficiency in reading and writing data.
Guaranteed key value Storage: Key=>value
Set Name value
Get Name
NoSQL Database Classification
Key values database: Redis, Memcache
List-type database: HBase (Java)
Document Type database: MongoDB
About Redis
Redis is an open source API that is written in ANSI C, supports the web, can be persisted in memory, key-value databases, and provides multiple languages.
Italian engineer, about 2000 years, to develop a project needs to do a real-time statistical function, but feel that MySQL read and write performance is poor, so decided to write a database, in order to improve read and write speed, in memory to open a space to read and write, so as to improve the efficiency of reading and writing data, It was later sponsored by VMware.
Linux System---> memory (Redis read-write)----> disk (file)-----> Connect MySQL database----Read-write table
Redis provides a solution for persisting storage that stands out from the many in-memory cache databases. Memcache is also stored in memory, but each time the operating system is restarted, the data in memory is lost
Redis Application Scenarios
Because Redis is memory-based, it is recommended to use Redis storage for high read/write efficiency and small data volumes
For example:
- Cache string (small amount of data)
- Task Queue (order generation)
- Leaderboard Program (sorted set ordered set)
- Session storage under Distributed environment
The first to recognize NoSQL