Home  >  Q&A  >  body text

java - redis缓存数据如何管理

1.实际项目中都有哪些数据存入redis中

2.多个开发人发自己存自己的数据,是怎样规范存储和整理的

3.redis中的数据用作缓存还是硬存储

4.redis上手容易不,是不是使用一个工具类就可以了。

高洛峰高洛峰2742 days ago482

reply all(2)I'll reply

  • 阿神

    阿神2017-04-18 10:57:21

    1. What data is stored in redis in actual projects?

      1. Hot data: data that is frequently queried and rarely modified

      2. User information: Redis can be used for unified Session management

    2. If multiple developers save their own data, how do they standardize the storage and organization?

      1. The main thing is to follow a unified specification, which can be done in the 项目名+模块名+实体+id way

    3. Is the data in redis used as cache or hard storage?

      1. Mainly doing caching

      2. Persistence in Redis means that Redis saves the data in the cache on the hard disk in a certain way to prevent data loss 而非数据库

    4. Is it easy to get started with redis? Can I just use a tool class?

      1. You can use Jedis to call in Java

    reply
    0
  • PHPz

    PHPz2017-04-18 10:57:21

    Project application scenarios

    1. Use HyperLogLog for IP deduplication and statistics on unique IPs

    2. Use redis linked list as queue

    3. Use the string type to perform increment counting operations, add concurrent locks, etc.

    4. Data Structure - Unordered Set. For example, in the Weibo application, each person's friends exist in a set. In this way, the operation of finding the common friends of two people also includes intersection, union, and difference sets

    5. hash type, stores user information according to business scenarios

    Other suggestions are to learn and understand redis by yourself first

    reply
    0
  • Cancelreply