# Importing Data from SQL to ElasticSearch?

**URL:** <https://discuss.elastic.co/t/importing-data-from-sql-to-elasticsearch/44320>\
**Category:** Elasticsearch\
**Created:** [March 14, 2016, 11:50am UTC](https://discuss.elastic.co/t/importing-data-from-sql-to-elasticsearch/44320 "2016-03-14T11:50:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PascalR](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@PascalR](https://discuss.elastic.co/u/PascalR)\
**Post date:** [March 14, 2016, 11:50am UTC](https://discuss.elastic.co/t/importing-data-from-sql-to-elasticsearch/44320/1 "2016-03-14T11:50:13Z")

</div>

Hi,

I'd like to know if there is a reliable way to synchronize data from a sql server to Elasticsearch? I've read something about some river plugins, especially a jdbc river to accomplish that. On the other hand I've read something about that rivers are depricated and now I'm a bit confused.

It's really important that the synchronization between our RDBMS and Elasticsearch happens in "realtime".  
Is there a way to update Elasticsearch's data immediately after you commit something in the sql database?

Also I've read something about, that the JDBC plugin has some problems with reconstructing deeply nested objects to JSON and process object semantics like object identity. Is there a fix for that?

Thanks for your help!

---

<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:** [March 15, 2016, 2:44am UTC](https://discuss.elastic.co/t/importing-data-from-sql-to-elasticsearch/44320/2 "2016-03-15T02:44:53Z")

</div>

Don't use rivers, they are no longer supported.  
I'd suggest you take a look at Logstash and the JDBC input - [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html)

---

<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 17, 2016, 11:03pm UTC](https://discuss.elastic.co/t/importing-data-from-sql-to-elasticsearch/44320/3 "2016-03-17T23:03:39Z")

</div>

> [@PascalR](#):
>
> I've read something about some river plugins, especially a jdbc river to accomplish that. On the other hand I've read something about that rivers are depricated and now I'm a bit confused.

No need to be confused. JDBC river is now JDBC importer.

> [@PascalR](#):
>
> It's really important that the synchronization between our RDBMS and Elasticsearch happens in "realtime".

What do you mean by "realtime"?

> [@PascalR](#):
>
> Also I've read something about, that the JDBC plugin has some problems with reconstructing deeply nested objects to JSON and process object semantics like object identity. Is there a fix for that?

Where did you read this? There is no such thing like object identity in relational algebra, there are tuples and sets. All semantics that were necessary to create JSON documents are invented by JDBC river/importer, and this part works really well.

---

<div class="post-metadata">

**Author:** ![PascalR](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@PascalR](https://discuss.elastic.co/u/PascalR)\
**Post date:** [March 21, 2016, 1:22pm UTC](https://discuss.elastic.co/t/importing-data-from-sql-to-elasticsearch/44320/4 "2016-03-21T13:22:31Z")

</div>

Thanks for your help!

By "realtime" I mean something like a trigger, if I update/instert/delete something in my RMDBS that after the commit the importer immediately updates this to ES.

---

<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, 11:06pm UTC](https://discuss.elastic.co/t/importing-data-from-sql-to-elasticsearch/44320/5 "2017-07-05T23:06:37Z")

</div>


