2

I have a Spring Boot/React application. I have a list of users in my database I will have populated already from LDAP.

As part of a form, I need to allow users to specify a list of users. Since they could be searching from (and technically specifying as well), up to 400,000 users (most will be in the 10k or less range), I'm assuming I'd need to do this both client and server-side.

Does anyone have any recommendations on the approach or technologies?

I'm not using a small amount of data, but I don't want to over-engineer it either (tips are mostly for server-side, but any are welcome).

Amit
  • 30,756
  • 6
  • 57
  • 88
Matthew Holt
  • 149
  • 1
  • 11

2 Answers2

1

If you are using hibernate as the ORM in your application, you may also checkout Hibernate Search. This seems to serve your purpose as I feel that searching through a list of users can be done using a normal text based index. Hibernate search leverages Lucene, which is suitable for text based indexing and searching.

1

While another answer is good and works perfectly fine when you have a small set of data but be aware of the few design issue with it.

  1. Lucene is not distributed and you can't easily scale it to multiple horizontal machines without duplicating the whole index, which is perfectly fine when you have a small set of data and in-fact it's pretty fast as there will be no network call(in case of elasticsearch, it will be).
  2. If you want to build a stateless application that is easy to HS(horizontally scalablele) then going with Lucene will not be helpful as it stateful and you need to create Lucene index before your newly spawned app-server finished local indexing in Lucene.
  3. Elasticsearch(ES) is rest-based and is written in JAVA and has very good java-client which you can easily use for simple to complex use-cases.

Last but not the least, please go through the STOF answer of none other than shay banon, creator of Elasticsearch, who explains why he created ES in first place :) and which will give more trade-off and insights to choose a best solution for your use-case.

Amit
  • 30,756
  • 6
  • 57
  • 88
  • Thanks so much for the additional info and feedback, helped clarify several questions, I appreciate it! – Matthew Holt Oct 14 '20 at 13:33
  • 1
    Thank you! In this case, I'm using Spring/Hibernate, and it's with a small use case non-distributed, so went with the Hibernate search approach and worked ok for my application. Wish I could select multiple answers as this helped answer questions as well for the use cases. Appreciate your help again! – Matthew Holt Oct 24 '20 at 22:57