Skip to main content
You should use frontend search because:
  • It offers a better response speed. Speed alone justifies the choice. Backend search requires two more trips between a userโ€™s browser and Algoliaโ€™s servers. This decreases the effectiveness of Algoliaโ€™s engine and infrastructure optimizations.
  • UI libraries aid development. Algoliaโ€™s UI libraries (InstantSearch and Autocomplete) help build a frontend solution so that you can focus on configuring relevance and creating the best possible search experience.
  • It frees up your resources. Algolia reduces the need for development and eliminates the requirement for additional server deployments and its associated infrastructure.

Why backend search?

  • Server-side pre-processing. Perhaps the most important reason for a backend solution is to make complex calculations or format your data before displaying the results.
  • Real-time availability updates (like Airbnb)
  • In some situations, SEO is easier to manage.
You only need a few lines of code to send a query to Algolia and receive a response. The response contains everything needed to build your UI. You can perform backend search with either InstantSearch or an Algolia API client.

Backend InstantSearch

Backend InstantSearch offers a good compromise. You perform the search on your servers, carry out any required pre-processing, and then send your results to InstantSearchโ€™s widgets. This enables you to control the query and response but saves you the work of building a custom frontend.

Backend search with an Algolia API client

This option requires a server-side solution and custom frontend development. You manage all queries and responses, and you build the frontend UI. You need to parse the API response: a JSON object. The response includes:
  • Results already formatted for display (full record content, embedded HTML, or image URLs)
  • Highlighting and snippeting
  • Pagination
For more information, see:
โŒ˜I