# Best option for working with MySQL

**URL:** <https://discuss.elastic.co/t/best-option-for-working-with-mysql/318084>\
**Category:** Elasticsearch\
**Created:** [November 3, 2022, 9:32am UTC](https://discuss.elastic.co/t/best-option-for-working-with-mysql/318084 "2022-11-03T09:32:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristopherHS](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@ChristopherHS](https://discuss.elastic.co/u/ChristopherHS)\
**Post date:** [November 3, 2022, 9:32am UTC](https://discuss.elastic.co/t/best-option-for-working-with-mysql/318084/1 "2022-11-03T09:32:21Z")

</div>

Hello,  
We currently use Percona but to improve the search, we want to delegate this task to Elasticsearch.  
We have a `videos` table which contains over 4 million recordings.

The search is done on all the fields below linked to the `videos` table

| videos | producers | actors | categories | tags |
| --- | --- | --- | --- | --- |
| title | name | names | names | names |
| +12 translations | - | - | +12 traductions | +12 traductions |

We want to know from your experience, what is the best solution to recover the result:

1. Save only the fields that will be used for research on Elasticsearch, do a search by retrieving the IDs then do a second query on the main database to retrieve the information to display to users

2. Save on Elasticsearch all the fields fields that will be used for research and display, make a single request to retrieve all the information

Thank you for your help and advices.

---

<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:** [November 4, 2022, 1:31am UTC](https://discuss.elastic.co/t/best-option-for-working-with-mysql/318084/2 "2022-11-04T01:31:04Z")

</div>

I would say 2 as it's easier and probably quicker. Yes, there is a cost in storing the data twice, but there is a cost in the search and then DB call in your first option.

At the end of the day, you need to figure out which cost is the one you are ok with incurring based on your needs and budget.

---

<div class="post-metadata">

**Author:** ![ChristopherHS](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@ChristopherHS](https://discuss.elastic.co/u/ChristopherHS)\
**Post date:** [November 4, 2022, 11:10am UTC](https://discuss.elastic.co/t/best-option-for-working-with-mysql/318084/3 "2022-11-04T11:10:40Z")

</div>

Hi @warkolm ,

Thank you for your reply.

I will do as you advise, we think the same thing.

---

<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:** [December 2, 2022, 11:11am UTC](https://discuss.elastic.co/t/best-option-for-working-with-mysql/318084/4 "2022-12-02T11:11:24Z")

</div>

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