0
votes

For example, I have entities Book and Author. I am interested only in Books, but I would like to search Books by Author's email (Book -> Author -> email).

Should create caches both for Author and Book or single Book cache is enough?

1

1 Answers

1
votes

This seems to be a modeling question. You should model Ignite caches the same way you would model RDBMS tables. The cleanest design would be to have 2 tables, Book and Author, but if you know that the only query you will run is the search of Books by author's email, then adding author's email to the Books table will be more efficient.

Also, if you have 2 related caches or tables, then you need to properly collocate your data in order to execute JOIN queries. More on collocation here: https://apacheignite.readme.io/docs/affinity-collocation