Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
We are introducing log using elasticsearch for a multi tenant application (eg: around 10000 tenants). We need to log profile_edits, user_comments, cron_activities, category_edits and about 30 more categories to log.
I found two ways to store these logs.
- One index per tenant
POST tenant-1/_doc
{
"type" : "profile_edits",
"fullname" : "NewName",
"age" : 11,
"score" : 999
...
}
POST tenant-1/_doc
{
"type" : "user_comments",
"user" : "User1",
"comment" : "Nice!"
}
In this way I could be having no of indices = no of tenants.
- Shared index for tenants
POST profile_edits/_doc
{
"tenant" : 1,
"fullname" : "NewName",
"age" : 11,
"score" : 999
}
POST user_comments/_doc
{
"tenant" : 1,
"user" : "User1",
"comment" : "Nice!"
}
In this way I need around ~35 index in total.
Which method works better?