Migrating from Algolia to Headband
A short, honest guide for Algolia refugees. Most migrations take a couple of hours. Here's how.
Why migrate?
Four reasons we hear over and over:
1.Pricing escalation
Algolia's PAYG model is fine until you're successful, at which point your search bill grows faster than your revenue. We've talked to teams whose monthly Algolia spend went from $200 to $4,000 in eighteen months without any real change in product behavior.
2.Vendor lock-in
Algolia's API is proprietary. Once your client code is shaped around it, leaving is a project, not a switch.
3.Data sovereignty
Your search index is a copy of your data sitting on someone else's infrastructure. For some teams that's a compliance problem; for others it's just a thing they'd rather not do.
4.Engine flexibility
Algolia is one engine. With Headband you can run Meilisearch for product search, Elasticsearch for logs, and Typesense for docs -- same API, same dashboard, same client code.
The 3-step migration
Install @headband/react
This is the InstantSearch-compatible React kit. If you've been using react-instantsearch with Algolia, you already know about 80% of the API.
npm i @headband/reactReplace algoliasearch(...) with headband(...)
Your client initialization changes by one line. The API surface is intentionally similar.
Replace <InstantSearch> with <HeadbandSearch>
Components have the same names where possible ( <SearchBox>, <Hits>, <RefinementList>, <Pagination> ) and the same prop shapes. The mental model is identical.
Side-by-side: SearchBox + Hits
Before (Algolia)
import algoliasearch from 'algoliasearch/lite';
import {
InstantSearch, SearchBox, Hits
} from 'react-instantsearch';
const searchClient = algoliasearch(
'APP_ID', 'SEARCH_KEY'
);
function App() {
return (
<InstantSearch
searchClient={searchClient}
indexName="products"
>
<SearchBox />
<Hits hitComponent={Hit} />
</InstantSearch>
);
}After (Headband)
import { headband } from '@headband/react';
import {
HeadbandSearch, SearchBox, Hits
} from '@headband/react';
const searchClient = headband({
url: 'https://api.headband.dev',
apiKey: 'YOUR_HEADBAND_KEY',
});
function App() {
return (
<HeadbandSearch
searchClient={searchClient}
indexName="products"
>
<SearchBox />
<Hits hitComponent={Hit} />
</HeadbandSearch>
);
}That's it. The Hit component is unchanged. Your CSS selectors are unchanged. Most of your refinement components will work without modification.
Feature mapping
What doesn't migrate yet
Being honest: Algolia has spent ten years building features that aren't a weekend port.
AI Personalization
Algolia's user-event-driven re-ranking is genuinely better than anything we ship today. On the roadmap, not shipping this quarter.
A/B testing
Coming soon, but for now you'll need an external experimentation tool.
Query Suggestions
Basic version on the roadmap.
Recommend / related items
Vector-based version possible today via the underlying engine, polished product on the roadmap.
If any of these are critical to your business right now, stay on Algolia for those features and migrate the rest. Headband is happy to be one of several layers in your stack.
Cost comparison
For a representative mid-size catalog (~500k records, ~2M monthly search operations):
The point isn't that we're always cheaper -- for small workloads Algolia's free tier is fine. The point is that Headband's price doesn't escalate with success, because it isn't priced per search.
Next steps
Stuck? Open an issue or email us. We answer.
Get started free