# ElasticSearch to SQL sync

**URL:** <https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487>\
**Category:** Elasticsearch\
**Created:** [March 20, 2014, 7:29am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487 "2014-03-20T07:29:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Komal\_Parekh](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@Komal\_Parekh](https://discuss.elastic.co/u/Komal_Parekh)\
**Post date:** [March 20, 2014, 7:29am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/1 "2014-03-20T07:29:30Z")

</div>

Hello,

We are running one application which has very large amount of data updating  
very frequently. And we are using SQL for any command like  
update/delete/add records. And for querying part we are using  
ElasticSearch. So is there any way which syncs my data very frequently say  
in 5 to 10 seconds. Is there any push mechanism available with  
ElasticSearch which pushes data from SQL to ES? And more what is the best  
option for synching? Please reply urgently with the best option :).

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 20, 2014, 7:34am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/2 "2014-03-20T07:34:28Z")

</div>

Best: when you push in your application to MySQL, push as well to elasticsearch.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 20 mars 2014 à 08:29, Komal Parekh [komaldparekh@gmail.com](mailto:komaldparekh@gmail.com) a écrit :

Hello,

We are running one application which has very large amount of data updating very frequently. And we are using SQL for any command like update/delete/add records. And for querying part we are using ElasticSearch. So is there any way which syncs my data very frequently say in 5 to 10 seconds. Is there any push mechanism available with ElasticSearch which pushes data from SQL to ES? And more what is the best option for synching? Please reply urgently with the best option :).

## Thanks

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/E544B701-5E84-4092-A50E-D3A28CEC66B4%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/E544B701-5E84-4092-A50E-D3A28CEC66B4%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Komal\_Parekh](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@Komal\_Parekh](https://discuss.elastic.co/u/Komal_Parekh)\
**Post date:** [March 20, 2014, 8:49am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/3 "2014-03-20T08:49:23Z")

</div>

Thanks David for your prompt response. Actually we are using MSSQL not  
MySQL. So this solution will not work for us.

On Thursday, March 20, 2014 1:04:28 PM UTC+5:30, David Pilato wrote:

> Best: when you push in your application to MySQL, push as well to  
> elasticsearch.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 20 mars 2014 à 08:29, Komal Parekh \<[komald...@gmail.com](mailto:komald...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Hello,
> 
> We are running one application which has very large amount of data  
> updating very frequently. And we are using SQL for any command like  
> update/delete/add records. And for querying part we are using  
> Elasticsearch. So is there any way which syncs my data very frequently say  
> in 5 to 10 seconds. Is there any push mechanism available with  
> Elasticsearch which pushes data from SQL to ES? And more what is the best  
> option for synching? Please reply urgently with the best option :).
> 
> Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/80291df4-8681-4079-befc-e2db8160bf20%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/80291df4-8681-4079-befc-e2db8160bf20%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Komal\_Parekh](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@Komal\_Parekh](https://discuss.elastic.co/u/Komal_Parekh)\
**Post date:** [March 20, 2014, 8:50am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/4 "2014-03-20T08:50:42Z")

</div>

Thanks David for your prompt response. But we want some automatic Push or  
poll mechanism for this.

On Thursday, March 20, 2014 1:04:28 PM UTC+5:30, David Pilato wrote:

> Best: when you push in your application to MySQL, push as well to  
> elasticsearch.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 20 mars 2014 à 08:29, Komal Parekh \<[komald...@gmail.com](mailto:komald...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Hello,
> 
> We are running one application which has very large amount of data  
> updating very frequently. And we are using SQL for any command like  
> update/delete/add records. And for querying part we are using  
> Elasticsearch. So is there any way which syncs my data very frequently say  
> in 5 to 10 seconds. Is there any push mechanism available with  
> Elasticsearch which pushes data from SQL to ES? And more what is the best  
> option for synching? Please reply urgently with the best option :).
> 
> Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/34e2f8a0-9592-4cb6-8d86-8fbb03242488%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4f632383-b489-4893-b27d-0b93b174df48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4f632383-b489-4893-b27d-0b93b174df48%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 20, 2014, 9:43am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/5 "2014-03-20T09:43:13Z")

</div>

Have you tried the JDBC river for poll mechanism?

> **[GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-jdbc)**
>
> JDBC importer for Elasticsearch. Contribute to jprante/elasticsearch-jdbc development by creating an account on GitHub.

Jörg

On Thu, Mar 20, 2014 at 9:50 AM, Komal Parekh [komaldparekh@gmail.com](mailto:komaldparekh@gmail.com)wrote:

