Redis databases on a dev machine with multiple projects

后端 未结 2 1038
抹茶落季
抹茶落季 2021-02-20 07:32

How do you manage multiple projects on your development and/or testing machine, when some of those projects use Redis databases?

There are 2 major problems:

2条回答
  •  温柔的废话
    2021-02-20 08:27

    If the projects are independent and so do not need to share data, it is much better to use multiple redis instances - each project configuration has a port number rather than a database name/id. Create an appropriately named config file and startup script for each one so that you can get whichever instance you need running with a single click.

    Make sure you update the save settings in each config file as well as setting the ports - Multiple instances using the same dump.rdb file will work, but lead to some rather confusing bugs.

    I also use separate instances for development and testing so that the test instance never writes anything to disk and can be flushed at the start of each test.

提交回复
热议问题