Asynchronous Search Request Flow for Lower Time To First Result
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing search technologies face delays in providing first search results due to latency issues, leading to increased energy consumption from repeated polling requests and inefficient server interactions.
Innovation Solution
Implementing an asynchronous pre-search request mechanism that initiates a search cycle early, using a persistent connection to reduce polling requests and optimize server interactions, along with geographic region routing and parallel processing of search requests.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If synchronous search requests are used, then search results can be obtained reliably, but Time To First Result (TTFR) increases and user experience deteriorates
Solution Approach 1:
The system performs preliminary actions by sending the search request to the search service server immediately when the search box receives focus, before the user actually submits the search. This pre-initiation of the search cycle reduces TTFR while maintaining reliability through subsequent polling mechanisms.
Solution Approach 2:
The BFF server acts as an intermediary between the browser and the search service server. It manages the polling mechanism and coordinates communication, allowing the system to balance between immediate result delivery and energy-efficient waiting without sacrificing reliability.
2Speed
If frequent polling requests are sent from BFF server to search service server, then search results can be retrieved quickly, but energy consumption increases
Solution Approach 1:
Instead of continuous polling, the system uses periodic polling with strategically determined intervals. The polling frequency is adjusted based on whether results are already available, reducing unnecessary requests and energy consumption while maintaining fast result delivery when needed.
Solution Approach 2:
The search service server is designed to proactively push results back to the BFF server when available, reducing the need for continuous client-side polling. This self-service mechanism allows the server to manage its own communication节奏, reducing overall energy consumption.
3Loss of time
If asynchronous pre-search request is sent early, then TTFR is reduced, but system complexity increases
Solution Approach 1:
The system segments the search functionality into distinct components: the browser with search box, the BFF server with polling logic, and the search service server with result generation. This segmentation allows each component to operate independently with clear interfaces, managing complexity through modular design while enabling asynchronous pre-search.
Solution Approach 2:
The system implements feedback loops where the BFF server polls for results and receives notifications when search results are available. This feedback mechanism coordinates the asynchronous operations between components, managing system complexity through structured communication protocols.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
There is disclosed a computer-implemented method of searching for search results using a search home website, a back-end for front-end (BFF) server, a front end server and a search service server, the method including the steps of: (i) the search home website receiving a search request from a browser executing on a client device, the search request including search parameters; (ii) the search home website sending an asynchronous pre-search request to the search service server, the asynchronous pre-search request including the search parameters, and the search service server initiating a search cycle using the search parameters in response to the asynchronous pre-search request; (iii) the search home website sending to the browser HTML data including a Cascading Style Sheets (CSS) and script tag, wherein the CSS and the script tag are executable in the browser to download CSS and script files from the front end server; (iv) the front end server sending to the browser the CSS and script files, wherein the CSS files are parseable at the browser to render a web page component including a web page style, and wherein the script files are executable at the browser to establish a persistent connection to the back-end for front-end (BFF) server, and to send the search parameters to the BFF server, wherein the BFF server polls the search service server using the search parameters; (v) the search service server recognizing that the search parameters it received in step (iv) correspond to the search parameters it received in step (ii), to use the search cycle initiated in step (ii) to provide first search results from the search cycle to the BFF server, in response to the polling from the BFF server; (vi) the BFF server sending the first search results to the browser executing on the client device, to provide the first search results for display on a screen of the client device. A related system is disclosed.