How many number of aliases should be created on single index?

how many number of aliases should be created on single index? is there any hard limit for number of aliases on index/cluster?

It sounds like you are considering abusing the alias functionality. What are you looking to do and what problem are you looking to solve? Information about aliases need to be stored in the cluster state which can make it large and slow. I have seen users end up in trouble due to too many aliases but do not have any idea of how many is too many.

have multi-tenant use case. need to store the all the tenants record in single index & filter out record base on alias name

How would you filter based on alias? Acessing an index using its alias is no different from acessing using the index name.

How many tenants do you expect to need to support? How many indices would each tenant have access to?

POST /_aliases?pretty
{
 "actions": [
   {
     "add": {
    
       "alias": "opster-alias",
       "filter": {
         "term": {
           "tenant": "opster"
         }
       }
     }
   }
 ]
}

have filter based on alias with tenant, because of that will manage the segregation between tenant data.

I havn't exact count of tenant, the tenant count is not fix,
due to that I require count of the aliases should be on single index

There is no defined limit and this may have changed across versions. This post discusses the issue and provided some guideline but is old and may be out of date.

1 Like

Thank you so much @leandrojmp @Christian_Dahlqvist.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.