Multiple Redis Instances

后端 未结 1 1688
离开以前
离开以前 2021-02-13 00:22

Most folks seem to recommend running separate Redis instances on different ports (6379 and 6380). Why is this more commonly recommended over creating a second database? I\'m not

1条回答
  •  暖寄归人
    2021-02-13 01:28

    Two main reasons:

    1. using multiple databases is considered generally bad and to be deprecated some day, and they have some performance penalties, though pretty minor.

    2. the main reason is that redis is single threaded, if you need two different data sources, another redis instance will improve performance since it will utilize another CPU you probably have, whereas one instance will always utilize just one.

    3. Also different redis instances can have distinct persistence settings. For example one instance can use only memory and other can use files as storage Redis Persistence

    Then there are other advantages as having separate auth passwords, LRU strategies, etc - which can only be done at the instance level.

    0 讨论(0)
提交回复
热议问题