title: For RediSearch, is it better to create a single index or multiple indexes?
body: <p>Am building an Index using <a href="https://oss.redislabs.com/redisearch/index.html" rel="nofollow noreferrer">RediSearch</a> in a multi-tenant application that has got: </p>
  
  <ul>
  <li>150,000 tenants </li>
  <li>Each tenant has on average 3,500 customers</li>
  <li>Each customer has 10 fields that will be added to the index</li>
  <li>All of the fields are <code>TextFields</code>.</li>
  </ul>
  
  <p>Question is, what would be best practice <em>(Performance, Memory/Storage, Flexibility)</em> in such a case? </p>
  
  <p>Should I create one <code>customer_index</code> with a <code>tenant_code</code> field to help identify which data belongs to which tenant or should I create a tenant specific index? </p>
  
  <p>From my current experience and understanding, tenant-specific-index would mean many indexes but with less data in them and it would also give me the flexibility to drop and recreate an index for a specific tenant?</p>
  
  <p>In Python, the code would be as below:</p>
  
  <p><strong>Single Customer Index</strong></p>
  
  <pre><code>client = Client(`customer_index`)
  client.create_index(
              [
                  TextField('tenant_code'), TextField('last_name'), TextField('first_name'),
                  TextField('other_name'), 
              ]
          )   
  </code></pre>
  
  <p><strong>Tenant Specific Customer Index</strong></p>
  
  <pre><code>client = Client(`tenant_code_customer_index`)
  client.create_index(
              [
                  TextField('last_name'), TextField('first_name'), TextField('other_name'), 
              ]
          )
  </code></pre>