title: Redis databases on a dev machine with multiple projects
body: <p>How do you manage multiple projects on your development and/or testing machine, when some of those projects use Redis databases?</p>
  
  <p>There are 2 major problems:</p>
  
  <ol>
  <li>Redis doesn't have named databases (only numbers 0-16)</li>
  <li>Tests are likely to execute FLUSHDB on each run</li>
  </ol>
  
  <p>Right now, I think we have three options:</p>
  
  <ol>
  <li>Assign different databases for each project, each dev and test environment</li>
  <li>Prefix keys with a project name using something like <code>redis-namespace</code></li>
  <li>Nuke and seed the databases anytime you switch between projects</li>
  </ol>
  
  <p>The first one is problematic if multiple projects assign "0" for the main use and "1" for the test and such. Even if Project B decided to change to "2" and "3", another member in the project might have a conflict in another projects for him. In other words, that approach is not SCM friendly.</p>
  
  <p>For the second one, it's a bad idea simply because it adds needless overhead on runtime performance and memory efficiency. And no matter what you do, another project might be already using the same key coincidentally when you joined the project.</p>
  
  <p>The third option is rather a product of compromise, but sometimes I want to keep my local data untouched while I deploy small patches for another projects.</p>
  
  <p>I know this could be a feature request for Redis, but I need a solution now.</p>
  
  <p>Any ideas, practices?</p>