Caching oracle table data into Elastic search DB effectively

Viewed 241

Best approach to cache the oracle data into Elastic search DB in Java The Oracle DB is the master data with millions of records and need be searched based on search text. so need to use ES cache to get the performance.

Now i am checking to see best way to do the sync between oracle DB and ES DB.

custom

1 Answers

i did the the above system. And people are welcome to suggest the change

i used spring JPA with hibernate on oracle and Spring JPA with ES

pseudo code

  1. check if the id is present in ES repository

  2. if present return the Page

  3. if missing

    3.1 fetch from oracle db using Oracle Repository

    3.2 user java.util.concurrent.RecursiveAction to copy the data from oracle repo to ES repo and use ForkJoinPool to invoke the recursive action . (or your could do your own custom logic to do this in a multi thread way)

    3.3 return the Page (one trouble to tackle the above step 3.2 is using daemon thread)

  4. end

Please post your suggestion on improvement of this.

Related