Axon.ivy 7.0 - the Digital Business Platform - is out now...

hi ivyteam

As far as i know, when we use ivy.repo() from ivy, data will be stored to table IWA.BusinessData and indexed to Elastic Search cluster. Normally ivy will create that index from that table when it start by this command: DiCore.getGlobalInjector().getInstance(ElasticSearchServerManager.class).startIndexRecreation();

In my case, i want to do it in opposite way that collecting data from index table then persist to IWA.BusinessData, just imagine that table has lost data for some reasons so i want to recover it. Can i do it in ivy?

Thanks

asked 08.08 at 06:58

trungdv's gravatar image

trungdv
335376169
accept rate: 52%


You could do it if you have a very primitive data structure - but it is a task where you will get very dirty hands. Because the structure of the JSON in Elastic Search is optimized for search while the JSON in IWA_BusinessData is optimized for beeing perfectly serializable by Java.

Main differences:

  • elastic search JSON knows no java types. If you have an abstract type in your data, the concrete type that was serialized must be written into the JSON or the JVM does not know which type to instantiate while deserialization
  • elastic search JSON does not knows objects that are equally used multiple times within the same object tree. Means if you used for instance an instance of Person that is refered multiple times in the same root Business Data you have no way to load this data with the JVM and know that the objects are the same.
  • elastic search JSON stores arrays in different format. Deserializtion will fail in the JVM

So no. In case of a data loss, one should better restore the data from a backup dump of the database. But you can try to re-store the JSON structure that IWA_BusinessData likes if you have a very simple object hierarchy - because then the JSON may could be easily refactored by hand.

link

answered 08.08 at 08:00

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
6.0k11035
accept rate: 69%

edited 08.08 at 08:11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5
×5

Asked: 08.08 at 06:58

Seen: 143 times

Last updated: 08.08 at 08:11