Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr in a multi-tenant environment

Tags:

solr

I am considering using Solr in a multi-tenant application and I am wondering if there are any best practices or things I should watch out for?

One question in particular is would it make sense to have a Solr Core per tenant. Are there any issues with have a large number of Solr Cores? I am considering use a core per tenant because I could secure each core separately.

Thanks

like image 353
M.. Avatar asked Mar 24 '10 16:03

M..


People also ask

What is a multi-tenancy environment?

In a multi-tenant architecture, multiple instances of an application operate in a shared environment. This architecture is able to work because each tenant is integrated physically, but logically separated; meaning that a single instance of the software will run on one server and then serve multiple tenants.

What is multi-tenant with example?

Multitenancy is a software architecture where a single software instance can serve multiple, distinct user groups. Software-as-a-service (SaaS) offerings are an example of multitenant architecture.

Which feature is supported in Solr search?

Solr also supports a feature called MoreLikeThis, which enables users to submit new queries that focus on particular terms returned in an earlier query. MoreLikeThis queries can make use of faceting or clustering to provide additional aid to users.

Why Apache Solr is used?

Apache Solr is an open source search platform built upon a Java library called Lucene. Solr is a popular search platform for Web sites because it can index and search multiple sites and return recommendations for related content based on the search query's taxonomy.


1 Answers

Solr Cores are an excellent idea for multitenant, particularly as they can be managed at runtime (so not requiring a server restart). You shouldn't run into too many problems with performance for having multiple Solr cores, but be aware the performance of one core will be impacted by the work on other cores - they're probably going to be sharing the same disk.

I can see why you might want to give direct API access - for example if each 'user' is a Drupal site or similar, for a shared hosting type environment. The best thing would be to secure the different URLs, e.g. if you had /solr/admin/cores, /solr/client1 for a client core, and /solr/client2 for another, you would have three different authentications, one for your admin, and one each for your tenants. This is done in the container (Jetty, Tomcat etc.), take a look at the general Solr Security page: http://wiki.apache.org/solr/SolrSecurity - you'll want to setup a basic access login for each path in the same way.

like image 79
Ian Barber Avatar answered Sep 19 '22 20:09

Ian Barber