Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What's the difference between redis and mongodb?

Shulou Source: shulou.com Published: 2022-06-01 18:38:40 09月27日 Update

This article mainly explains "what is the difference between redis and mongodb". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the difference between redis and mongodb".

1. Set redis.windows.conf

Line 455 maxheap 1024000000 sets the size of the largest data heap

Line 387 requirepass 123456 sets the password for the database

Port number

6379

2. Start the service

In the directory of cd redis

Example:

C:\ Users\ xlg > cd C:\ redis64-2.8.2101

C:\ redis64-2.8.2101 > redis-server redis.windows.conf

The service has been running without ending, which proves that the service has been started successfully.

Third, test whether the connection is successful

Open a new terminal

Enter the password this password is the password of the requirepass added in the redis.windows.conf file

C:\ Users\ xlg > cd C:\ redis64-2.8.2101

C:\ redis64-2.8.2101 > redis-cli127.0.0.1:6379 > auth 123456OK127.0.0.1:6379 > keys *

IV. Brief introduction of redis

Redis is completely open source and free, complying with the BSD protocol is a high-performance key-value database.

Redis and other key-value cache products have the following characteristics:

Redis supports persistence of data. Data in memory can be saved on disk and can be loaded and used again when rebooted.

Redis not only supports simple key-value type data, but also provides storage of data structures such as list set zset hash.

Redis: semi-persistent storage in memory and hard disk

5. The difference between redis and mongodb

Redis is a database that stores data entirely in memory and uses disk only to persist redis data stored in memory periodically write to disk when memory is insufficient, you can choose the specified lru algorithm to delete data.

Mongodb is a document-based non-relational database, mongodb is more similar to mysql support field index cursor operation, its advantage is that the query function is more powerful, good at querying json data can store huge amounts of data, but does not support things.

Thank you for your reading, the above is the content of "what is the difference between redis and mongodb". After the study of this article, I believe you have a deeper understanding of what is the difference between redis and mongodb, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Data memory password database support disk storage learning service success content that is query powerful not only not enough things advantages again slogan Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Technology Redmi MariaDB macOS