Reputation: 245
I have an eCommerce site and I wanted to implement search in it. After reading a lot about Lucene and SOLR, I finally choose SOLR as it adds functionality like JSON API facets, and a lot more.
SOLR comes with a builtin Jetty server, running in background, and my webapp is running on Tomcat server. I wanted to know what would be better for me in long run, performance wise and ease of customization and use, whether to leave SOLR as standalone on a different Jetty server or to integrate SOLR within Tomcat, by listing in JAVA_OPTS
in catalina.bat
?
I personally feel putting SOLR in Tomcat will reduce my performance as it will take more time to load, and I don't want SOLR to restart every time I redeploy my webapp, but then it being all together at one place maybe a plus point (not sure). I am looking forward for some opinion from guys who have been using SOLR, as to what would be the best for me, the data set is huge and also attract thousands of users every day.
Upvotes: 3
Views: 756
Reputation: 5370
Considering security, you may want your solr server to be isolated and to be accessed only from your webapp.
In this case, it would be better to host to a different instance not binded on a public address.
Upvotes: 0
Reputation: 7944
Mauricio's answer is a good one.
The counter-point to the operational simplicity of sharing the same Tomcat is the potential safety from isolating Solr into its own entire JVM and heap. That way you don't have to worry about the case of some memory leak or query of death or gigantic GC pause in Solr taking down your main application.
At Websolr, we run Solr in Tomcat, because it's what we know. However, if we implemented a design where we were to run more than one Java service on the same instance type, we would give serious consideration to switching to multiple Jettys for the increased isolation.
Weigh the pros and cons: Operational simplicity versus total isolation. Your mileage may vary. If this kind of isolation is not compelling, stick to hosting within Tomcat. If anything about that makes you nervous, set up monit and munin to keep an eye on everything.
And don't restart all of Tomcat just to reload one of its web applications.
Upvotes: 1
Reputation: 99720
Having it all on a single Tomcat instance will make administration easier. You can easily redeploy your webapp independently of Solr, Tomcat is designed to host multiple applications. If you have to put both Solr and your web app in a single box, I'd avoid having two web servers unless you have a real, measurable, compelling reason.
Upvotes: 2