2

I'm building a system where I use Solr for search over my content, and MySQL to store the content. The rationale is that MySQL is a good persistent storage solution, and I can join data with other tables and have more versatile queries. On the other hand, I'm looking for very high performance in my reads.

Would it be better to use Solr to both search and store the data, and retrieve the data items directly from Solr, rather than getting an index from Solr and then performing a Select on MySQL?

I would still technically need to goto MySQL to grab related data, but perhaps I could store that in Solr as well.

More to the point - is Solr a reasonable data storage solution in this context? (Would still store in MySQL for persistence in either case).

1 Answer 1

2

It depends on what you need from the results.

You can certainly store documents in Solr with extra fields, and I believe you can declare some fields as part of the document, but not part of the index. Depending on what you need from a search result, you may be able to get all you need frm the extra fields to satisfy the search. If that is the case, you can skip the secondary lookup to MySQL.

Also consider how current you need the data to be. Is it sufficient to fetch data from the Solr index, given that it may not be in sync with the latest changes from MySQL? Or do you need to fetch from MySQL to ensure you have the latest data?

Sign up to request clarification or add additional context in comments.

1 Comment

In this case, the solr index will be updated in real time directly from the app as apposed to in buckets from MySQL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.