A: 

Pro's of a Database Only Solution:

  • Less set up and maintenance (you already have a database)
  • If you want to JOIN your search results with other data or otherwise manipulate them you will be able to do so natively in the database
  • There will be no time lag (if you periodically sync Solr with your database) or maintenance procedure (if you opt to add/update entries in Solr in real time everywhere you insert them into the database)

Pro's of a Solr Solution:

  • Performance: Solr handles caching and is fast out of the box
  • Spell check - If you are planning on doing spell check type stuff Solr handles this natively
  • Set up and tuning of Solr isn't very painful, although it helps if you are familiar with Java application servers
  • Although you seem to have simple requirements, I think you are getting at having some kind of logic around search for words; Solr does this very well

You may also want to consider future requirements (what if your documents end up having more than just a title field and you want to assign some kind of relevancy? What if you decide to allow people to search the body text of these entities and/or you want to index other document types like MS Word? What if you want to facet search results? Solr is good at all of these).

I am not sure if you would need to create an entry for every word in your database, vs. just '%[query_word]%' search if you are going to create records with each word anyway. It may be simpler to just go with a database for starters, since the requirements seem pretty simple. It should be fairly easy to scale the database performance.

I can tell you we use Solr on site and we love the performance and we use it for even very simple lookups. However, one thing we are missing is a way to combine Solr data with database data. And there is extra maintenance. At the end of the day there is not an easy answer.

hross
Thanks for the elaborate answer! There's a problem with using % on both sides because an index is only used if the left-most prefix is known. I think you're very right with your point regarding future requirements (spell-checking, for one). Guess I'll give Solr a try then :)
Shmulik