# Index per user or Index for all users?

**URL:** <https://discuss.elastic.co/t/index-per-user-or-index-for-all-users/47633>\
**Category:** Elasticsearch\
**Created:** [April 18, 2016, 9:34am UTC](https://discuss.elastic.co/t/index-per-user-or-index-for-all-users/47633 "2016-04-18T09:34:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![living\_jordi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/living_jordi/32/61363_2.png) [@living\_jordi](https://discuss.elastic.co/u/living_jordi)\
**Post date:** [April 18, 2016, 9:34am UTC](https://discuss.elastic.co/t/index-per-user-or-index-for-all-users/47633/1 "2016-04-18T09:34:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:58pm UTC](https://discuss.elastic.co/t/index-per-user-or-index-for-all-users/47633/2 "2017-07-05T22:58:33Z")

</div>


