# Indices per website or deleteByQuery

**URL:** <https://discuss.elastic.co/t/indices-per-website-or-deletebyquery/259088>\
**Category:** Elasticsearch\
**Created:** [December 18, 2020, 11:26am UTC](https://discuss.elastic.co/t/indices-per-website-or-deletebyquery/259088 "2020-12-18T11:26:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adriaan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adriaan/32/100196_2.png) [@adriaan](https://discuss.elastic.co/u/adriaan)\
**Post date:** [December 18, 2020, 11:26am UTC](https://discuss.elastic.co/t/indices-per-website-or-deletebyquery/259088/1 "2020-12-18T11:26:50Z")

</div>

I have an analytics business called [Simple Analytics](https://simpleanalytics.com/). It's powered by Elasticsearch and it works great. We store analytics data for the websites of our customers. We give our customers to option to delete their account and all their website data.

Currently we store the data in time based indices which works well for performance reasons, but when deleting customer data it's not optimal. Some customers have data that goes a while back. We use [deleteByQuery API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) to delete the specific data of that customer, but it feels like that's not the best way. The `deleteByQuery`'s are quite slow.

I was thinking of creating indices per website combined with time series. This would generate a lot of indices. So that also doesn't feel like the right way.

Who can shine some light on the best way to approach this issue?

---

<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:** [January 15, 2021, 11:27am UTC](https://discuss.elastic.co/t/indices-per-website-or-deletebyquery/259088/2 "2021-01-15T11:27:04Z")

</div>

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