> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Backend search with InstantSearch Android

> Set up search on your backend with InstantSearch Android.

## Frontend versus backend search

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](/doc/guides/building-search-ui/getting-started/android) and [Autocomplete](/doc/ui-libraries/autocomplete/introduction/getting-started)) 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.

## How to implement backend search

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 one of the Algolia API clients.

### Backend InstantSearch

[Backend InstantSearch](/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/android) 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:

* [Backend search with an API client](/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-search-with-an-api-client/android)
* [Pagination](/doc/api-reference/api-parameters/page)
* [Highlighting](/doc/api-reference/api-parameters/attributesToHighlight)
* [Snippeting](/doc/api-reference/api-parameters/attributesToSnippet)
