Security trimming of data at high velocity
On a recent project, we had a challenge of allowing users to perform blisteringly fast complex searches against millions of rows of product data - each row governed by a complex set of user-specific permissions.Â
To give an idea of the complexity, each of the queries has 100+ Â matching or excluding constraints and 5 to 10 field sorting requirements.Â
How do we find, filter and sort through large amounts data at high speed and ensure that each and every query takes  less than 1 millisecond(ms)?
Enter Lucene  in "in-memory" index mode. We were able to get 99% of queries under 1 millisecond. The slowest, most complex edge case takes 38ms.  On modest 2 cpu hardware, I was able to measure amazing sustained throughput of  1800 queries per second and peaks of 3200 queries per second.
Luceneâs OpenBitSet, CachingWrapperFilter customizable concepts helped us to achieve this with relative ease.














