# Change data from database

**URL:** <https://discuss.elastic.co/t/change-data-from-database/246190>\
**Category:** Elasticsearch\
**Created:** [August 24, 2020, 9:29pm UTC](https://discuss.elastic.co/t/change-data-from-database/246190 "2020-08-24T21:29:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pcb/32/48423_2.png) [@pcb](https://discuss.elastic.co/u/pcb)\
**Post date:** [August 24, 2020, 9:29pm UTC](https://discuss.elastic.co/t/change-data-from-database/246190/1 "2020-08-24T21:29:39Z")

</div>

Hi ya,

I'm storing timestamped change data coming off a SQL database into Elasticsearch and would like some advice. It is over 100 tables and most will be fairly small (small number of bytes + not many changes over course of the day) with a few tables being much larger and more active.

I'm curious if you all would recommend one index per table with an alias or one mono-index.

**Some points:**

- Every table will have similar context information (timestamp, user id, org id, etc)
- Queries will usually be over all tables by timestamp. I'll likely be sorting by timestamp and aggregating a lot across tables.
- I'll like be rolling over the index/indices every week or month.
- There will be about 1000 columns (so 1000 fields about total).
- Very rarely add columns (and therefore fields).
- Quite a few of the tables are small enough that they wouldn't even necessarily need their own shard space-wise(quite a few would be less than 10GB per month).

I'll be writing into it with bulk action, from one process atm. I'm mostly focused on query speed.

I realize there isn't always a straightforward answer here, but I'd love any thoughts you could provide.

Thanks much,  
Patrick

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 24, 2020, 9:31pm UTC](https://discuss.elastic.co/t/change-data-from-database/246190/2 "2020-08-24T21:31:00Z")

</div>

I would just use one index for them all, and then look at attaching a field+value that identifies the originating table so that you can filter on that if you want.

---

<div class="post-metadata">

**Author:** ![pcb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pcb/32/48423_2.png) [@pcb](https://discuss.elastic.co/u/pcb)\
**Post date:** [August 24, 2020, 10:07pm UTC](https://discuss.elastic.co/t/change-data-from-database/246190/3 "2020-08-24T22:07:39Z")

</div>

Awesome thanks @warkolm , that was the direction I was leaning.

Is 1000 fields within one index an issue? I know having "lots" of fields can be tough on a cluster's master nodes, but never heard what "lots" really means.

Thanks,  
Patrick

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 24, 2020, 10:09pm UTC](https://discuss.elastic.co/t/change-data-from-database/246190/4 "2020-08-24T22:09:25Z")

</div>

Check out [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html#mapping-limit-settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html#mapping-limit-settings) for more on that.

---

<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:** [September 21, 2020, 10:09pm UTC](https://discuss.elastic.co/t/change-data-from-database/246190/5 "2020-09-21T22:09:30Z")

</div>

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