Category:MongoDB

  • SDS of redis data structure

    Time:2021-3-6

    SDS(simple dynamic string), simple dynamic string. S and it’s called hacking string. Where hack is stored is the length of the string and the remaining space in SDS. The implementation of SDS insds.cIn the middle. C language string uses a character array of length N + 1 to represent the string of length N, and […]

  • [original] Qianglu. Net redis cluster access component

    Time:2021-3-5

    Hello, everyone. I’m tanzame. We meet again. Today, let’s talk about how to build a redis cluster client by hand. It’s purely manual and has dry goods. You can make fine products. With the growth of business and the surge of QPS in online environment, it is natural to switch the current stand-alone redis to […]

  • Basic data types and basic application scenarios of redis

    Time:2021-3-4

    Basic application scenarios of redis Get the winning user ID. after it pops up randomly, the set does not exist Store the winning user ID in the activity to ensure that the same user won’t win twice [set] Store the fan list, value is the user ID of the fan, score is the follow time […]

  • Use redis data reveal (RDR) to view the memory space occupied by the key in redis

    Time:2021-3-3

    The response speed of the project is relatively high, so redis cache is used for all the projects, which also leads to cache failure. It is necessary to analyze the memory usage of various keys for optimization. Although redisclient can easily operate redis, it can’t view the memory occupied by the corresponding key, and can’t […]

  • Redis persistent storage

    Time:2021-2-27

    Redis persistent storage Redis is mostly used for caching and message middleware. When it is used as caching, data reading and writing are carried out in memory. Once the memory is powered off or the host is restarted, the data in the memory will be cleared. To ensure that the data will not be lost, […]

  • Mongodb configuration file mongod.conf

    Time:2021-2-26

    # mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # where to write logging data. systemLog: destination: file logAppend: true path: /data/log/mongodb/mongod.log # Where and how to store data. storage: dbPath: /data/db/mongodb journal: enabled: true # engine: # wiredTiger: # how the process runs processManagement: fork: true # fork and run in background […]

  • The difference and use of setex, setnx, set and GetSet commands in redis

    Time:2021-2-25

      This paper introduces several common redis commands Set command set key value Set the value of the specified key to value. If the key has already stored other values, set will override the old value and ignore the type. 127.0.0.1:6379> set testSetKey aaa OK 127.0.0.1:6379> get testSetKey “aaa” 127.0.0.1:6379 > set testsetkey BBB # […]

  • The use of Yii redis Zset ordered set

    Time:2021-2-24

      Similar to hash which stores the mapping relationship between key and value, ordered set also stores the mapping between member and score, and provides score processing commands, as well as commands to fetch and scan member and score in order according to score. Here are some common commands and their use in Yii. ZADD […]

  • Docker redis container passed dump.rdb File for data migration or data recovery

    Time:2021-2-23

    Docker redis container passed dump.rdb File for data migration or data recovery Pull redis image #Pull the latest redis image $docker pull redis Enter the old redis container to save the data $docker exec -it old_aley_redis redis-cli 127.0.0.1:6379>save Copy dump.rdb file The Save command will generate dump.rdb If you don’t know where to save the […]

  • Redis completes data migration through master-slave replication

    Time:2021-2-22

    Redis completes data migration through master-slave replication Enter the new server and perform the slave configuration,slaveofCommand to configure the current redis host,infoCommand to view redis information. End of executionslaveofExecute after commandinfoCommand viewmaster_link_statusIf the value of isupIndicates that synchronization is complete. At this time, the role of redis is slave. Execute after synchronizationslaveof no oneDisconnect the […]

  • The startup and connection of mongodb in Windows system.

    Time:2021-2-21

    The installation of mongodb is very simple. The official website provides the download of the installation version and the green version (for those who are slow on the Internet, it is recommended to download them from other channels). My local installation is the installation version, and the directory is the default directory. Let’s not talk […]

  • Common operations of Mongoose

    Time:2021-2-20

    Mongodb BasicsUse user / / enter the user databasedb.auth (“user name”, “password”) / / after setting the account password, it can be used for authentication. First use to enter the database, and then run it. Otherwise, an error will be reporteddb.dropDatabase () / / delete the current databasedb.user.drop () / / delete a collection called […]