Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schema considerations when moving from an RDBMS (MySQL) to Solr

Whilst testing a Solr install for a future MySQL -> Solr migration, it's immediately apparent that the "rules" for what constitutes a good data stucture, and by extension an efficient search, are very different in Solr when compared to an RDBMS like MySQL. The most obvious thing being that data isn't (or doesn't seem to be) normalised to the same degree.

Does anyone have any advice regarding the best way to go about making the transition from MySQL to Solr? Are there any established patterns for structuring data in a non-RDBMS (Solr specifically) that I should be learning about? Any common pitfalls to avoid? Is it simply a case of de-normalising related tables into objects?

like image 923
Mathew Avatar asked Oct 14 '22 15:10

Mathew


2 Answers

First of all, you have to ask yourself if you want to:

  1. migrate the whole thing to Solr or
  2. just use Solr as a complement used for searching.

For anything other than non-trivial relational schemas, I'd recommend #2. The more heterogeneous data you have in one index, the less useful it is.

like image 141
Mauricio Scheffer Avatar answered Oct 19 '22 07:10

Mauricio Scheffer


The Solr Enterprise Search Server? If it were me doing it, I would migrate only your documents over, not the entire database. Is that feasible?

like image 35
Robert Harvey Avatar answered Oct 19 '22 09:10

Robert Harvey