Use Case
Design-1
Pros - Optimized and efficient - Lower hits on server, entire data (which is not huge) is loaded into In-Memory DOM for quick and intuitive return of search results.
Cons - Search logic which is business logic is implemented client-side. In future if there's an Use Case that do something like JCR lookup with the values matched in excel, then it has to be done for entire dataset to return all such fields in JSON.
How does the In-Memory DOM know that the data has been refreshed in the backend ? On publish, dispatcher will invalidate the JSON response but how will browser DOM know that and update itself ?
Design-2
Pros - Search logic which is business logic is implemented server-side. More secured. Data transformation logic resides server-side. Not huge volume of data in perspective.
Cons - Less efficient - More hits on server (cache contains json with search term as selector - so the search-term needs to match for the JSON to be returned from cache), page refresh on every search.
Which Design would you prefer ? Or do you have any other design in mind that would be better ?
I would go for option A. Parsing an Excel file is expensive and can add a latency of 1-2 seconds ( No matter which Java Spreadsheet API you are going to use: Apache POI, etc. ).
10K rows is not that many and can be loaded on the client side.
How does the In-Memory DOM know that the data has been refreshed in the backend ? On publish, dispatcher will invalidate the JSON response but how will browser DOM know that and update itself ?
It depends on your implementation. You can fetch the spreadheet JSON every time user searches, or you can fetch it once and cache in DOM. In the latter case the data will be live until refresh.