I've been listening to everybody saying that's better to share a same index for all users instead of a index per user. So each user would an alias.
From then on, I've ever guess that's the best solution for several reasons. However, It comes me up a situation I'd like you help me out for solving the next situation.
ES is a schemaless storage engine. Well, no problem, everything is all right until several users are able to build their schema.
For example, imagine a software product lets to users to tag his/her documents, and each tag has a name and a type. So, user says I want to tag my documents using a tag project
of type string
. At the same another user might tag his/her documents tagging them using a tag project
of type number
Then ES could index documents using this tag, creating a field on a collection with name tag's name of type string/number... (my server application would serialize documents with this new field).
User1:
{
"name": ""
"department": ""
"project": "xxx" <<<<<<<<<<<<<<<<<
}
User2:
{
"name": ""
"department": ""
"project": 1000 <<<<<<<<<<<<<<<<<
}
So, I mean each user is able to have his/her own schema.
I would like to ask for you could provide me an approach using only a single index for all users, or using a index per user.
I've to say that the most of the schema is similar for all users. So, all users shares 95% of an initially provided schema, nevertheless, each user is going to be able to add new schema fields...
I hope I've explained well.