Implementing Search trade-offs : Fusejs vs Elasticsearch vs Algolia

13 Mar 2021 • 2 min read

In this article will discuss the trade-offs of using each of these different search solutions and answer theses two main questions

  • In what context will Fusejs be a sufficient search solution?
  • How Algolia compare to Elasticsearch?

If you are short on time this is a summary


Fuse js 

Elasticsearch 

Algolia 

boyer moore algorithm 

Cost 

Free 

Paid Production env

Free until 1000 records 

Free 

Data limit for search 

Best for very  small data files containing around 15 kb -30kb data  

N/A , elasticsearch showcase 4 billion metadata records are possible for multinational corp 

Setup to support  paid service of 5 million search records a Month 

it depends on variation and optimization

Time to implement 

relatively quick 

Moderate to lengthy 

n/a 

More time, risk recreating the wheel 

Language / Framework support 

Javascript only 

React, VueJS

Backend CLI  

Support many front end and back-end languages 

Any 

in what context fusejs will be sufficient search solution?

FuseJS library is a quick, simple, easy solution for search that can power the search through one npm package for free.

For react , there is  use-fuse

For Vuejs , there is VueFuse

Usefulness of Fusejs will depend on

1- data format (JSON is easiest to work with)

2- nature of the main data ( statics vs dynamic)

3- current data volume and expectation of change in the future

Fusejs work best with data stored in JSON file locally or small set directly from an API

Based on volume of data alone from first hand experience, it works best for JSON files that are 4kb to max 30 KB, if  we are expecting more than 170 data objects to be stored and total more than 30 KB we should look for another solution

below is summary of search experience with different data volumes I personally ran to conclude  Fusejs maximum capacity

# of Data objects 

JSON file size in Kb 

Experience 

30 

4kb 

Great, fast 

169 

14 kb 

Great, fast 

200

29.4 KB

Ok, not optimal 

1000

143.5 kb 

worst, hardly functional 

How does Algolia compare to Elasticsearch?

Algolia is a very popular solution for already structured data and it is constructed to be used more quickly on the front end using API, Algolia is encouraging more front-end setup and accessibility to users with Vuejs and react support  and also eCommerce sites on Shopify, you probably already seen it being used in documentation search in many websites.

Elasticsearch Is built on java and accessible through back-end CLI, there is currently two main ways to use it for production with AWS or on elastic cloud, Elasticsearch search is considered the most powerful search service available, built with scalability in mind, when we think of developing a feature that would be like a mini-google of its own, Elasticsearch would be considered before Algolia

technically Elasticsearch version 5.2 can be used for free for development and testing purposes, but the production version is paid.

Algolia over Elasticsearch is a better choice when we are expecting moderate increase of demand but not more than 5 million monthly searches or any overwhelming amount of data and we are prioritizing front end custom support for react/ vuejs or custom shopify support is a priority/

We should Consider Elasticsearch when

  • We are already working with AWS and have back-end heavy application
  • We are using back-end techstack that pairs well with ES
  • We have search use cases that are dependent on being accessible for enterprise and/ or fewer users with large volumes of data like scientific data .