> Thanks David for your prompt response. But we want some automatic Push or  
> poll mechanism for this.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHDJOf1ja28VWHf98ru0kzEJ9-ZydKzZyFY2Uk%2B4\_dZHA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHDJOf1ja28VWHf98ru0kzEJ9-ZydKzZyFY2Uk%2B4_dZHA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Komal\_Parekh](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@Komal\_Parekh](https://discuss.elastic.co/u/Komal_Parekh)\
**Post date:** [March 20, 2014, 9:48am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/6 "2014-03-20T09:48:10Z")

</div>

Yes we have done some implementation on river but it does not give real  
time data. And also it is not as much mature. So for real time data we need  
to use some push mechanism which can help up to have realtime data.

On Thursday, March 20, 2014 3:13:13 PM UTC+5:30, Jörg Prante wrote:

> Have you tried the JDBC river for poll mechanism?
> 
> [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc/)
> 
> Jörg
> 
> On Thu, Mar 20, 2014 at 9:50 AM, Komal Parekh \<[komald...@gmail.com](mailto:komald...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Thanks David for your prompt response. But we want some automatic Push or  
> > poll mechanism for this.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d18888e6-c85b-46cc-8d7d-b41a763ae3f0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d18888e6-c85b-46cc-8d7d-b41a763ae3f0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 20, 2014, 10:36am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/7 "2014-03-20T10:36:45Z")

</div>

As David said, for push, you must modify your middleware that performs the  
insert/update/delete - there is nothing ES can do for you. You must add an  
ES client that can execute the respective operations on your data against  
an ES cluster.

Poll method does not scale, push does scale.

I do not understand JDBC river is not mature, I happily accept bug reports  
and patches. Maybe you discovered that river instances do not scale and are  
kind of limited.

Jörg

On Thu, Mar 20, 2014 at 10:48 AM, Komal Parekh [komaldparekh@gmail.com](mailto:komaldparekh@gmail.com)wrote:

> Yes we have done some implementation on river but it does not give real  
> time data. And also it is not as much mature. So for real time data we need  
> to use some push mechanism which can help up to have realtime data.
> 
> On Thursday, March 20, 2014 3:13:13 PM UTC+5:30, Jörg Prante wrote:
> 
> > Have you tried the JDBC river for poll mechanism?
> > 
> > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc/)
> > 
> > Jörg
> > 
> > On Thu, Mar 20, 2014 at 9:50 AM, Komal Parekh [komald...@gmail.com](mailto:komald...@gmail.com)wrote:
> > 
> > > Thanks David for your prompt response. But we want some automatic Push  
> > > or poll mechanism for this.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/d18888e6-c85b-46cc-8d7d-b41a763ae3f0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d18888e6-c85b-46cc-8d7d-b41a763ae3f0%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/d18888e6-c85b-46cc-8d7d-b41a763ae3f0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d18888e6-c85b-46cc-8d7d-b41a763ae3f0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFmQ\_w8iJo0Bdw%2BvS9s8sEfajgxi1MTeZabpSdUNkHaMQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFmQ_w8iJo0Bdw%2BvS9s8sEfajgxi1MTeZabpSdUNkHaMQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian/32/1712_2.png) [@Andrew\_Cholakian](https://discuss.elastic.co/u/Andrew_Cholakian)\
**Post date:** [March 20, 2014, 6:27pm UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/8 "2014-03-20T18:27:50Z")

</div>

This is a complex issue with no single, simple, answer. Performing  
synchronization between two databases is a non-trivial undertaking for any  
technology. For an overview of strategies and techniques please see my  
article on the topic Keeping Elasticsearch in Sync[https://www.found.no/foundation/keeping-elasticsearch-in-sync/](https://www.found.no/foundation/keeping-elasticsearch-in-sync/)  
.

* * *

Andrew Cholakian  
Developer, Found Hosted Elasticsearch  
www.found.no, @foundsays

On Thursday, March 20, 2014 2:29:30 AM UTC-5, Komal Parekh wrote:

> Hello,
> 
> We are running one application which has very large amount of data  
> updating very frequently. And we are using SQL for any command like  
> update/delete/add records. And for querying part we are using  
> Elasticsearch. So is there any way which syncs my data very frequently say  
> in 5 to 10 seconds. Is there any push mechanism available with  
> Elasticsearch which pushes data from SQL to ES? And more what is the best  
> option for synching? Please reply urgently with the best option :).
> 
> Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/24c46bf2-910d-462a-b639-1f9586544dab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/24c46bf2-910d-462a-b639-1f9586544dab%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:41am UTC](https://discuss.elastic.co/t/elasticsearch-to-sql-sync/16487/9 "2017-07-06T01:41:47Z")

</div>


