Sanne Grinovero thank you for your clear insight on the internals. Yes I'm facing the problem where in many places the directoryProvider.getDirectory() only called once.
As your question about how I'm handling the tenant data separation, I just exploring Hibernate Search whether it can be used for implementing Global Search in our Hibernate multi-tenancy application. At first thinking, since it has "Hibernate" label on the product name, I assume it will automatically supporting the hibernate multi-tenancy feature
I wonder, what is the consideration not put the "multi-tenancy" feature in Hibernate Search core until now? Is the Hibernate Search core design only perform well without multi-tenancy (since there are many caching, including opened directory, objects, etc.)?
Our application is targeting 1 million users/tenants, with that target I'm thinking a lot about how Hibernate Search using resources, and how to release them when when tenant is not-active (signed out).
Since you've confirmed that I haven't had a clear picture how hibernate search works , it will be wise if I just share some my consideration whether hibernate search can be use practically in an multi-tenancy application: 1. Hibernate search needs to write indexes of requested tenant data only and store it in different locations (not mixed files for all tenants) 2. Hibernate search needs to search in a subset data of the requested tenant only dynamically (no need to define all active tenants first) 3. Hibernate search needs a way to release all resources linked to the requested tenant (example: opened directory, cached objects, etc.). This API will called manually by application code (example: each time the tenant signed off), and automatically (example: if the index for the tenant is idle for defined period of time)
All the tenants are using the exactly the same hibernate entity schema definition, so in a very common thinking, the modification should be related with: 1. How hibernate search read the source data (must be scoped by related tenant) 2. How hibernate search write the indexes (must be routed to related tenant index files) 3. How hibernate search read the indexes (must be routed to related tenant index files)
How many works need to be done to implement this multi-tenancy feature in Hibernate Search? Could it make to the 5.next release?
Thank you
|