Redis databases on a dev machine with multiple projects

后端 未结 2 1069
抹茶落季
抹茶落季 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

    Redis is moving away from multiple databases, so I would recommend you start migrating put of that mechanism sooner rather than later. This means one instance per db. Given the very low overhead of running Redis, this isn't a problem from a resources standpoint.

    That said, you can specify the number of databases, and providing A naming standard would work. For example, configure redis to have say, 60 DBS and you add 10 for the test db. For example db3 uses db13 for testing.

    It sounds like your dev, test, and prod environments are pretty tied together. If so, I'd suggest moving away from that. Using separate instances is the easiest route to that, and provides protection against cross purpose contamination. Between this and the future of redis being single-db per instance, separate instances is the best route.

提交回复
热议问题